Skip to content

Commit 3d453e6

Browse files
braunertehcaster
authored andcommitted
slab: remove kmem_cache_create_rcu()
Now that we have ported all users of kmem_cache_create_rcu() to struct kmem_cache_args the function is unused and can be removed. Reviewed-by: Kees Cook <[email protected]> Reviewed-by: Jens Axboe <[email protected]> Reviewed-by: Mike Rapoport (Microsoft) <[email protected]> Reviewed-by: Vlastimil Babka <[email protected]> Signed-off-by: Christian Brauner <[email protected]> Reviewed-by: Roman Gushchin <[email protected]> Signed-off-by: Vlastimil Babka <[email protected]>
1 parent 5f7d256 commit 3d453e6

File tree

2 files changed

+0
-46
lines changed

2 files changed

+0
-46
lines changed

include/linux/slab.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,6 @@ struct kmem_cache *kmem_cache_create_usercopy(const char *name,
271271
slab_flags_t flags,
272272
unsigned int useroffset, unsigned int usersize,
273273
void (*ctor)(void *));
274-
struct kmem_cache *kmem_cache_create_rcu(const char *name, unsigned int size,
275-
unsigned int freeptr_offset,
276-
slab_flags_t flags);
277274

278275
/* If NULL is passed for @args, use this variant with default arguments. */
279276
static inline struct kmem_cache *

mm/slab_common.c

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -420,49 +420,6 @@ struct kmem_cache *__kmem_cache_create(const char *name, unsigned int size,
420420
}
421421
EXPORT_SYMBOL(__kmem_cache_create);
422422

423-
/**
424-
* kmem_cache_create_rcu - Create a SLAB_TYPESAFE_BY_RCU cache.
425-
* @name: A string which is used in /proc/slabinfo to identify this cache.
426-
* @size: The size of objects to be created in this cache.
427-
* @freeptr_offset: The offset into the memory to the free pointer
428-
* @flags: SLAB flags
429-
*
430-
* Cannot be called within an interrupt, but can be interrupted.
431-
*
432-
* See kmem_cache_create() for an explanation of possible @flags.
433-
*
434-
* By default SLAB_TYPESAFE_BY_RCU caches place the free pointer outside
435-
* of the object. This might cause the object to grow in size. Callers
436-
* that have a reason to avoid this can specify a custom free pointer
437-
* offset in their struct where the free pointer will be placed.
438-
*
439-
* Note that placing the free pointer inside the object requires the
440-
* caller to ensure that no fields are invalidated that are required to
441-
* guard against object recycling (See SLAB_TYPESAFE_BY_RCU for
442-
* details.).
443-
*
444-
* Using zero as a value for @freeptr_offset is valid. To request no
445-
* offset UINT_MAX must be specified.
446-
*
447-
* Note that @ctor isn't supported with custom free pointers as a @ctor
448-
* requires an external free pointer.
449-
*
450-
* Return: a pointer to the cache on success, NULL on failure.
451-
*/
452-
struct kmem_cache *kmem_cache_create_rcu(const char *name, unsigned int size,
453-
unsigned int freeptr_offset,
454-
slab_flags_t flags)
455-
{
456-
struct kmem_cache_args kmem_args = {
457-
.freeptr_offset = freeptr_offset,
458-
.use_freeptr_offset = true,
459-
};
460-
461-
return __kmem_cache_create_args(name, size, &kmem_args,
462-
flags | SLAB_TYPESAFE_BY_RCU);
463-
}
464-
EXPORT_SYMBOL(kmem_cache_create_rcu);
465-
466423
static struct kmem_cache *kmem_buckets_cache __ro_after_init;
467424

468425
/**

0 commit comments

Comments
 (0)