From 22d9ceb616a1ba667c10149f063bb3a9ca82e4b3 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sun, 20 Dec 2009 14:04:05 +0100 Subject: [PATCH] hash.9: Update the manual page for the *_ext() functions. --- share/man/man9/Makefile | 4 +++- share/man/man9/hash.9 | 51 ++++++++++++++++++++++++++----------------------- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 4020fc2567..9fd9befe09 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -393,7 +393,9 @@ MLINKS+=fetch.9 fubyte.9 \ MLINKS+=firmware.9 firmware_image_load.9 \ firmware.9 firmware_image_unload.9 MLINKS+=hash.9 hashinit.9 \ - hash.9 phashinit.9 + hash.9 hashinit_ext.9 \ + hash.9 phashinit.9 \ + hash.9 phashinit_ext.9 MLINKS+=ioctl.9 _IOR.9 \ ioctl.9 _IOW.9 \ ioctl.9 _IOWR.9 \ diff --git a/share/man/man9/hash.9 b/share/man/man9/hash.9 index 31d29109d8..d1a6bc1dcb 100644 --- a/share/man/man9/hash.9 +++ b/share/man/man9/hash.9 @@ -31,24 +31,28 @@ .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $DragonFly: src/share/man/man9/hash.9,v 1.4 2006/10/19 18:44:00 swildner Exp $ -.\" -.Dd May 14, 2004 +.Dd December 20, 2009 .Os .Dt HASH 9 .Sh NAME .Nm hash , .Nm hashinit , -.Nm phashinit +.Nm hashinit_ext , +.Nm phashinit , +.Nm phashinit_ext .Nd generic hash table functions for the kernel .Sh SYNOPSIS .In sys/param.h .In sys/systm.h .In sys/malloc.h .Ft void * -.Fn hashinit "int elements" "struct malloc_type *type" "u_long *hashmask" +.Fn hashinit "int count" "struct malloc_type *type" "u_long *hashmask" +.Ft void * +.Fn hashinit_ext "int count" "size_t size" "struct malloc_type *type" "u_long *hashmask" .Ft void * -.Fn phashinit "int elements" "struct malloc_type *type" "u_long *nentries" +.Fn phashinit "int count" "struct malloc_type *type" "u_long *nentries" +.Ft void * +.Fn phashinit_ext "int count" "size_t size" "struct malloc_type *type" "u_long *nentries" .Sh DESCRIPTION The kernel hash functions are used for creating a generic hash table. .Pp @@ -56,8 +60,8 @@ The .Fn hashinit function returns a pointer to a hash table which is sized a .Dq "power of two" -greater or equal to the number of -.Fa elements +greater or equal to the element +.Fa count requested. The masking value is stored in .Fa hashmask . @@ -65,8 +69,8 @@ The masking value is stored in The .Fn phashinit function returns a pointer to a prime number sized hash table. -The number of -.Fa elements +The element +.Fa count requested is used to dictate an upper-bound for the size of the hash table. The final size of the hash table is stored by the function in @@ -79,26 +83,25 @@ of memory allocated for the hash table. See the .Xr kmalloc 9 manual page for more information on memory statistics. -.Sh CODE REFERENCES -The VFS namecache code is one of many examples for using the -.Fn hashinit -function; it is located within the file -.Pa sys/kern/vfs_cache.c . .Pp -The hostcache code uses the +The +.Fn hashinit_ext +and +.Fn phashinit_ext +functions are extended versions of +.Fn hashinit +and .Fn phashinit -function for creating a prime number sized hash table; it is located -within the file -.Pa sys/net/hostcache.c . -.Pp -All pathnames in this section are relative to the -.Dx -source tree. +which take the structure +.Fa size +as an additional argument and will zero the array instead of assuming that +it is an array of +.Dv LIST_HEAD Ns s . .Sh SEE ALSO .Xr tcp 4 , .Xr udp 4 , .Xr kmalloc 9 , -.Xr namei 9 +.Xr nlookup 9 .Sh AUTHORS This manual page was written by .An Hiten Pandya Aq hmp@backplane.com . -- 2.11.4.GIT