diff options
author | phk <phk@FreeBSD.org> | 2004-09-15 21:42:03 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-09-15 21:42:03 +0000 |
commit | 43f0dbec3ceba881973c7fa78183a30a555ba716 (patch) | |
tree | b787b7f3553b534137d49a95f4842786b522615b /sys/kern/vfs_init.c | |
parent | 52a20a8652fa49c93ee01352bee0830888b94b17 (diff) | |
download | FreeBSD-src-43f0dbec3ceba881973c7fa78183a30a555ba716.zip FreeBSD-src-43f0dbec3ceba881973c7fa78183a30a555ba716.tar.gz |
Simplify initialization of va_null a little bit.
Diffstat (limited to 'sys/kern/vfs_init.c')
-rw-r--r-- | sys/kern/vfs_init.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c index be8f2af..bba6c52 100644 --- a/sys/kern/vfs_init.c +++ b/sys/kern/vfs_init.c @@ -60,6 +60,13 @@ int maxvfsconf = VFS_GENERIC + 1; struct vfsconfhead vfsconf = TAILQ_HEAD_INITIALIZER(vfsconf); /* + * A Zen vnode attribute structure. + * + * Initialized when the first filesystem registers by vfs_register(). + */ +struct vattr va_null; + +/* * vfs_init.c * * Allocate and fill in operations vectors. @@ -347,7 +354,6 @@ vfs_rm_vnodeops(const void *data) /* * Routines having to do with the management of the vnode table. */ -struct vattr va_null; struct vfsconf * vfs_byname(const char *name) @@ -360,24 +366,18 @@ vfs_byname(const char *name) return (NULL); } -/* - * Initialize the vnode structures and initialize each filesystem type. - */ -/* ARGSUSED*/ -static void -vfsinit(void *dummy) -{ - - vattr_null(&va_null); -} -SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_FIRST, vfsinit, NULL) - /* Register a new filesystem type in the global table */ int vfs_register(struct vfsconf *vfc) { struct sysctl_oid *oidp; struct vfsops *vfsops; + static int once; + + if (!once) { + vattr_null(&va_null); + once = 1; + } if (vfc->vfc_version != VFS_VERSION) { printf("ERROR: filesystem %s, unsupported ABI version %x\n", |