diff options
-rw-r--r-- | sys/kern/vfs_cache.c | 8 | ||||
-rw-r--r-- | sys/kern/vfs_export.c | 6 | ||||
-rw-r--r-- | sys/kern/vfs_init.c | 25 | ||||
-rw-r--r-- | sys/kern/vfs_lookup.c | 14 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 6 | ||||
-rw-r--r-- | sys/sys/systm.h | 2 |
6 files changed, 29 insertions, 32 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 114426e..b405d14 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -346,13 +346,15 @@ cache_enter(dvp, vp, cnp) /* * Name cache initialization, from vfs_init() when we are booting */ -void -nchinit() +static void +nchinit(void *dummy __unused) { TAILQ_INIT(&ncneg); - nchashtbl = hashinit(desiredvnodes*2, M_VFSCACHE, &nchash); + nchashtbl = hashinit(desiredvnodes * 2, M_VFSCACHE, &nchash); } +SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nchinit, NULL) + /* * Invalidate all entries to a particular vnode. diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index 5042d28..8bfc501 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -244,8 +244,8 @@ static int vfs_hang_addrlist __P((struct mount *mp, struct netexport *nep, /* * Initialize the vnode management data structures. */ -void -vntblinit() +static void +vntblinit(void *dummy __unused) { desiredvnodes = maxproc + cnt.v_page_count / 4; @@ -263,6 +263,8 @@ vntblinit() &syncer_mask); syncer_maxdelay = syncer_mask + 1; } +SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_FIRST, vntblinit, NULL) + /* * Mark a mount point as busy. Used to synchronize access and to delay diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c index d0fff71..3a053cf 100644 --- a/sys/kern/vfs_init.c +++ b/sys/kern/vfs_init.c @@ -53,15 +53,9 @@ MALLOC_DEFINE(M_VNODE, "vnodes", "Dynamically allocated vnodes"); /* - * Zone for namei + * The highest defined VFS number. */ -struct vm_zone *namei_zone; - -/* - * vfs_init() will set maxvfsconf - * to the highest defined type number. - */ -int maxvfsconf; +int maxvfsconf = VFS_GENERIC + 1; struct vfsconf *vfsconf; /* @@ -304,22 +298,7 @@ static void vfsinit(void *dummy) { - namei_zone = zinit("NAMEI", MAXPATHLEN, 0, 0, 2); - - /* - * Initialize the vnode table - */ - vntblinit(); - /* - * Initialize the vnode name cache - */ - nchinit(); - /* - * Initialize each file system type. - * Vfs type numbers must be distinct from VFS_GENERIC (and VFS_VFSCONF). - */ vattr_null(&va_null); - maxvfsconf = VFS_GENERIC + 1; } SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_FIRST, vfsinit, NULL) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index b963a94..c95e020 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -43,6 +43,7 @@ #include <sys/param.h> #include <sys/systm.h> +#include <sys/kernel.h> #include <sys/namei.h> #include <sys/vnode.h> #include <sys/mount.h> @@ -56,6 +57,19 @@ #include <vm/vm_zone.h> /* + * Allocation zone for namei + */ +struct vm_zone *namei_zone; + +static void +nameiinit(void *dummy __unused) +{ + + namei_zone = zinit("NAMEI", MAXPATHLEN, 0, 0, 2); +} +SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nameiinit, NULL) + +/* * Convert a pathname into a pointer to a locked inode. * * The FOLLOW flag is set when symbolic links are to be followed diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 5042d28..8bfc501 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -244,8 +244,8 @@ static int vfs_hang_addrlist __P((struct mount *mp, struct netexport *nep, /* * Initialize the vnode management data structures. */ -void -vntblinit() +static void +vntblinit(void *dummy __unused) { desiredvnodes = maxproc + cnt.v_page_count / 4; @@ -263,6 +263,8 @@ vntblinit() &syncer_mask); syncer_maxdelay = syncer_mask + 1; } +SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_FIRST, vntblinit, NULL) + /* * Mark a mount point as busy. Used to synchronize access and to delay diff --git a/sys/sys/systm.h b/sys/sys/systm.h index fc8b9b1..b615eea 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -181,9 +181,7 @@ void adjust_timeout_calltodo __P((struct timeval *time_change)); /* Initialize the world */ void consinit __P((void)); void cpu_initclocks __P((void)); -void nchinit __P((void)); void usrinfoinit __P((void)); -void vntblinit __P((void)); /* Finalize the world. */ void shutdown_nice __P((int)); |