Untangle vfsinit() a bit. Use seperate sysinit functions rather than
having a super-function calling bits all over the place.
This commit is contained in:
parent
7ca7bbb36b
commit
138e514cb5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=69664
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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>
|
||||
@ -55,6 +56,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.
|
||||
*
|
||||
|
@ -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
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user