vfs_init.c revision 41056
11541Srgrimes/*
21541Srgrimes * Copyright (c) 1989, 1993
31541Srgrimes *	The Regents of the University of California.  All rights reserved.
41541Srgrimes *
51541Srgrimes * This code is derived from software contributed
61541Srgrimes * to Berkeley by John Heidemann of the UCLA Ficus project.
71541Srgrimes *
81541Srgrimes * Source: * @(#)i405_init.c 2.10 92/04/27 UCLA Ficus project
91541Srgrimes *
101541Srgrimes * Redistribution and use in source and binary forms, with or without
111541Srgrimes * modification, are permitted provided that the following conditions
121541Srgrimes * are met:
131541Srgrimes * 1. Redistributions of source code must retain the above copyright
141541Srgrimes *    notice, this list of conditions and the following disclaimer.
151541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
161541Srgrimes *    notice, this list of conditions and the following disclaimer in the
171541Srgrimes *    documentation and/or other materials provided with the distribution.
181541Srgrimes * 3. All advertising materials mentioning features or use of this software
191541Srgrimes *    must display the following acknowledgement:
201541Srgrimes *	This product includes software developed by the University of
211541Srgrimes *	California, Berkeley and its contributors.
221541Srgrimes * 4. Neither the name of the University nor the names of its contributors
231541Srgrimes *    may be used to endorse or promote products derived from this software
241541Srgrimes *    without specific prior written permission.
251541Srgrimes *
261541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
271541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
281541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
291541Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
301541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
311541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
321541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
331541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
341541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
351541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
361541Srgrimes * SUCH DAMAGE.
371541Srgrimes *
381541Srgrimes *	@(#)vfs_init.c	8.3 (Berkeley) 1/4/94
3941056Speter * $Id: vfs_init.c,v 1.38 1998/11/04 03:18:10 peter Exp $
401541Srgrimes */
411541Srgrimes
421541Srgrimes
431541Srgrimes#include <sys/param.h>
442112Swollman#include <sys/systm.h>
452946Swollman#include <sys/kernel.h>
461541Srgrimes#include <sys/mount.h>
4738869Sbde#include <sys/sysctl.h>
481541Srgrimes#include <sys/vnode.h>
491541Srgrimes#include <sys/malloc.h>
5029653Sdyson#include <vm/vm_zone.h>
511541Srgrimes
5212577Sbde
5330354SphkMALLOC_DEFINE(M_VNODE, "vnodes", "Dynamically allocated vnodes");
5430354Sphk
5510358Sjulian/*
5640435Speter * XXX this bloat just exands the sysctl__vfs linker set a little so that
5740435Speter * we can attach sysctls for VFS modules without expanding the linker set.
5840435Speter * Currently (1998/09/06), only one VFS uses sysctls, so 2 extra linker
5940435Speter * set slots are more than sufficient.
6040435Speter */
6140435Speterextern struct linker_set sysctl__vfs;
6240435Speterstatic int mod_xx;
6340435SpeterSYSCTL_INT(_vfs, OID_AUTO, mod0, CTLFLAG_RD, &mod_xx, 0, "");
6440435SpeterSYSCTL_INT(_vfs, OID_AUTO, mod1, CTLFLAG_RD, &mod_xx, 0, "");
6540435Speter
6640435Speter/*
6729653Sdyson * Zone for namei
6829653Sdyson */
6929653Sdysonstruct vm_zone *namei_zone;
7029653Sdyson
7129653Sdyson/*
721541Srgrimes * vfs_init.c
731541Srgrimes *
741541Srgrimes * Allocate and fill in operations vectors.
751541Srgrimes *
761541Srgrimes * An undocumented feature of this approach to defining operations is that
771541Srgrimes * there can be multiple entries in vfs_opv_descs for the same operations
781541Srgrimes * vector. This allows third parties to extend the set of operations
791541Srgrimes * supported by another layer in a binary compatibile way. For example,
801541Srgrimes * assume that NFS needed to be modified to support Ficus. NFS has an entry
811541Srgrimes * (probably nfs_vnopdeop_decls) declaring all the operations NFS supports by
821541Srgrimes * default. Ficus could add another entry (ficus_nfs_vnodeop_decl_entensions)
831541Srgrimes * listing those new operations Ficus adds to NFS, all without modifying the
841541Srgrimes * NFS code. (Of couse, the OTW NFS protocol still needs to be munged, but
851541Srgrimes * that is a(whole)nother story.) This is a feature.
861541Srgrimes */
8741056Speter
8841056Speter/* Table of known vnodeop vectors (list of VFS vnode vectors) */
8941056Speterstatic struct vnodeopv_desc **vnodeopv_descs;
9041056Speterstatic int vnodeopv_num;
9141056Speter
9241056Speter/* Table of known descs (list of vnode op handlers "vop_access_desc") */
9341056Speterstatic struct vnodeop_desc **vfs_op_descs;
9441056Speterstatic int *vfs_op_desc_refs;			/* reference counts */
9541056Speterstatic int num_op_descs;
9641056Speterstatic int vfs_opv_numops;
9741056Speter
9841056Speterstatic void
9941056Spetervfs_opv_recalc(void)
1001541Srgrimes{
10141056Speter	int i, j;
10212158Sbde	vop_t ***opv_desc_vector_p;
10312158Sbde	vop_t **opv_desc_vector;
1041541Srgrimes	struct vnodeopv_entry_desc *opve_descp;
10541056Speter	struct vnodeopv_desc *opv;
1061541Srgrimes
10741056Speter	if (vfs_op_descs == NULL)
10841056Speter		panic("vfs_opv_recalc called with null vfs_op_descs");
10941056Speter
1101541Srgrimes	/*
11141056Speter	 * Run through and make sure all known descs have an offset
11241056Speter	 *
11341056Speter	 * vop_default_desc is hardwired at offset 1, and offset 0
11441056Speter	 * is a panic sanity check.
1151541Srgrimes	 */
11641056Speter	vfs_opv_numops = 0;
11741056Speter	for (i = 0; i < num_op_descs; i++)
11841056Speter		if (vfs_opv_numops < (vfs_op_descs[i]->vdesc_offset + 1))
11941056Speter			vfs_opv_numops = vfs_op_descs[i]->vdesc_offset + 1;
12041056Speter	for (i = 0; i < num_op_descs; i++)
12141056Speter		if (vfs_op_descs[i]->vdesc_offset == 0)
12241056Speter			vfs_op_descs[i]->vdesc_offset = vfs_opv_numops++;
12340435Speter	/*
12441056Speter	 * Allocate and fill in the vectors
12540435Speter	 */
12641056Speter	for (i = 0; i < vnodeopv_num; i++) {
12741056Speter		opv = vnodeopv_descs[i];
12841056Speter		opv_desc_vector_p = opv->opv_desc_vector_p;
12941056Speter		if (*opv_desc_vector_p)
13041056Speter			FREE(*opv_desc_vector_p, M_VNODE);
13140435Speter		MALLOC(*opv_desc_vector_p, vop_t **,
13240880Speter		       vfs_opv_numops * sizeof(vop_t *), M_VNODE, M_WAITOK);
13341056Speter		if (*opv_desc_vector_p == NULL)
13441056Speter			panic("no memory for vop_t ** vector");
13541056Speter		bzero(*opv_desc_vector_p, vfs_opv_numops * sizeof(vop_t *));
13641056Speter
13741056Speter		/* Fill in, with slot 0 being panic */
13841056Speter		opv_desc_vector = *opv_desc_vector_p;
13941056Speter		opv_desc_vector[0] = (vop_t *)vop_panic;
14041056Speter		for (j = 0; opv->opv_desc_ops[j].opve_op; j++) {
14141056Speter			opve_descp = &(opv->opv_desc_ops[j]);
14241056Speter			opv_desc_vector[opve_descp->opve_op->vdesc_offset] =
14341056Speter				opve_descp->opve_impl;
14441056Speter		}
14541056Speter
14641056Speter		/* Replace unfilled routines with their default (slot 1). */
14741056Speter		opv_desc_vector = *(opv->opv_desc_vector_p);
14841056Speter		if (opv_desc_vector[1] == NULL)
14941056Speter			panic("vfs_opv_recalc: vector without a default.");
15041056Speter		for (j = 0; j < vfs_opv_numops; j++)
15141056Speter			if (opv_desc_vector[j] == NULL)
15241056Speter				opv_desc_vector[j] = opv_desc_vector[1];
15340435Speter	}
15441056Speter}
15540435Speter
15641056Spetervoid
15741056Spetervfs_add_vnodeops(void *data)
15841056Speter{
15941056Speter	struct vnodeopv_desc *opv;
16041056Speter	struct vnodeopv_desc **newopv;
16141056Speter	struct vnodeop_desc **newop;
16241056Speter	int *newref;
16341056Speter	vop_t **opv_desc_vector;
16441056Speter	struct vnodeop_desc *desc;
16541056Speter	struct vnodeopv_entry_desc *opve_descp;
16641056Speter	int i, j, k;
16741056Speter
16841056Speter	opv = (struct vnodeopv_desc *)data;
16941056Speter	MALLOC(newopv, struct vnodeopv_desc **,
17041056Speter	       (vnodeopv_num + 1) * sizeof(*newopv), M_VNODE, M_WAITOK);
17141056Speter	if (newopv == NULL)
17241056Speter		panic("vfs_add_vnodeops: no memory");
17341056Speter	if (vnodeopv_descs) {
17441056Speter		bcopy(vnodeopv_descs, newopv, vnodeopv_num * sizeof(*newopv));
17541056Speter		FREE(vnodeopv_descs, M_VNODE);
17641056Speter	}
17741056Speter	newopv[vnodeopv_num] = opv;
17841056Speter	vnodeopv_descs = newopv;
17941056Speter	vnodeopv_num++;
18041056Speter
18141056Speter	/* See if we have turned up a new vnode op desc */
18241056Speter	opv_desc_vector = *(opv->opv_desc_vector_p);
18341056Speter	for (i = 0; (desc = opv->opv_desc_ops[i].opve_op); i++) {
18441056Speter		for (j = 0; j < num_op_descs; j++) {
18541056Speter			if (desc == vfs_op_descs[j]) {
18641056Speter				/* found it, increase reference count */
18741056Speter				vfs_op_desc_refs[j]++;
18841056Speter				break;
18941056Speter			}
1901541Srgrimes		}
19141056Speter		if (j == num_op_descs) {
19241056Speter			/* not found, new entry */
19341056Speter			MALLOC(newop, struct vnodeop_desc **,
19441056Speter			       (num_op_descs + 1) * sizeof(*newop),
19541056Speter			       M_VNODE, M_WAITOK);
19641056Speter			if (newop == NULL)
19741056Speter				panic("vfs_add_vnodeops: no memory for desc");
19841056Speter			/* new reference count (for unload) */
19941056Speter			MALLOC(newref, int *,
20041056Speter				(num_op_descs + 1) * sizeof(*newref),
20141056Speter				M_VNODE, M_WAITOK);
20241056Speter			if (newref == NULL)
20341056Speter				panic("vfs_add_vnodeops: no memory for refs");
20441056Speter			if (vfs_op_descs) {
20541056Speter				bcopy(vfs_op_descs, newop,
20641056Speter					num_op_descs * sizeof(*newop));
20741056Speter				FREE(vfs_op_descs, M_VNODE);
20841056Speter			}
20941056Speter			if (vfs_op_desc_refs) {
21041056Speter				bcopy(vfs_op_desc_refs, newref,
21141056Speter					num_op_descs * sizeof(*newref));
21241056Speter				FREE(vfs_op_desc_refs, M_VNODE);
21341056Speter			}
21441056Speter			newop[num_op_descs] = desc;
21541056Speter			newref[num_op_descs] = 1;
21641056Speter			vfs_op_descs = newop;
21741056Speter			vfs_op_desc_refs = newref;
21841056Speter			num_op_descs++;
21941056Speter		}
2201541Srgrimes	}
22141056Speter	vfs_opv_recalc();
2221541Srgrimes}
2231541Srgrimes
22441056Spetervoid
22541056Spetervfs_rm_vnodeops(void *data)
2261541Srgrimes{
22741056Speter	struct vnodeopv_desc *opv;
22841056Speter	struct vnodeopv_desc **newopv;
22941056Speter	struct vnodeop_desc **newop;
23041056Speter	int *newref;
23141056Speter	vop_t **opv_desc_vector;
23241056Speter	struct vnodeop_desc *desc;
23341056Speter	struct vnodeopv_entry_desc *opve_descp;
23441056Speter	int i, j, k;
2351541Srgrimes
23641056Speter	opv = (struct vnodeopv_desc *)data;
23741056Speter	/* Lower ref counts on descs in the table and release if zero */
23841056Speter	opv_desc_vector = *(opv->opv_desc_vector_p);
23941056Speter	for (i = 0; (desc = opv->opv_desc_ops[i].opve_op); i++) {
24041056Speter		for (j = 0; j < num_op_descs; j++) {
24141056Speter			if (desc == vfs_op_descs[j]) {
24241056Speter				/* found it, decrease reference count */
24341056Speter				vfs_op_desc_refs[j]--;
24441056Speter				break;
24541056Speter			}
24641056Speter		}
24741056Speter		for (j = 0; j < num_op_descs; j++) {
24841056Speter			if (vfs_op_desc_refs[j] > 0)
24941056Speter				continue;
25041056Speter			if (vfs_op_desc_refs[j] < 0)
25141056Speter				panic("vfs_remove_vnodeops: negative refcnt");
25241056Speter			MALLOC(newop, struct vnodeop_desc **,
25341056Speter			       (num_op_descs - 1) * sizeof(*newop),
25441056Speter			       M_VNODE, M_WAITOK);
25541056Speter			if (newop == NULL)
25641056Speter				panic("vfs_remove_vnodeops: no memory for desc");
25741056Speter			/* new reference count (for unload) */
25841056Speter			MALLOC(newref, int *,
25941056Speter				(num_op_descs - 1) * sizeof(*newref),
26041056Speter				M_VNODE, M_WAITOK);
26141056Speter			if (newref == NULL)
26241056Speter				panic("vfs_remove_vnodeops: no memory for refs");
26341056Speter			for (k = j; k < (num_op_descs - 1); k++) {
26441056Speter				vfs_op_descs[k] = vfs_op_descs[k + 1];
26541056Speter				vfs_op_desc_refs[k] = vfs_op_desc_refs[k + 1];
26641056Speter			}
26741056Speter			bcopy(vfs_op_descs, newop,
26841056Speter				(num_op_descs - 1) * sizeof(*newop));
26941056Speter			bcopy(vfs_op_desc_refs, newref,
27041056Speter				(num_op_descs - 1) * sizeof(*newref));
27141056Speter			FREE(vfs_op_descs, M_VNODE);
27241056Speter			FREE(vfs_op_desc_refs, M_VNODE);
27341056Speter			vfs_op_descs = newop;
27441056Speter			vfs_op_desc_refs = newref;
27541056Speter			num_op_descs--;
27641056Speter		}
27741056Speter	}
27841056Speter
27941056Speter	for (i = 0; i < vnodeopv_num; i++) {
28041056Speter		if (vnodeopv_descs[i] == opv) {
28141056Speter			for (j = i; j < (vnodeopv_num - 1); j++)
28241056Speter				vnodeopv_descs[j] = vnodeopv_descs[j + 1];
28341056Speter			break;
28441056Speter		}
28541056Speter	}
28641056Speter	if (i == vnodeopv_num)
28741056Speter		panic("vfs_remove_vnodeops: opv not found");
28841056Speter	MALLOC(newopv, struct vnodeopv_desc **,
28941056Speter	       (vnodeopv_num - 1) * sizeof(*newopv), M_VNODE, M_WAITOK);
29041056Speter	if (newopv == NULL)
29141056Speter		panic("vfs_remove_vnodeops: no memory");
29241056Speter	bcopy(vnodeopv_descs, newopv, (vnodeopv_num - 1) * sizeof(*newopv));
29341056Speter	FREE(vnodeopv_descs, M_VNODE);
29441056Speter	vnodeopv_descs = newopv;
29541056Speter	vnodeopv_num--;
29641056Speter
29741056Speter	vfs_opv_recalc();
2981541Srgrimes}
2991541Srgrimes
3001541Srgrimes/*
3011541Srgrimes * Routines having to do with the management of the vnode table.
3021541Srgrimes */
3031541Srgrimesstruct vattr va_null;
3041541Srgrimes
3051541Srgrimes/*
3061541Srgrimes * Initialize the vnode structures and initialize each file system type.
3071541Srgrimes */
30810358Sjulian/* ARGSUSED*/
30910358Sjulianstatic void
31041056Spetervfsinit(void *dummy)
3111541Srgrimes{
3121541Srgrimes
31329653Sdyson	namei_zone = zinit("NAMEI", MAXPATHLEN, 0, 0, 2);
31429653Sdyson
3151541Srgrimes	/*
3161541Srgrimes	 * Initialize the vnode table
3171541Srgrimes	 */
3181541Srgrimes	vntblinit();
3191541Srgrimes	/*
3201541Srgrimes	 * Initialize the vnode name cache
3211541Srgrimes	 */
3221541Srgrimes	nchinit();
3231541Srgrimes	/*
3241541Srgrimes	 * Initialize each file system type.
32539975Sobrien	 * Vfs type numbers must be distinct from VFS_GENERIC (and VFS_VFSCONF).
3261541Srgrimes	 */
3271541Srgrimes	vattr_null(&va_null);
32840435Speter	maxvfsconf = VFS_GENERIC + 1;
32940435Speter}
33041056SpeterSYSINIT(vfs, SI_SUB_VFS, SI_ORDER_FIRST, vfsinit, NULL)
33140435Speter
33240435Speterint
33341056Spetervfs_register(struct vfsconf *vfc)
33440435Speter{
33540435Speter	struct linker_set *l;
33640435Speter	struct sysctl_oid **oidpp;
33740435Speter	struct vfsconf *vfsp;
33840648Sphk	int i, exists;
33940435Speter
34040435Speter	vfsp = NULL;
34140435Speter	l = &sysctl__vfs;
34240435Speter	if (vfsconf)
34340435Speter		for (vfsp = vfsconf; vfsp->vfc_next; vfsp = vfsp->vfc_next)
34440435Speter			if (!strcmp(vfc->vfc_name, vfsp->vfc_name))
34540435Speter				return EEXIST;
34640435Speter
34740435Speter	vfc->vfc_typenum = maxvfsconf++;
34840435Speter	if (vfc->vfc_vfsops->vfs_oid != NULL) {
34940637Sbde		/*
35040637Sbde		 * Attach the oid to the "vfs" node of the sysctl tree if
35140637Sbde		 * it isn't already there (it will be there for statically
35240637Sbde		 * configured vfs's).
35340637Sbde		 */
35440637Sbde		exists = 0;
35540637Sbde		for (i = l->ls_length,
35640637Sbde		    oidpp = (struct sysctl_oid **)l->ls_items;
35740637Sbde		    i-- != 0; oidpp++)
35840637Sbde			if (*oidpp == vfc->vfc_vfsops->vfs_oid) {
35940435Speter				exists = 1;
36040435Speter				break;
36140435Speter			}
36240637Sbde		if (exists == 0)
36340637Sbde			for (i = l->ls_length,
36440637Sbde			    oidpp = (struct sysctl_oid **)l->ls_items;
36540637Sbde			    i-- != 0; oidpp++) {
36640637Sbde				if (*oidpp == NULL ||
36740637Sbde				    *oidpp == &sysctl___vfs_mod0 ||
36840637Sbde				    *oidpp == &sysctl___vfs_mod1) {
36940637Sbde					*oidpp = vfc->vfc_vfsops->vfs_oid;
37040637Sbde					break;
37140637Sbde				}
37240637Sbde			}
37340637Sbde
37440637Sbde		vfc->vfc_vfsops->vfs_oid->oid_number = vfc->vfc_typenum;
37540637Sbde		sysctl_order_all();
3761541Srgrimes	}
37740435Speter	if (vfsp)
37840435Speter		vfsp->vfc_next = vfc;
37940435Speter	else
38040435Speter		vfsconf = vfc;
38140435Speter	vfc->vfc_next = NULL;
38240435Speter
38340435Speter	/*
38440435Speter	 * Call init function for this VFS...
38540435Speter	 */
38640435Speter	(*(vfc->vfc_vfsops->vfs_init))(vfc);
38740435Speter
38840435Speter	return 0;
3891541Srgrimes}
3902946Swollman
39140435Speter
39240435Speterint
39341056Spetervfs_unregister(struct vfsconf *vfc)
39440435Speter{
39540435Speter	struct linker_set *l;
39640435Speter	struct sysctl_oid **oidpp;
39740435Speter	struct vfsconf *vfsp, *prev_vfsp;
39840435Speter	int error, i, maxtypenum;
39940435Speter
40040435Speter	i = vfc->vfc_typenum;
40140435Speter
40240435Speter	prev_vfsp = NULL;
40340435Speter	for (vfsp = vfsconf; vfsp;
40440435Speter			prev_vfsp = vfsp, vfsp = vfsp->vfc_next) {
40540435Speter		if (!strcmp(vfc->vfc_name, vfsp->vfc_name))
40640435Speter			break;
40740435Speter	}
40840435Speter	if (vfsp == NULL)
40940435Speter		return EINVAL;
41040435Speter	if (vfsp->vfc_refcount)
41140435Speter		return EBUSY;
41240435Speter	if (vfc->vfc_vfsops->vfs_uninit != NULL) {
41340435Speter		error = (*vfc->vfc_vfsops->vfs_uninit)(vfsp);
41440435Speter		if (error)
41540435Speter			return (error);
41640435Speter	}
41740435Speter	if (prev_vfsp)
41840435Speter		prev_vfsp->vfc_next = vfsp->vfc_next;
41940435Speter	else
42040435Speter		vfsconf = vfsp->vfc_next;
42140435Speter	if (vfsp->vfc_vfsops->vfs_oid != NULL) {
42240435Speter		l = &sysctl__vfs;
42340435Speter		for (i = l->ls_length,
42440435Speter		    oidpp = (struct sysctl_oid **)l->ls_items;
42540435Speter		    i--; oidpp++) {
42640435Speter			if (*oidpp == vfsp->vfc_vfsops->vfs_oid) {
42740435Speter				*oidpp = NULL;
42840435Speter				sysctl_order_all();
42940435Speter				break;
43040435Speter			}
43140435Speter		}
43240435Speter	}
43340435Speter	maxtypenum = VFS_GENERIC;
43440435Speter	for (vfsp = vfsconf; vfsp != NULL; vfsp = vfsp->vfc_next)
43540435Speter		if (maxtypenum < vfsp->vfc_typenum)
43640435Speter			maxtypenum = vfsp->vfc_typenum;
43740435Speter	maxvfsconf = maxtypenum + 1;
43840435Speter	return 0;
43940435Speter}
44041056Speter
44141056Speterint
44241056Spetervfs_modevent(module_t mod, modeventtype_t type, void *data)
44341056Speter{
44441056Speter	struct vfsconf *vfc;
44541056Speter	struct vnodeopv_desc *opv;
44641056Speter	int i;
44741056Speter	int error = 0;
44841056Speter
44941056Speter	vfc = (struct vfsconf *)data;
45041056Speter
45141056Speter	switch (type) {
45241056Speter	case MOD_LOAD:
45341056Speter		if (vfc)
45441056Speter			error = vfs_register(vfc);
45541056Speter		break;
45641056Speter
45741056Speter	case MOD_UNLOAD:
45841056Speter		if (vfc)
45941056Speter			error = vfs_unregister(vfc);
46041056Speter		break;
46141056Speter	default:	/* including MOD_SHUTDOWN */
46241056Speter		break;
46341056Speter	}
46441056Speter	return (error);
46541056Speter}
466