vfs_default.c revision 51138
130489Sphk/*
230489Sphk * Copyright (c) 1989, 1993
330489Sphk *	The Regents of the University of California.  All rights reserved.
430489Sphk *
530489Sphk * This code is derived from software contributed
630489Sphk * to Berkeley by John Heidemann of the UCLA Ficus project.
730489Sphk *
830489Sphk * Source: * @(#)i405_init.c 2.10 92/04/27 UCLA Ficus project
930489Sphk *
1030489Sphk * Redistribution and use in source and binary forms, with or without
1130489Sphk * modification, are permitted provided that the following conditions
1230489Sphk * are met:
1330489Sphk * 1. Redistributions of source code must retain the above copyright
1430489Sphk *    notice, this list of conditions and the following disclaimer.
1530489Sphk * 2. Redistributions in binary form must reproduce the above copyright
1630489Sphk *    notice, this list of conditions and the following disclaimer in the
1730489Sphk *    documentation and/or other materials provided with the distribution.
1830489Sphk * 3. All advertising materials mentioning features or use of this software
1930489Sphk *    must display the following acknowledgement:
2030489Sphk *	This product includes software developed by the University of
2130489Sphk *	California, Berkeley and its contributors.
2230489Sphk * 4. Neither the name of the University nor the names of its contributors
2330489Sphk *    may be used to endorse or promote products derived from this software
2430489Sphk *    without specific prior written permission.
2530489Sphk *
2630489Sphk * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2730489Sphk * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2830489Sphk * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2930489Sphk * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
3030489Sphk * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3130489Sphk * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3230489Sphk * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3330489Sphk * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3430489Sphk * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3530489Sphk * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3630489Sphk * SUCH DAMAGE.
3730489Sphk *
3847989Sgpalmer *
3950477Speter * $FreeBSD: head/sys/kern/vfs_default.c 51138 1999-09-11 00:46:08Z alfred $
4030489Sphk */
4130489Sphk
4230489Sphk#include <sys/param.h>
4330489Sphk#include <sys/systm.h>
4444272Sbde#include <sys/buf.h>
4530489Sphk#include <sys/kernel.h>
4631561Sbde#include <sys/lock.h>
4730743Sphk#include <sys/malloc.h>
4851068Salfred#include <sys/mount.h>
4930492Sphk#include <sys/unistd.h>
5030489Sphk#include <sys/vnode.h>
5130743Sphk#include <sys/poll.h>
5230489Sphk
5330489Sphkstatic int vop_nostrategy __P((struct vop_strategy_args *));
5430489Sphk
5530489Sphk/*
5630489Sphk * This vnode table stores what we want to do if the filesystem doesn't
5730489Sphk * implement a particular VOP.
5830489Sphk *
5930489Sphk * If there is no specific entry here, we will return EOPNOTSUPP.
6030489Sphk *
6130489Sphk */
6230489Sphk
6330489Sphkvop_t **default_vnodeop_p;
6430489Sphkstatic struct vnodeopv_entry_desc default_vnodeop_entries[] = {
6530492Sphk	{ &vop_default_desc,		(vop_t *) vop_eopnotsupp },
6630743Sphk	{ &vop_abortop_desc,		(vop_t *) vop_null },
6730492Sphk	{ &vop_advlock_desc,		(vop_t *) vop_einval },
6830743Sphk	{ &vop_bwrite_desc,		(vop_t *) vop_stdbwrite },
6930492Sphk	{ &vop_close_desc,		(vop_t *) vop_null },
7030492Sphk	{ &vop_fsync_desc,		(vop_t *) vop_null },
7130492Sphk	{ &vop_ioctl_desc,		(vop_t *) vop_enotty },
7230496Sphk	{ &vop_islocked_desc,		(vop_t *) vop_noislocked },
7330739Sphk	{ &vop_lease_desc,		(vop_t *) vop_null },
7430496Sphk	{ &vop_lock_desc,		(vop_t *) vop_nolock },
7530492Sphk	{ &vop_mmap_desc,		(vop_t *) vop_einval },
7630492Sphk	{ &vop_open_desc,		(vop_t *) vop_null },
7730492Sphk	{ &vop_pathconf_desc,		(vop_t *) vop_einval },
7830489Sphk	{ &vop_poll_desc,		(vop_t *) vop_nopoll },
7930492Sphk	{ &vop_readlink_desc,		(vop_t *) vop_einval },
8030492Sphk	{ &vop_reallocblks_desc,	(vop_t *) vop_eopnotsupp },
8130489Sphk	{ &vop_revoke_desc,		(vop_t *) vop_revoke },
8230489Sphk	{ &vop_strategy_desc,		(vop_t *) vop_nostrategy },
8330496Sphk	{ &vop_unlock_desc,		(vop_t *) vop_nounlock },
8430489Sphk	{ NULL, NULL }
8530489Sphk};
8630489Sphk
8730489Sphkstatic struct vnodeopv_desc default_vnodeop_opv_desc =
8830489Sphk        { &default_vnodeop_p, default_vnodeop_entries };
8930489Sphk
9030489SphkVNODEOP_SET(default_vnodeop_opv_desc);
9130489Sphk
9230489Sphkint
9330492Sphkvop_eopnotsupp(struct vop_generic_args *ap)
9430489Sphk{
9530489Sphk	/*
9630492Sphk	printf("vop_notsupp[%s]\n", ap->a_desc->vdesc_name);
9730489Sphk	*/
9830489Sphk
9930489Sphk	return (EOPNOTSUPP);
10030489Sphk}
10130489Sphk
10230489Sphkint
10330492Sphkvop_ebadf(struct vop_generic_args *ap)
10430489Sphk{
10530489Sphk
10630492Sphk	return (EBADF);
10730492Sphk}
10830492Sphk
10930492Sphkint
11030492Sphkvop_enotty(struct vop_generic_args *ap)
11130492Sphk{
11230492Sphk
11330492Sphk	return (ENOTTY);
11430492Sphk}
11530492Sphk
11630492Sphkint
11730492Sphkvop_einval(struct vop_generic_args *ap)
11830492Sphk{
11930492Sphk
12030492Sphk	return (EINVAL);
12130492Sphk}
12230492Sphk
12330492Sphkint
12430492Sphkvop_null(struct vop_generic_args *ap)
12530492Sphk{
12630492Sphk
12730492Sphk	return (0);
12830492Sphk}
12930492Sphk
13030492Sphkint
13130492Sphkvop_defaultop(struct vop_generic_args *ap)
13230492Sphk{
13330492Sphk
13430489Sphk	return (VOCALL(default_vnodeop_p, ap->a_desc->vdesc_offset, ap));
13530489Sphk}
13630489Sphk
13741056Speterint
13841056Spetervop_panic(struct vop_generic_args *ap)
13941056Speter{
14041056Speter
14141056Speter	panic("illegal vnode op called");
14241056Speter}
14341056Speter
14446349Salc/*
14546349Salc *	vop_nostrategy:
14646349Salc *
14746349Salc *	Strategy routine for VFS devices that have none.
14846349Salc *
14946349Salc *	B_ERROR and B_INVAL must be cleared prior to calling any strategy
15046349Salc *	routine.  Typically this is done for a B_READ strategy call.  Typically
15146349Salc *	B_INVAL is assumed to already be clear prior to a write and should not
15246349Salc *	be cleared manually unless you just made the buffer invalid.  B_ERROR
15346349Salc *	should be cleared either way.
15446349Salc */
15546349Salc
15630489Sphkstatic int
15730489Sphkvop_nostrategy (struct vop_strategy_args *ap)
15830489Sphk{
15930489Sphk	printf("No strategy for buffer at %p\n", ap->a_bp);
16037384Sjulian	vprint("", ap->a_vp);
16130489Sphk	vprint("", ap->a_bp->b_vp);
16230489Sphk	ap->a_bp->b_flags |= B_ERROR;
16330489Sphk	ap->a_bp->b_error = EOPNOTSUPP;
16430489Sphk	biodone(ap->a_bp);
16530489Sphk	return (EOPNOTSUPP);
16630489Sphk}
16730492Sphk
16830492Sphkint
16930492Sphkvop_stdpathconf(ap)
17030492Sphk	struct vop_pathconf_args /* {
17130492Sphk	struct vnode *a_vp;
17230492Sphk	int a_name;
17330492Sphk	int *a_retval;
17430492Sphk	} */ *ap;
17530492Sphk{
17630492Sphk
17730492Sphk	switch (ap->a_name) {
17830492Sphk		case _PC_LINK_MAX:
17930492Sphk			*ap->a_retval = LINK_MAX;
18030492Sphk			return (0);
18130492Sphk		case _PC_MAX_CANON:
18230492Sphk			*ap->a_retval = MAX_CANON;
18330492Sphk			return (0);
18430492Sphk		case _PC_MAX_INPUT:
18530492Sphk			*ap->a_retval = MAX_INPUT;
18630492Sphk			return (0);
18730492Sphk		case _PC_PIPE_BUF:
18830492Sphk			*ap->a_retval = PIPE_BUF;
18930492Sphk			return (0);
19030492Sphk		case _PC_CHOWN_RESTRICTED:
19130492Sphk			*ap->a_retval = 1;
19230492Sphk			return (0);
19330492Sphk		case _PC_VDISABLE:
19430492Sphk			*ap->a_retval = _POSIX_VDISABLE;
19530492Sphk			return (0);
19630492Sphk		default:
19730492Sphk			return (EINVAL);
19830492Sphk	}
19930492Sphk	/* NOTREACHED */
20030492Sphk}
20130513Sphk
20230513Sphk/*
20330513Sphk * Standard lock, unlock and islocked functions.
20430513Sphk *
20530513Sphk * These depend on the lock structure being the first element in the
20630513Sphk * inode, ie: vp->v_data points to the the lock!
20730513Sphk */
20830513Sphkint
20930513Sphkvop_stdlock(ap)
21030513Sphk	struct vop_lock_args /* {
21130513Sphk		struct vnode *a_vp;
21230513Sphk		int a_flags;
21330513Sphk		struct proc *a_p;
21430513Sphk	} */ *ap;
21530513Sphk{
21632286Sdyson	struct lock *l;
21730513Sphk
21832286Sdyson	if ((l = (struct lock *)ap->a_vp->v_data) == NULL) {
21932286Sdyson		if (ap->a_flags & LK_INTERLOCK)
22032286Sdyson			simple_unlock(&ap->a_vp->v_interlock);
22132286Sdyson		return 0;
22232286Sdyson	}
22332286Sdyson
22442900Seivind#ifndef	DEBUG_LOCKS
22530513Sphk	return (lockmgr(l, ap->a_flags, &ap->a_vp->v_interlock, ap->a_p));
22642900Seivind#else
22742900Seivind	return (debuglockmgr(l, ap->a_flags, &ap->a_vp->v_interlock, ap->a_p,
22842900Seivind	    "vop_stdlock", ap->a_vp->filename, ap->a_vp->line));
22942900Seivind#endif
23030513Sphk}
23130513Sphk
23230513Sphkint
23330513Sphkvop_stdunlock(ap)
23430513Sphk	struct vop_unlock_args /* {
23530513Sphk		struct vnode *a_vp;
23630513Sphk		int a_flags;
23730513Sphk		struct proc *a_p;
23830513Sphk	} */ *ap;
23930513Sphk{
24032286Sdyson	struct lock *l;
24130513Sphk
24232286Sdyson	if ((l = (struct lock *)ap->a_vp->v_data) == NULL) {
24332286Sdyson		if (ap->a_flags & LK_INTERLOCK)
24432286Sdyson			simple_unlock(&ap->a_vp->v_interlock);
24532286Sdyson		return 0;
24632286Sdyson	}
24732286Sdyson
24830513Sphk	return (lockmgr(l, ap->a_flags | LK_RELEASE, &ap->a_vp->v_interlock,
24930513Sphk	    ap->a_p));
25030513Sphk}
25130513Sphk
25230513Sphkint
25330513Sphkvop_stdislocked(ap)
25430513Sphk	struct vop_islocked_args /* {
25530513Sphk		struct vnode *a_vp;
25630513Sphk	} */ *ap;
25730513Sphk{
25832286Sdyson	struct lock *l;
25930513Sphk
26032286Sdyson	if ((l = (struct lock *)ap->a_vp->v_data) == NULL)
26132286Sdyson		return 0;
26232286Sdyson
26330513Sphk	return (lockstatus(l));
26430513Sphk}
26530513Sphk
26630743Sphk/*
26730743Sphk * Return true for select/poll.
26830743Sphk */
26930743Sphkint
27030743Sphkvop_nopoll(ap)
27130743Sphk	struct vop_poll_args /* {
27230743Sphk		struct vnode *a_vp;
27330743Sphk		int  a_events;
27430743Sphk		struct ucred *a_cred;
27530743Sphk		struct proc *a_p;
27630743Sphk	} */ *ap;
27730743Sphk{
27830743Sphk	/*
27931727Swollman	 * Return true for read/write.  If the user asked for something
28031727Swollman	 * special, return POLLNVAL, so that clients have a way of
28131727Swollman	 * determining reliably whether or not the extended
28231727Swollman	 * functionality is present without hard-coding knowledge
28331727Swollman	 * of specific filesystem implementations.
28430743Sphk	 */
28531727Swollman	if (ap->a_events & ~POLLSTANDARD)
28631727Swollman		return (POLLNVAL);
28731727Swollman
28830743Sphk	return (ap->a_events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM));
28930743Sphk}
29030743Sphk
29131727Swollman/*
29231727Swollman * Implement poll for local filesystems that support it.
29331727Swollman */
29430743Sphkint
29531727Swollmanvop_stdpoll(ap)
29631727Swollman	struct vop_poll_args /* {
29731727Swollman		struct vnode *a_vp;
29831727Swollman		int  a_events;
29931727Swollman		struct ucred *a_cred;
30031727Swollman		struct proc *a_p;
30131727Swollman	} */ *ap;
30231727Swollman{
30331811Swollman	if ((ap->a_events & ~POLLSTANDARD) == 0)
30431811Swollman		return (ap->a_events & (POLLRDNORM|POLLWRNORM));
30531727Swollman	return (vn_pollrecord(ap->a_vp, ap->a_p, ap->a_events));
30631727Swollman}
30731727Swollman
30831727Swollmanint
30930743Sphkvop_stdbwrite(ap)
31030743Sphk	struct vop_bwrite_args *ap;
31130743Sphk{
31230743Sphk	return (bwrite(ap->a_bp));
31330743Sphk}
31430743Sphk
31530743Sphk/*
31630743Sphk * Stubs to use when there is no locking to be done on the underlying object.
31730743Sphk * A minimal shared lock is necessary to ensure that the underlying object
31830743Sphk * is not revoked while an operation is in progress. So, an active shared
31930743Sphk * count is maintained in an auxillary vnode lock structure.
32030743Sphk */
32130743Sphkint
32230743Sphkvop_sharedlock(ap)
32330743Sphk	struct vop_lock_args /* {
32430743Sphk		struct vnode *a_vp;
32530743Sphk		int a_flags;
32630743Sphk		struct proc *a_p;
32730743Sphk	} */ *ap;
32830743Sphk{
32930743Sphk	/*
33030743Sphk	 * This code cannot be used until all the non-locking filesystems
33130743Sphk	 * (notably NFS) are converted to properly lock and release nodes.
33230743Sphk	 * Also, certain vnode operations change the locking state within
33330743Sphk	 * the operation (create, mknod, remove, link, rename, mkdir, rmdir,
33430743Sphk	 * and symlink). Ideally these operations should not change the
33530743Sphk	 * lock state, but should be changed to let the caller of the
33630743Sphk	 * function unlock them. Otherwise all intermediate vnode layers
33730743Sphk	 * (such as union, umapfs, etc) must catch these functions to do
33830743Sphk	 * the necessary locking at their layer. Note that the inactive
33930743Sphk	 * and lookup operations also change their lock state, but this
34030743Sphk	 * cannot be avoided, so these two operations will always need
34130743Sphk	 * to be handled in intermediate layers.
34230743Sphk	 */
34330743Sphk	struct vnode *vp = ap->a_vp;
34430743Sphk	int vnflags, flags = ap->a_flags;
34530743Sphk
34630743Sphk	if (vp->v_vnlock == NULL) {
34730743Sphk		if ((flags & LK_TYPE_MASK) == LK_DRAIN)
34830743Sphk			return (0);
34930743Sphk		MALLOC(vp->v_vnlock, struct lock *, sizeof(struct lock),
35030743Sphk		    M_VNODE, M_WAITOK);
35134206Sdyson		lockinit(vp->v_vnlock, PVFS, "vnlock", 0, LK_NOPAUSE);
35230743Sphk	}
35330743Sphk	switch (flags & LK_TYPE_MASK) {
35430743Sphk	case LK_DRAIN:
35530743Sphk		vnflags = LK_DRAIN;
35630743Sphk		break;
35730743Sphk	case LK_EXCLUSIVE:
35830743Sphk#ifdef DEBUG_VFS_LOCKS
35930743Sphk		/*
36030743Sphk		 * Normally, we use shared locks here, but that confuses
36130743Sphk		 * the locking assertions.
36230743Sphk		 */
36330743Sphk		vnflags = LK_EXCLUSIVE;
36430743Sphk		break;
36530743Sphk#endif
36630743Sphk	case LK_SHARED:
36730743Sphk		vnflags = LK_SHARED;
36830743Sphk		break;
36930743Sphk	case LK_UPGRADE:
37030743Sphk	case LK_EXCLUPGRADE:
37130743Sphk	case LK_DOWNGRADE:
37230743Sphk		return (0);
37330743Sphk	case LK_RELEASE:
37430743Sphk	default:
37530743Sphk		panic("vop_sharedlock: bad operation %d", flags & LK_TYPE_MASK);
37630743Sphk	}
37730743Sphk	if (flags & LK_INTERLOCK)
37830743Sphk		vnflags |= LK_INTERLOCK;
37942900Seivind#ifndef	DEBUG_LOCKS
38042900Seivind	return (lockmgr(vp->v_vnlock, vnflags, &vp->v_interlock, ap->a_p));
38142900Seivind#else
38242900Seivind	return (debuglockmgr(vp->v_vnlock, vnflags, &vp->v_interlock, ap->a_p,
38342900Seivind	    "vop_sharedlock", vp->filename, vp->line));
38442900Seivind#endif
38530743Sphk}
38630743Sphk
38730743Sphk/*
38830743Sphk * Stubs to use when there is no locking to be done on the underlying object.
38930743Sphk * A minimal shared lock is necessary to ensure that the underlying object
39030743Sphk * is not revoked while an operation is in progress. So, an active shared
39130743Sphk * count is maintained in an auxillary vnode lock structure.
39230743Sphk */
39330743Sphkint
39430743Sphkvop_nolock(ap)
39530743Sphk	struct vop_lock_args /* {
39630743Sphk		struct vnode *a_vp;
39730743Sphk		int a_flags;
39830743Sphk		struct proc *a_p;
39930743Sphk	} */ *ap;
40030743Sphk{
40130743Sphk#ifdef notyet
40230743Sphk	/*
40330743Sphk	 * This code cannot be used until all the non-locking filesystems
40430743Sphk	 * (notably NFS) are converted to properly lock and release nodes.
40530743Sphk	 * Also, certain vnode operations change the locking state within
40630743Sphk	 * the operation (create, mknod, remove, link, rename, mkdir, rmdir,
40730743Sphk	 * and symlink). Ideally these operations should not change the
40830743Sphk	 * lock state, but should be changed to let the caller of the
40930743Sphk	 * function unlock them. Otherwise all intermediate vnode layers
41030743Sphk	 * (such as union, umapfs, etc) must catch these functions to do
41130743Sphk	 * the necessary locking at their layer. Note that the inactive
41230743Sphk	 * and lookup operations also change their lock state, but this
41330743Sphk	 * cannot be avoided, so these two operations will always need
41430743Sphk	 * to be handled in intermediate layers.
41530743Sphk	 */
41630743Sphk	struct vnode *vp = ap->a_vp;
41730743Sphk	int vnflags, flags = ap->a_flags;
41830743Sphk
41930743Sphk	if (vp->v_vnlock == NULL) {
42030743Sphk		if ((flags & LK_TYPE_MASK) == LK_DRAIN)
42130743Sphk			return (0);
42230743Sphk		MALLOC(vp->v_vnlock, struct lock *, sizeof(struct lock),
42330743Sphk		    M_VNODE, M_WAITOK);
42434206Sdyson		lockinit(vp->v_vnlock, PVFS, "vnlock", 0, LK_NOPAUSE);
42530743Sphk	}
42630743Sphk	switch (flags & LK_TYPE_MASK) {
42730743Sphk	case LK_DRAIN:
42830743Sphk		vnflags = LK_DRAIN;
42930743Sphk		break;
43030743Sphk	case LK_EXCLUSIVE:
43130743Sphk	case LK_SHARED:
43230743Sphk		vnflags = LK_SHARED;
43330743Sphk		break;
43430743Sphk	case LK_UPGRADE:
43530743Sphk	case LK_EXCLUPGRADE:
43630743Sphk	case LK_DOWNGRADE:
43730743Sphk		return (0);
43830743Sphk	case LK_RELEASE:
43930743Sphk	default:
44030743Sphk		panic("vop_nolock: bad operation %d", flags & LK_TYPE_MASK);
44130743Sphk	}
44230743Sphk	if (flags & LK_INTERLOCK)
44330743Sphk		vnflags |= LK_INTERLOCK;
44430743Sphk	return(lockmgr(vp->v_vnlock, vnflags, &vp->v_interlock, ap->a_p));
44530743Sphk#else /* for now */
44630743Sphk	/*
44730743Sphk	 * Since we are not using the lock manager, we must clear
44830743Sphk	 * the interlock here.
44930743Sphk	 */
45031263Sbde	if (ap->a_flags & LK_INTERLOCK)
45130743Sphk		simple_unlock(&ap->a_vp->v_interlock);
45230743Sphk	return (0);
45330743Sphk#endif
45430743Sphk}
45530743Sphk
45630743Sphk/*
45730743Sphk * Do the inverse of vop_nolock, handling the interlock in a compatible way.
45830743Sphk */
45930743Sphkint
46030743Sphkvop_nounlock(ap)
46130743Sphk	struct vop_unlock_args /* {
46230743Sphk		struct vnode *a_vp;
46330743Sphk		int a_flags;
46430743Sphk		struct proc *a_p;
46530743Sphk	} */ *ap;
46630743Sphk{
46730743Sphk	struct vnode *vp = ap->a_vp;
46830743Sphk
46930743Sphk	if (vp->v_vnlock == NULL) {
47030743Sphk		if (ap->a_flags & LK_INTERLOCK)
47130743Sphk			simple_unlock(&ap->a_vp->v_interlock);
47230743Sphk		return (0);
47330743Sphk	}
47430743Sphk	return (lockmgr(vp->v_vnlock, LK_RELEASE | ap->a_flags,
47530743Sphk		&ap->a_vp->v_interlock, ap->a_p));
47630743Sphk}
47730743Sphk
47830743Sphk/*
47930743Sphk * Return whether or not the node is in use.
48030743Sphk */
48130743Sphkint
48230743Sphkvop_noislocked(ap)
48330743Sphk	struct vop_islocked_args /* {
48430743Sphk		struct vnode *a_vp;
48530743Sphk	} */ *ap;
48630743Sphk{
48730743Sphk	struct vnode *vp = ap->a_vp;
48830743Sphk
48930743Sphk	if (vp->v_vnlock == NULL)
49030743Sphk		return (0);
49130743Sphk	return (lockstatus(vp->v_vnlock));
49230743Sphk}
49330743Sphk
49451068Salfred/*
49551068Salfred * vfs default ops
49651068Salfred * used to fill the vfs fucntion table to get reasonable default return values.
49751068Salfred */
49851068Salfredint
49951068Salfredvfs_stdmount (mp, path, data, ndp, p)
50051068Salfred	struct mount *mp;
50151068Salfred	char *path;
50251068Salfred	caddr_t data;
50351068Salfred	struct nameidata *ndp;
50451068Salfred	struct proc *p;
50551068Salfred{
50651068Salfred	return (0);
50751068Salfred}
50851068Salfred
50951068Salfredint
51051068Salfredvfs_stdunmount (mp, mntflags, p)
51151068Salfred	struct mount *mp;
51251068Salfred	int mntflags;
51351068Salfred	struct proc *p;
51451068Salfred{
51551068Salfred	return (0);
51651068Salfred}
51751068Salfred
51851068Salfredint
51951068Salfredvfs_stdroot (mp, vpp)
52051068Salfred	struct mount *mp;
52151068Salfred	struct vnode **vpp;
52251068Salfred{
52351068Salfred	return (EOPNOTSUPP);
52451068Salfred}
52551068Salfred
52651068Salfredint
52751068Salfredvfs_stdstatfs (mp, sbp, p)
52851068Salfred	struct mount *mp;
52951068Salfred	struct statfs *sbp;
53051068Salfred	struct proc *p;
53151068Salfred{
53251068Salfred	return (EOPNOTSUPP);
53351068Salfred}
53451068Salfred
53551068Salfredint
53651068Salfredvfs_stdvptofh (vp, fhp)
53751068Salfred	struct vnode *vp;
53851068Salfred	struct fid *fhp;
53951068Salfred{
54051068Salfred	return (EOPNOTSUPP);
54151068Salfred}
54251068Salfred
54351068Salfredint
54451068Salfredvfs_stdstart (mp, flags, p)
54551068Salfred	struct mount *mp;
54651068Salfred	int flags;
54751068Salfred	struct proc *p;
54851068Salfred{
54951068Salfred	return (0);
55051068Salfred}
55151068Salfred
55251068Salfredint
55351068Salfredvfs_stdquotactl (mp, cmds, uid, arg, p)
55451068Salfred	struct mount *mp;
55551068Salfred	int cmds;
55651068Salfred	uid_t uid;
55751068Salfred	caddr_t arg;
55851068Salfred	struct proc *p;
55951068Salfred{
56051068Salfred	return (EOPNOTSUPP);
56151068Salfred}
56251068Salfred
56351068Salfredint
56451068Salfredvfs_stdsync (mp, waitfor, cred, p)
56551068Salfred	struct mount *mp;
56651068Salfred	int waitfor;
56751068Salfred	struct ucred *cred;
56851068Salfred	struct proc *p;
56951068Salfred{
57051068Salfred	return (0);
57151068Salfred}
57251068Salfred
57351068Salfredint
57451068Salfredvfs_stdvget (mp, ino, vpp)
57551068Salfred	struct mount *mp;
57651068Salfred	ino_t ino;
57751068Salfred	struct vnode **vpp;
57851068Salfred{
57951068Salfred	return (EOPNOTSUPP);
58051068Salfred}
58151068Salfred
58251068Salfredint
58351138Salfredvfs_stdfhtovp (mp, fhp, vpp)
58451068Salfred	struct mount *mp;
58551068Salfred	struct fid *fhp;
58651138Salfred	struct vnode **vpp;
58751138Salfred{
58851138Salfred	return (EOPNOTSUPP);
58951138Salfred}
59051138Salfred
59151138Salfredint
59251138Salfredvfs_stdcheckexp (mp, nam, extflagsp, credanonp)
59351138Salfred	struct mount *mp;
59451068Salfred	struct sockaddr *nam;
59551138Salfred	int *extflagsp;
59651068Salfred	struct ucred **credanonp;
59751068Salfred{
59851068Salfred	return (EOPNOTSUPP);
59951068Salfred}
60051068Salfred
60151068Salfredint
60251068Salfredvfs_stdinit (vfsp)
60351068Salfred	struct vfsconf *vfsp;
60451068Salfred{
60551068Salfred	return (0);
60651068Salfred}
60751068Salfred
60851068Salfredint
60951068Salfredvfs_stduninit (vfsp)
61051068Salfred	struct vfsconf *vfsp;
61151068Salfred{
61251068Salfred	return(0);
61351068Salfred}
61451068Salfred
61551068Salfred/* end of vfs default ops */
616