summaryrefslogtreecommitdiff
path: root/kern
diff options
context:
space:
mode:
Diffstat (limited to 'kern')
-rw-r--r--kern/slab.c4
-rw-r--r--kern/slab.h12
-rw-r--r--kern/slab_i.h2
3 files changed, 9 insertions, 9 deletions
diff --git a/kern/slab.c b/kern/slab.c
index 2ab64fe..ca8b44a 100644
--- a/kern/slab.c
+++ b/kern/slab.c
@@ -539,7 +539,7 @@ static inline void kmem_cpu_pool_push(struct kmem_cpu_pool *cpu_pool, void *obj)
static int kmem_cpu_pool_fill(struct kmem_cpu_pool *cpu_pool,
struct kmem_cache *cache)
{
- kmem_cache_ctor_t ctor;
+ kmem_ctor_fn_t ctor;
void *buf;
int i;
@@ -691,7 +691,7 @@ static void kmem_cache_compute_sizes(struct kmem_cache *cache, int flags)
}
void kmem_cache_init(struct kmem_cache *cache, const char *name,
- size_t obj_size, size_t align, kmem_cache_ctor_t ctor,
+ size_t obj_size, size_t align, kmem_ctor_fn_t ctor,
kmem_slab_alloc_fn_t slab_alloc_fn,
kmem_slab_free_fn_t slab_free_fn, int flags)
{
diff --git a/kern/slab.h b/kern/slab.h
index 9466f2d..52aa11b 100644
--- a/kern/slab.h
+++ b/kern/slab.h
@@ -62,12 +62,12 @@ struct kmem_cache;
*
* The pre-constructed state of an object is supposed to include only
* elements such as e.g. linked lists, locks, reference counters. Therefore
- * constructors are expected to 1) never fail and 2) not need any
- * user-provided data. The first constraint implies that object construction
- * never performs dynamic resource allocation, which also means there is no
- * need for destructors.
+ * constructors are expected to 1) never block, 2) never fail and 3) not
+ * need any user-provided data. As a result, object construction never
+ * performs dynamic resource allocation, which removes the need for
+ * destructors.
*/
-typedef void (*kmem_cache_ctor_t)(void *obj);
+typedef void (*kmem_ctor_fn_t)(void *);
/*
* Types for slab allocation/free functions.
@@ -104,7 +104,7 @@ extern vm_map_t kmem_map;
* (vm_kmem on the kernel map) is used for the allocation/free action.
*/
void kmem_cache_init(struct kmem_cache *cache, const char *name,
- size_t obj_size, size_t align, kmem_cache_ctor_t ctor,
+ size_t obj_size, size_t align, kmem_ctor_fn_t ctor,
kmem_slab_alloc_fn_t slab_alloc_fn,
kmem_slab_free_fn_t slab_free_fn, int flags);
diff --git a/kern/slab_i.h b/kern/slab_i.h
index a609efb..06da0ea 100644
--- a/kern/slab_i.h
+++ b/kern/slab_i.h
@@ -200,7 +200,7 @@ struct kmem_cache {
unsigned long bufs_per_slab;
unsigned long nr_objs; /* Number of allocated objects */
unsigned long nr_free_slabs;
- kmem_cache_ctor_t ctor;
+ kmem_ctor_fn_t ctor;
/* All fields below are cold */
size_t obj_size; /* User-provided size */
/* Assuming ! SLAB_USE_CPU_POOLS, here is the cacheline boundary */