xref: /freebsd/sys/kern/vfs_default.c (revision 5521ff5a4d1929056e7ffc982fac3341ca54df7c)
1 /*
2  * Copyright (c) 1989, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * This code is derived from software contributed
6  * to Berkeley by John Heidemann of the UCLA Ficus project.
7  *
8  * Source: * @(#)i405_init.c 2.10 92/04/27 UCLA Ficus project
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  * 3. All advertising materials mentioning features or use of this software
19  *    must display the following acknowledgement:
20  *	This product includes software developed by the University of
21  *	California, Berkeley and its contributors.
22  * 4. Neither the name of the University nor the names of its contributors
23  *    may be used to endorse or promote products derived from this software
24  *    without specific prior written permission.
25  *
26  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36  * SUCH DAMAGE.
37  *
38  *
39  * $FreeBSD$
40  */
41 
42 #include <sys/param.h>
43 #include <sys/systm.h>
44 #include <sys/bio.h>
45 #include <sys/buf.h>
46 #include <sys/conf.h>
47 #include <sys/kernel.h>
48 #include <sys/lock.h>
49 #include <sys/malloc.h>
50 #include <sys/mount.h>
51 #include <sys/mutex.h>
52 #include <sys/unistd.h>
53 #include <sys/vnode.h>
54 #include <sys/poll.h>
55 
56 #include <machine/limits.h>
57 
58 #include <vm/vm.h>
59 #include <vm/vm_object.h>
60 #include <vm/vm_extern.h>
61 #include <vm/pmap.h>
62 #include <vm/vm_map.h>
63 #include <vm/vm_page.h>
64 #include <vm/vm_pager.h>
65 #include <vm/vnode_pager.h>
66 #include <vm/vm_zone.h>
67 
68 static int	vop_nolookup __P((struct vop_lookup_args *));
69 static int	vop_nostrategy __P((struct vop_strategy_args *));
70 
71 /*
72  * This vnode table stores what we want to do if the filesystem doesn't
73  * implement a particular VOP.
74  *
75  * If there is no specific entry here, we will return EOPNOTSUPP.
76  *
77  */
78 
79 vop_t **default_vnodeop_p;
80 static struct vnodeopv_entry_desc default_vnodeop_entries[] = {
81 	{ &vop_default_desc,		(vop_t *) vop_eopnotsupp },
82 	{ &vop_advlock_desc,		(vop_t *) vop_einval },
83 	{ &vop_bmap_desc,		(vop_t *) vop_stdbmap },
84 	{ &vop_close_desc,		(vop_t *) vop_null },
85 	{ &vop_createvobject_desc,	(vop_t *) vop_stdcreatevobject },
86 	{ &vop_destroyvobject_desc,	(vop_t *) vop_stddestroyvobject },
87 	{ &vop_fsync_desc,		(vop_t *) vop_null },
88 	{ &vop_getpages_desc,		(vop_t *) vop_stdgetpages },
89 	{ &vop_getvobject_desc,		(vop_t *) vop_stdgetvobject },
90 	{ &vop_inactive_desc,		(vop_t *) vop_stdinactive },
91 	{ &vop_ioctl_desc,		(vop_t *) vop_enotty },
92 	{ &vop_islocked_desc,		(vop_t *) vop_noislocked },
93 	{ &vop_lease_desc,		(vop_t *) vop_null },
94 	{ &vop_lock_desc,		(vop_t *) vop_nolock },
95 	{ &vop_lookup_desc,		(vop_t *) vop_nolookup },
96 	{ &vop_open_desc,		(vop_t *) vop_null },
97 	{ &vop_pathconf_desc,		(vop_t *) vop_einval },
98 	{ &vop_putpages_desc,		(vop_t *) vop_stdputpages },
99 	{ &vop_poll_desc,		(vop_t *) vop_nopoll },
100 	{ &vop_readlink_desc,		(vop_t *) vop_einval },
101 	{ &vop_revoke_desc,		(vop_t *) vop_revoke },
102 	{ &vop_strategy_desc,		(vop_t *) vop_nostrategy },
103 	{ &vop_unlock_desc,		(vop_t *) vop_nounlock },
104 	{ NULL, NULL }
105 };
106 
107 static struct vnodeopv_desc default_vnodeop_opv_desc =
108         { &default_vnodeop_p, default_vnodeop_entries };
109 
110 VNODEOP_SET(default_vnodeop_opv_desc);
111 
112 int
113 vop_eopnotsupp(struct vop_generic_args *ap)
114 {
115 	/*
116 	printf("vop_notsupp[%s]\n", ap->a_desc->vdesc_name);
117 	*/
118 
119 	return (EOPNOTSUPP);
120 }
121 
122 int
123 vop_ebadf(struct vop_generic_args *ap)
124 {
125 
126 	return (EBADF);
127 }
128 
129 int
130 vop_enotty(struct vop_generic_args *ap)
131 {
132 
133 	return (ENOTTY);
134 }
135 
136 int
137 vop_einval(struct vop_generic_args *ap)
138 {
139 
140 	return (EINVAL);
141 }
142 
143 int
144 vop_null(struct vop_generic_args *ap)
145 {
146 
147 	return (0);
148 }
149 
150 int
151 vop_defaultop(struct vop_generic_args *ap)
152 {
153 
154 	return (VOCALL(default_vnodeop_p, ap->a_desc->vdesc_offset, ap));
155 }
156 
157 int
158 vop_panic(struct vop_generic_args *ap)
159 {
160 
161 	panic("filesystem goof: vop_panic[%s]", ap->a_desc->vdesc_name);
162 }
163 
164 static int
165 vop_nolookup(ap)
166 	struct vop_lookup_args /* {
167 		struct vnode *a_dvp;
168 		struct vnode **a_vpp;
169 		struct componentname *a_cnp;
170 	} */ *ap;
171 {
172 
173 	*ap->a_vpp = NULL;
174 	return (ENOTDIR);
175 }
176 
177 /*
178  *	vop_nostrategy:
179  *
180  *	Strategy routine for VFS devices that have none.
181  *
182  *	BIO_ERROR and B_INVAL must be cleared prior to calling any strategy
183  *	routine.  Typically this is done for a BIO_READ strategy call.
184  *	Typically B_INVAL is assumed to already be clear prior to a write
185  *	and should not be cleared manually unless you just made the buffer
186  *	invalid.  BIO_ERROR should be cleared either way.
187  */
188 
189 static int
190 vop_nostrategy (struct vop_strategy_args *ap)
191 {
192 	printf("No strategy for buffer at %p\n", ap->a_bp);
193 	vprint("", ap->a_vp);
194 	vprint("", ap->a_bp->b_vp);
195 	ap->a_bp->b_ioflags |= BIO_ERROR;
196 	ap->a_bp->b_error = EOPNOTSUPP;
197 	bufdone(ap->a_bp);
198 	return (EOPNOTSUPP);
199 }
200 
201 int
202 vop_stdpathconf(ap)
203 	struct vop_pathconf_args /* {
204 	struct vnode *a_vp;
205 	int a_name;
206 	int *a_retval;
207 	} */ *ap;
208 {
209 
210 	switch (ap->a_name) {
211 		case _PC_LINK_MAX:
212 			*ap->a_retval = LINK_MAX;
213 			return (0);
214 		case _PC_MAX_CANON:
215 			*ap->a_retval = MAX_CANON;
216 			return (0);
217 		case _PC_MAX_INPUT:
218 			*ap->a_retval = MAX_INPUT;
219 			return (0);
220 		case _PC_PIPE_BUF:
221 			*ap->a_retval = PIPE_BUF;
222 			return (0);
223 		case _PC_CHOWN_RESTRICTED:
224 			*ap->a_retval = 1;
225 			return (0);
226 		case _PC_VDISABLE:
227 			*ap->a_retval = _POSIX_VDISABLE;
228 			return (0);
229 		default:
230 			return (EINVAL);
231 	}
232 	/* NOTREACHED */
233 }
234 
235 /*
236  * Standard lock, unlock and islocked functions.
237  *
238  * These depend on the lock structure being the first element in the
239  * inode, ie: vp->v_data points to the the lock!
240  */
241 int
242 vop_stdlock(ap)
243 	struct vop_lock_args /* {
244 		struct vnode *a_vp;
245 		int a_flags;
246 		struct proc *a_p;
247 	} */ *ap;
248 {
249 	struct vnode *vp = ap->a_vp;
250 
251 #ifndef	DEBUG_LOCKS
252 	return (lockmgr(&vp->v_lock, ap->a_flags, &vp->v_interlock, ap->a_p));
253 #else
254 	return (debuglockmgr(&vp->v_lock, ap->a_flags, &vp->v_interlock,
255 	    ap->a_p, "vop_stdlock", vp->filename, vp->line));
256 #endif
257 }
258 
259 int
260 vop_stdunlock(ap)
261 	struct vop_unlock_args /* {
262 		struct vnode *a_vp;
263 		int a_flags;
264 		struct proc *a_p;
265 	} */ *ap;
266 {
267 	struct vnode *vp = ap->a_vp;
268 
269 	return (lockmgr(&vp->v_lock, ap->a_flags | LK_RELEASE, &vp->v_interlock,
270 	    ap->a_p));
271 }
272 
273 int
274 vop_stdislocked(ap)
275 	struct vop_islocked_args /* {
276 		struct vnode *a_vp;
277 		struct proc *a_p;
278 	} */ *ap;
279 {
280 
281 	return (lockstatus(&ap->a_vp->v_lock, ap->a_p));
282 }
283 
284 int
285 vop_stdinactive(ap)
286 	struct vop_inactive_args /* {
287 		struct vnode *a_vp;
288 		struct proc *a_p;
289 	} */ *ap;
290 {
291 
292 	VOP_UNLOCK(ap->a_vp, 0, ap->a_p);
293 	return (0);
294 }
295 
296 /*
297  * Return true for select/poll.
298  */
299 int
300 vop_nopoll(ap)
301 	struct vop_poll_args /* {
302 		struct vnode *a_vp;
303 		int  a_events;
304 		struct ucred *a_cred;
305 		struct proc *a_p;
306 	} */ *ap;
307 {
308 	/*
309 	 * Return true for read/write.  If the user asked for something
310 	 * special, return POLLNVAL, so that clients have a way of
311 	 * determining reliably whether or not the extended
312 	 * functionality is present without hard-coding knowledge
313 	 * of specific filesystem implementations.
314 	 */
315 	if (ap->a_events & ~POLLSTANDARD)
316 		return (POLLNVAL);
317 
318 	return (ap->a_events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM));
319 }
320 
321 /*
322  * Implement poll for local filesystems that support it.
323  */
324 int
325 vop_stdpoll(ap)
326 	struct vop_poll_args /* {
327 		struct vnode *a_vp;
328 		int  a_events;
329 		struct ucred *a_cred;
330 		struct proc *a_p;
331 	} */ *ap;
332 {
333 	if (ap->a_events & ~POLLSTANDARD)
334 		return (vn_pollrecord(ap->a_vp, ap->a_p, ap->a_events));
335 	return (ap->a_events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM));
336 }
337 
338 /*
339  * Stubs to use when there is no locking to be done on the underlying object.
340  * A minimal shared lock is necessary to ensure that the underlying object
341  * is not revoked while an operation is in progress. So, an active shared
342  * count is maintained in an auxillary vnode lock structure.
343  */
344 int
345 vop_sharedlock(ap)
346 	struct vop_lock_args /* {
347 		struct vnode *a_vp;
348 		int a_flags;
349 		struct proc *a_p;
350 	} */ *ap;
351 {
352 	/*
353 	 * This code cannot be used until all the non-locking filesystems
354 	 * (notably NFS) are converted to properly lock and release nodes.
355 	 * Also, certain vnode operations change the locking state within
356 	 * the operation (create, mknod, remove, link, rename, mkdir, rmdir,
357 	 * and symlink). Ideally these operations should not change the
358 	 * lock state, but should be changed to let the caller of the
359 	 * function unlock them. Otherwise all intermediate vnode layers
360 	 * (such as union, umapfs, etc) must catch these functions to do
361 	 * the necessary locking at their layer. Note that the inactive
362 	 * and lookup operations also change their lock state, but this
363 	 * cannot be avoided, so these two operations will always need
364 	 * to be handled in intermediate layers.
365 	 */
366 	struct vnode *vp = ap->a_vp;
367 	int vnflags, flags = ap->a_flags;
368 
369 	switch (flags & LK_TYPE_MASK) {
370 	case LK_DRAIN:
371 		vnflags = LK_DRAIN;
372 		break;
373 	case LK_EXCLUSIVE:
374 #ifdef DEBUG_VFS_LOCKS
375 		/*
376 		 * Normally, we use shared locks here, but that confuses
377 		 * the locking assertions.
378 		 */
379 		vnflags = LK_EXCLUSIVE;
380 		break;
381 #endif
382 	case LK_SHARED:
383 		vnflags = LK_SHARED;
384 		break;
385 	case LK_UPGRADE:
386 	case LK_EXCLUPGRADE:
387 	case LK_DOWNGRADE:
388 		return (0);
389 	case LK_RELEASE:
390 	default:
391 		panic("vop_sharedlock: bad operation %d", flags & LK_TYPE_MASK);
392 	}
393 	if (flags & LK_INTERLOCK)
394 		vnflags |= LK_INTERLOCK;
395 #ifndef	DEBUG_LOCKS
396 	return (lockmgr(&vp->v_lock, vnflags, &vp->v_interlock, ap->a_p));
397 #else
398 	return (debuglockmgr(&vp->v_lock, vnflags, &vp->v_interlock, ap->a_p,
399 	    "vop_sharedlock", vp->filename, vp->line));
400 #endif
401 }
402 
403 /*
404  * Stubs to use when there is no locking to be done on the underlying object.
405  * A minimal shared lock is necessary to ensure that the underlying object
406  * is not revoked while an operation is in progress. So, an active shared
407  * count is maintained in an auxillary vnode lock structure.
408  */
409 int
410 vop_nolock(ap)
411 	struct vop_lock_args /* {
412 		struct vnode *a_vp;
413 		int a_flags;
414 		struct proc *a_p;
415 	} */ *ap;
416 {
417 #ifdef notyet
418 	/*
419 	 * This code cannot be used until all the non-locking filesystems
420 	 * (notably NFS) are converted to properly lock and release nodes.
421 	 * Also, certain vnode operations change the locking state within
422 	 * the operation (create, mknod, remove, link, rename, mkdir, rmdir,
423 	 * and symlink). Ideally these operations should not change the
424 	 * lock state, but should be changed to let the caller of the
425 	 * function unlock them. Otherwise all intermediate vnode layers
426 	 * (such as union, umapfs, etc) must catch these functions to do
427 	 * the necessary locking at their layer. Note that the inactive
428 	 * and lookup operations also change their lock state, but this
429 	 * cannot be avoided, so these two operations will always need
430 	 * to be handled in intermediate layers.
431 	 */
432 	struct vnode *vp = ap->a_vp;
433 	int vnflags, flags = ap->a_flags;
434 
435 	switch (flags & LK_TYPE_MASK) {
436 	case LK_DRAIN:
437 		vnflags = LK_DRAIN;
438 		break;
439 	case LK_EXCLUSIVE:
440 	case LK_SHARED:
441 		vnflags = LK_SHARED;
442 		break;
443 	case LK_UPGRADE:
444 	case LK_EXCLUPGRADE:
445 	case LK_DOWNGRADE:
446 		return (0);
447 	case LK_RELEASE:
448 	default:
449 		panic("vop_nolock: bad operation %d", flags & LK_TYPE_MASK);
450 	}
451 	if (flags & LK_INTERLOCK)
452 		vnflags |= LK_INTERLOCK;
453 	return(lockmgr(&vp->v_lock, vnflags, &vp->v_interlock, ap->a_p));
454 #else /* for now */
455 	/*
456 	 * Since we are not using the lock manager, we must clear
457 	 * the interlock here.
458 	 */
459 	if (ap->a_flags & LK_INTERLOCK)
460 		mtx_unlock(&ap->a_vp->v_interlock);
461 	return (0);
462 #endif
463 }
464 
465 /*
466  * Do the inverse of vop_nolock, handling the interlock in a compatible way.
467  */
468 int
469 vop_nounlock(ap)
470 	struct vop_unlock_args /* {
471 		struct vnode *a_vp;
472 		int a_flags;
473 		struct proc *a_p;
474 	} */ *ap;
475 {
476 
477 	/*
478 	 * Since we are not using the lock manager, we must clear
479 	 * the interlock here.
480 	 */
481 	if (ap->a_flags & LK_INTERLOCK)
482 		mtx_unlock(&ap->a_vp->v_interlock);
483 	return (0);
484 }
485 
486 /*
487  * Return whether or not the node is in use.
488  */
489 int
490 vop_noislocked(ap)
491 	struct vop_islocked_args /* {
492 		struct vnode *a_vp;
493 		struct proc *a_p;
494 	} */ *ap;
495 {
496 
497 	return (0);
498 }
499 
500 /*
501  * Return our mount point, as we will take charge of the writes.
502  */
503 int
504 vop_stdgetwritemount(ap)
505 	struct vop_getwritemount_args /* {
506 		struct vnode *a_vp;
507 		struct mount **a_mpp;
508 	} */ *ap;
509 {
510 
511 	*(ap->a_mpp) = ap->a_vp->v_mount;
512 	return (0);
513 }
514 
515 int
516 vop_stdcreatevobject(ap)
517 	struct vop_createvobject_args /* {
518 		struct vnode *vp;
519 		struct ucred *cred;
520 		struct proc *p;
521 	} */ *ap;
522 {
523 	struct vnode *vp = ap->a_vp;
524 	struct ucred *cred = ap->a_cred;
525 	struct proc *p = ap->a_p;
526 	struct vattr vat;
527 	vm_object_t object;
528 	int error = 0;
529 
530 	GIANT_REQUIRED;
531 
532 	if (!vn_isdisk(vp, NULL) && vn_canvmio(vp) == FALSE)
533 		return (0);
534 
535 retry:
536 	if ((object = vp->v_object) == NULL) {
537 		if (vp->v_type == VREG || vp->v_type == VDIR) {
538 			if ((error = VOP_GETATTR(vp, &vat, cred, p)) != 0)
539 				goto retn;
540 			object = vnode_pager_alloc(vp, vat.va_size, 0, 0);
541 		} else if (devsw(vp->v_rdev) != NULL) {
542 			/*
543 			 * This simply allocates the biggest object possible
544 			 * for a disk vnode.  This should be fixed, but doesn't
545 			 * cause any problems (yet).
546 			 */
547 			object = vnode_pager_alloc(vp, IDX_TO_OFF(INT_MAX), 0, 0);
548 		} else {
549 			goto retn;
550 		}
551 		/*
552 		 * Dereference the reference we just created.  This assumes
553 		 * that the object is associated with the vp.
554 		 */
555 		object->ref_count--;
556 		vp->v_usecount--;
557 	} else {
558 		if (object->flags & OBJ_DEAD) {
559 			VOP_UNLOCK(vp, 0, p);
560 			tsleep(object, PVM, "vodead", 0);
561 			vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
562 			goto retry;
563 		}
564 	}
565 
566 	KASSERT(vp->v_object != NULL, ("vfs_object_create: NULL object"));
567 	vp->v_flag |= VOBJBUF;
568 
569 retn:
570 	return (error);
571 }
572 
573 int
574 vop_stddestroyvobject(ap)
575 	struct vop_destroyvobject_args /* {
576 		struct vnode *vp;
577 	} */ *ap;
578 {
579 	struct vnode *vp = ap->a_vp;
580 	vm_object_t obj = vp->v_object;
581 
582 	GIANT_REQUIRED;
583 
584 	if (vp->v_object == NULL)
585 		return (0);
586 
587 	if (obj->ref_count == 0) {
588 		/*
589 		 * vclean() may be called twice. The first time
590 		 * removes the primary reference to the object,
591 		 * the second time goes one further and is a
592 		 * special-case to terminate the object.
593 		 */
594 		vm_object_terminate(obj);
595 	} else {
596 		/*
597 		 * Woe to the process that tries to page now :-).
598 		 */
599 		vm_pager_deallocate(obj);
600 	}
601 	return (0);
602 }
603 
604 int
605 vop_stdgetvobject(ap)
606 	struct vop_getvobject_args /* {
607 		struct vnode *vp;
608 		struct vm_object **objpp;
609 	} */ *ap;
610 {
611 	struct vnode *vp = ap->a_vp;
612 	struct vm_object **objpp = ap->a_objpp;
613 
614 	if (objpp)
615 		*objpp = vp->v_object;
616 	return (vp->v_object ? 0 : EINVAL);
617 }
618 
619 int
620 vop_stdbmap(ap)
621 	struct vop_bmap_args /* {
622 		struct vnode *a_vp;
623 		daddr_t  a_bn;
624 		struct vnode **a_vpp;
625 		daddr_t *a_bnp;
626 		int *a_runp;
627 		int *a_runb;
628 	} */ *ap;
629 {
630 
631 	if (ap->a_vpp != NULL)
632 		*ap->a_vpp = ap->a_vp;
633 	if (ap->a_bnp != NULL)
634 		*ap->a_bnp = ap->a_bn * btodb(ap->a_vp->v_mount->mnt_stat.f_iosize);
635 	if (ap->a_runp != NULL)
636 		*ap->a_runp = 0;
637 	if (ap->a_runb != NULL)
638 		*ap->a_runb = 0;
639 	return (0);
640 }
641 
642 int
643 vop_stdgetpages(ap)
644 	struct vop_getpages_args /* {
645 		struct vnode *a_vp;
646 		vm_page_t *a_m;
647 		int a_count;
648 		int a_reqpage;
649 		vm_ooffset_t a_offset;
650 	} */ *ap;
651 {
652 
653 	return vnode_pager_generic_getpages(ap->a_vp, ap->a_m,
654 	    ap->a_count, ap->a_reqpage);
655 }
656 
657 int
658 vop_stdputpages(ap)
659 	struct vop_putpages_args /* {
660 		struct vnode *a_vp;
661 		vm_page_t *a_m;
662 		int a_count;
663 		int a_sync;
664 		int *a_rtvals;
665 		vm_ooffset_t a_offset;
666 	} */ *ap;
667 {
668 
669 	return vnode_pager_generic_putpages(ap->a_vp, ap->a_m, ap->a_count,
670 	     ap->a_sync, ap->a_rtvals);
671 }
672 
673 
674 
675 /*
676  * vfs default ops
677  * used to fill the vfs fucntion table to get reasonable default return values.
678  */
679 int
680 vfs_stdmount (mp, path, data, ndp, p)
681 	struct mount *mp;
682 	char *path;
683 	caddr_t data;
684 	struct nameidata *ndp;
685 	struct proc *p;
686 {
687 	return (0);
688 }
689 
690 int
691 vfs_stdunmount (mp, mntflags, p)
692 	struct mount *mp;
693 	int mntflags;
694 	struct proc *p;
695 {
696 	return (0);
697 }
698 
699 int
700 vfs_stdroot (mp, vpp)
701 	struct mount *mp;
702 	struct vnode **vpp;
703 {
704 	return (EOPNOTSUPP);
705 }
706 
707 int
708 vfs_stdstatfs (mp, sbp, p)
709 	struct mount *mp;
710 	struct statfs *sbp;
711 	struct proc *p;
712 {
713 	return (EOPNOTSUPP);
714 }
715 
716 int
717 vfs_stdvptofh (vp, fhp)
718 	struct vnode *vp;
719 	struct fid *fhp;
720 {
721 	return (EOPNOTSUPP);
722 }
723 
724 int
725 vfs_stdstart (mp, flags, p)
726 	struct mount *mp;
727 	int flags;
728 	struct proc *p;
729 {
730 	return (0);
731 }
732 
733 int
734 vfs_stdquotactl (mp, cmds, uid, arg, p)
735 	struct mount *mp;
736 	int cmds;
737 	uid_t uid;
738 	caddr_t arg;
739 	struct proc *p;
740 {
741 	return (EOPNOTSUPP);
742 }
743 
744 int
745 vfs_stdsync (mp, waitfor, cred, p)
746 	struct mount *mp;
747 	int waitfor;
748 	struct ucred *cred;
749 	struct proc *p;
750 {
751 	return (0);
752 }
753 
754 int
755 vfs_stdvget (mp, ino, vpp)
756 	struct mount *mp;
757 	ino_t ino;
758 	struct vnode **vpp;
759 {
760 	return (EOPNOTSUPP);
761 }
762 
763 int
764 vfs_stdfhtovp (mp, fhp, vpp)
765 	struct mount *mp;
766 	struct fid *fhp;
767 	struct vnode **vpp;
768 {
769 	return (EOPNOTSUPP);
770 }
771 
772 int
773 vfs_stdinit (vfsp)
774 	struct vfsconf *vfsp;
775 {
776 	return (0);
777 }
778 
779 int
780 vfs_stduninit (vfsp)
781 	struct vfsconf *vfsp;
782 {
783 	return(0);
784 }
785 
786 int
787 vfs_stdextattrctl(mp, cmd, filename_vp, attrnamespace, attrname, p)
788 	struct mount *mp;
789 	int cmd;
790 	struct vnode *filename_vp;
791 	int attrnamespace;
792 	const char *attrname;
793 	struct proc *p;
794 {
795 	return(EOPNOTSUPP);
796 }
797 
798 /* end of vfs default ops */
799