summaryrefslogtreecommitdiffstats
path: root/share/man/man9
diff options
context:
space:
mode:
authorcem <cem@FreeBSD.org>2016-04-26 19:57:35 +0000
committercem <cem@FreeBSD.org>2016-04-26 19:57:35 +0000
commit973e9835356274e0b1048152e1e59d363a00bcc9 (patch)
tree5e2497f4308883a70696069012a3d15db8658415 /share/man/man9
parentfb3f38bb0debbc390330daf9b681d6905ed5ce18 (diff)
downloadFreeBSD-src-973e9835356274e0b1048152e1e59d363a00bcc9.zip
FreeBSD-src-973e9835356274e0b1048152e1e59d363a00bcc9.tar.gz
osd(9): Change array pointer to array pointer type from void*
This is a minor follow-up to r297422, prompted by a Coverity warning. (It's not a real defect, just a code smell.) OSD slot array reservations are an array of pointers (void **) but were cast to void* and back unnecessarily. Keep the correct type from reservation to use. osd.9 is updated to match, along with a few trivial igor fixes. Reported by: Coverity CID: 1353811 Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'share/man/man9')
-rw-r--r--share/man/man9/osd.917
1 files changed, 9 insertions, 8 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
OpenPOWER on IntegriCloud