diff options
-rw-r--r-- | share/man/man9/osd.9 | 17 | ||||
-rw-r--r-- | sys/compat/linux/linux_mib.c | 2 | ||||
-rw-r--r-- | sys/kern/kern_osd.c | 8 | ||||
-rw-r--r-- | sys/kern/sysv_msg.c | 2 | ||||
-rw-r--r-- | sys/kern/sysv_sem.c | 2 | ||||
-rw-r--r-- | sys/kern/sysv_shm.c | 2 | ||||
-rw-r--r-- | sys/sys/osd.h | 6 |
7 files changed, 20 insertions, 19 deletions
diff --git a/share/man/man9/osd.9 b/share/man/man9/osd.9 index c27b5d9..0668b9d 100644 --- a/share/man/man9/osd.9 +++ b/share/man/man9/osd.9 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 30, 2016 +.Dd April 26, 2016 .Dt OSD 9 .Os .Sh NAME @@ -65,7 +65,7 @@ .Fa "u_int slot" .Fa "void *value" .Fc -.Ft void * +.Ft void ** .Fo osd_reserve .Fa "u_int slot" .Fc @@ -74,12 +74,12 @@ .Fa "u_int type" .Fa "struct osd *osd" .Fa "u_int slot" -.Fa "void *rsv" +.Fa "void **rsv" .Fa "void *value" .Fc .Ft void .Fo osd_free_reserved -.Fa "void *rsv" +.Fa "void **rsv" .Fc .Ft void * .Fo osd_get @@ -314,8 +314,8 @@ the external data associated with a kernel data structure's .Vt struct osd member. The type identifier is used as the index into the outer array, and the slot -identifier is used as the index into the inner array. To set or retrieve a data -pointer for a given type/slot identifier pair, +identifier is used as the index into the inner array. +To set or retrieve a data pointer for a given type/slot identifier pair, .Fn osd_set and .Fn osd_get @@ -341,7 +341,7 @@ is used to grow the array to the appropriate size such that the slot identifier can be used. To maximise the efficiency of any code which calls .Fn osd_set -sequentially on a number of different slot identifiers (e.g. during an +sequentially on a number of different slot identifiers (e.g., during an initialisation phase) one should loop through the slot identifiers in descending order from highest to lowest. This will result in only a single @@ -354,7 +354,8 @@ calls. .Pp It is possible for .Fn osd_set -to fail to allocate this array. To ensure that such allocation succeeds, +to fail to allocate this array. +To ensure that such allocation succeeds, .Fn osd_reserve may be called (in a non-blocking context), and it will pre-allocate the memory via diff --git a/sys/compat/linux/linux_mib.c b/sys/compat/linux/linux_mib.c index 3b102c9..7c9235c 100644 --- a/sys/compat/linux/linux_mib.c +++ b/sys/compat/linux/linux_mib.c @@ -192,7 +192,7 @@ linux_alloc_prison(struct prison *pr, struct linux_prison **lprp) { struct prison *ppr; struct linux_prison *lpr, *nlpr; - void *rsv; + void **rsv; /* If this prison already has Linux info, return that. */ lpr = linux_find_prison(pr, &ppr); diff --git a/sys/kern/kern_osd.c b/sys/kern/kern_osd.c index 41d518f..8dd29f8 100644 --- a/sys/kern/kern_osd.c +++ b/sys/kern/kern_osd.c @@ -202,7 +202,7 @@ osd_set(u_int type, struct osd *osd, u_int slot, void *value) return (osd_set_reserved(type, osd, slot, NULL, value)); } -void * +void ** osd_reserve(u_int slot) { @@ -213,7 +213,7 @@ osd_reserve(u_int slot) } int -osd_set_reserved(u_int type, struct osd *osd, u_int slot, void *rsv, +osd_set_reserved(u_int type, struct osd *osd, u_int slot, void **rsv, void *value) { struct rm_priotracker tracker; @@ -224,7 +224,7 @@ osd_set_reserved(u_int type, struct osd *osd, u_int slot, void *rsv, rm_rlock(&osdm[type].osd_object_lock, &tracker); if (slot > osd->osd_nslots) { - void *newptr; + void **newptr; if (value == NULL) { OSD_DEBUG( @@ -283,7 +283,7 @@ osd_set_reserved(u_int type, struct osd *osd, u_int slot, void *rsv, } void -osd_free_reserved(void *rsv) +osd_free_reserved(void **rsv) { OSD_DEBUG("Discarding reserved slot array."); diff --git a/sys/kern/sysv_msg.c b/sys/kern/sysv_msg.c index 600730c..2a855a6 100644 --- a/sys/kern/sysv_msg.c +++ b/sys/kern/sysv_msg.c @@ -206,7 +206,7 @@ static int msginit() { struct prison *pr; - void *rsv; + void **rsv; int i, error; osd_method_t methods[PR_MAXMETHOD] = { [PR_METHOD_CHECK] = msg_prison_check, diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c index 3ac0367..865ee10 100644 --- a/sys/kern/sysv_sem.c +++ b/sys/kern/sysv_sem.c @@ -260,7 +260,7 @@ static int seminit(void) { struct prison *pr; - void *rsv; + void **rsv; int i, error; osd_method_t methods[PR_MAXMETHOD] = { [PR_METHOD_CHECK] = sem_prison_check, diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index aa5daf9..4232a7f 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -900,7 +900,7 @@ static int shminit(void) { struct prison *pr; - void *rsv; + void **rsv; int i, error; osd_method_t methods[PR_MAXMETHOD] = { [PR_METHOD_CHECK] = shm_prison_check, diff --git a/sys/sys/osd.h b/sys/sys/osd.h index 820e0f4..c838e97 100644 --- a/sys/sys/osd.h +++ b/sys/sys/osd.h @@ -59,10 +59,10 @@ int osd_register(u_int type, osd_destructor_t destructor, void osd_deregister(u_int type, u_int slot); int osd_set(u_int type, struct osd *osd, u_int slot, void *value); -void *osd_reserve(u_int slot); -int osd_set_reserved(u_int type, struct osd *osd, u_int slot, void *rsv, +void **osd_reserve(u_int slot); +int osd_set_reserved(u_int type, struct osd *osd, u_int slot, void **rsv, void *value); -void osd_free_reserved(void *rsv); +void osd_free_reserved(void **rsv); void *osd_get(u_int type, struct osd *osd, u_int slot); void osd_del(u_int type, struct osd *osd, u_int slot); int osd_call(u_int type, u_int method, void *obj, void *data); |