2 * Coda: an Experimental Distributed File System
5 * Copyright (c) 1987-1998 Carnegie Mellon University
8 * Permission to use, copy, modify and distribute this software and its
9 * documentation is hereby granted, provided that both the copyright
10 * notice and this permission notice appear in all copies of the
11 * software, derivative works or modified versions, and any portions
12 * thereof, and that both notices appear in supporting documentation, and
13 * that credit is given to Carnegie Mellon University in all documents
14 * and publicity pertaining to direct or indirect use of this code or its
17 * CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS KNOWN TO HAVE BUGS,
18 * SOME OF WHICH MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON ALLOWS
19 * FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION. CARNEGIE MELLON
20 * DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER
21 * RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE OR OF
22 * ANY DERIVATIVE WORK.
24 * Carnegie Mellon encourages users of this software to return any
25 * improvements or extensions that they make, and to grant Carnegie
26 * Mellon the rights to redistribute these changes without encumbrance.
28 * @(#) src/sys/coda/coda_vnops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $
31 * Mach Operating System
32 * Copyright (c) 1990 Carnegie-Mellon University
33 * Copyright (c) 1989 Carnegie-Mellon University
34 * All rights reserved. The CMU software License Agreement specifies
35 * the terms and conditions for use and redistribution.
39 * This code was written for the Coda filesystem at Carnegie Mellon
40 * University. Contributers include David Steere, James Kistler, and
44 #include <sys/cdefs.h>
45 __FBSDID("$FreeBSD$");
47 #include <sys/param.h>
48 #include <sys/systm.h>
50 #include <sys/errno.h>
51 #include <sys/fcntl.h>
52 #include <sys/kernel.h>
54 #include <sys/malloc.h>
55 #include <sys/file.h> /* Must come after sys/malloc.h */
56 #include <sys/mount.h>
57 #include <sys/mutex.h>
58 #include <sys/namei.h>
61 #include <sys/unistd.h>
64 #include <vm/vm_object.h>
65 #include <vm/vm_extern.h>
67 #include <fs/coda/coda.h>
68 #include <fs/coda/cnode.h>
69 #include <fs/coda/coda_vnops.h>
70 #include <fs/coda/coda_venus.h>
71 #include <fs/coda/coda_opstats.h>
72 #include <fs/coda/coda_subr.h>
73 #include <fs/coda/coda_pioctl.h>
76 * These flags select various performance enhancements.
78 static int coda_attr_cache = 1; /* Set to cache attributes. */
79 static int coda_symlink_cache = 1; /* Set to cache symbolic links. */
80 static int coda_access_cache = 1; /* Set to cache some access checks. */
83 * Structure to keep track of vfs calls.
85 static struct coda_op_stats coda_vnodeopstats[CODA_VNODEOPS_SIZE];
87 #define MARK_ENTRY(op) (coda_vnodeopstats[op].entries++)
88 #define MARK_INT_SAT(op) (coda_vnodeopstats[op].sat_intrn++)
89 #define MARK_INT_FAIL(op) (coda_vnodeopstats[op].unsat_intrn++)
90 #define MARK_INT_GEN(op) (coda_vnodeopstats[op].gen_intrn++)
93 * What we are delaying for in printf.
95 int coda_printf_delay = 0; /* In microseconds */
96 int coda_vnop_print_entry = 0;
97 static int coda_lockdebug = 0;
100 * Some FreeBSD details:
102 * codadev_modevent is called at boot time or module load time.
105 if (coda_vnop_print_entry) \
106 myprintf(("Entered %s\n", __func__)); \
110 * Definition of the vnode operation vector.
112 struct vop_vector coda_vnodeops = {
113 .vop_default = &default_vnodeops,
114 .vop_cachedlookup = coda_lookup, /* uncached lookup */
115 .vop_lookup = vfs_cache_lookup, /* namecache lookup */
116 .vop_create = coda_create, /* create */
117 .vop_open = coda_open, /* open */
118 .vop_close = coda_close, /* close */
119 .vop_access = coda_access, /* access */
120 .vop_getattr = coda_getattr, /* getattr */
121 .vop_setattr = coda_setattr, /* setattr */
122 .vop_read = coda_read, /* read */
123 .vop_write = coda_write, /* write */
124 .vop_ioctl = coda_ioctl, /* ioctl */
125 .vop_fsync = coda_fsync, /* fsync */
126 .vop_remove = coda_remove, /* remove */
127 .vop_link = coda_link, /* link */
128 .vop_rename = coda_rename, /* rename */
129 .vop_mkdir = coda_mkdir, /* mkdir */
130 .vop_rmdir = coda_rmdir, /* rmdir */
131 .vop_symlink = coda_symlink, /* symlink */
132 .vop_readdir = coda_readdir, /* readdir */
133 .vop_readlink = coda_readlink, /* readlink */
134 .vop_inactive = coda_inactive, /* inactive */
135 .vop_reclaim = coda_reclaim, /* reclaim */
136 .vop_lock1 = coda_lock, /* lock */
137 .vop_unlock = coda_unlock, /* unlock */
138 .vop_bmap = VOP_EOPNOTSUPP, /* bmap */
139 .vop_print = VOP_NULL, /* print */
140 .vop_islocked = coda_islocked, /* islocked */
141 .vop_pathconf = coda_pathconf, /* pathconf */
142 .vop_poll = vop_stdpoll,
143 .vop_getpages = vop_stdgetpages, /* pager intf.*/
144 .vop_putpages = vop_stdputpages, /* pager intf.*/
145 .vop_getwritemount = vop_stdgetwritemount,
148 .vop_cachedlookup = ufs_lookup,
149 .vop_whiteout = ufs_whiteout,
154 static void coda_print_vattr(struct vattr *attr);
157 coda_vnodeopstats_init(void)
161 for(i=0; i<CODA_VNODEOPS_SIZE; i++) {
162 coda_vnodeopstats[i].opcode = i;
163 coda_vnodeopstats[i].entries = 0;
164 coda_vnodeopstats[i].sat_intrn = 0;
165 coda_vnodeopstats[i].unsat_intrn = 0;
166 coda_vnodeopstats[i].gen_intrn = 0;
172 * coda_open calls Venus which returns an open file descriptor the cache file
173 * holding the data. We get the vnode while we are still in the context of
174 * the venus process in coda_psdev.c. This vnode is then passed back to the
178 coda_open(struct vop_open_args *ap)
182 * FreeBSD can pass the O_EXCL flag in mode, even though the check
183 * has already happened. Venus defensively assumes that if open is
184 * passed the EXCL, it must be a bug. We strip the flag here.
187 struct vnode **vpp = &(ap->a_vp);
188 struct cnode *cp = VTOC(*vpp);
189 int flag = ap->a_mode & (~O_EXCL);
190 struct ucred *cred = ap->a_cred;
191 struct thread *td = ap->a_td;
196 MARK_ENTRY(CODA_OPEN_STATS);
199 * Check for open of control file.
201 if (IS_CTL_VP(*vpp)) {
203 /* if (WRITEABLE(flag)) */
204 if (flag & (FWRITE | O_TRUNC | O_CREAT | O_EXCL)) {
205 MARK_INT_FAIL(CODA_OPEN_STATS);
208 MARK_INT_SAT(CODA_OPEN_STATS);
211 error = venus_open(vtomi((*vpp)), &cp->c_fid, flag, cred,
215 CODADEBUG(CODA_OPEN, myprintf(("open: vp %p result %d\n", vp,
219 * Save the vnode pointer for the cache file.
221 if (cp->c_ovp == NULL) {
225 panic("coda_open: cp->c_ovp != ITOV(ip)");
230 * Flush the attribute cached if writing the file.
234 cp->c_flags &= ~C_VATTR;
238 * Open the cache file.
240 vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
241 error = VOP_OPEN(vp, flag, cred, td, NULL);
243 VOP_UNLOCK(vp, 0, td);
244 printf("coda_open: VOP_OPEN on container failed %d\n", error);
247 (*vpp)->v_object = vp->v_object;
248 VOP_UNLOCK(vp, 0, td);
253 * Close the cache file used for I/O and notify Venus.
256 coda_close(struct vop_close_args *ap)
259 struct vnode *vp = ap->a_vp;
260 struct cnode *cp = VTOC(vp);
261 int flag = ap->a_fflag;
262 struct ucred *cred = ap->a_cred;
263 struct thread *td = ap->a_td;
267 MARK_ENTRY(CODA_CLOSE_STATS);
270 * Check for close of control file.
273 MARK_INT_SAT(CODA_CLOSE_STATS);
277 vn_lock(cp->c_ovp, LK_EXCLUSIVE | LK_RETRY, td);
278 /* Do errors matter here? */
279 VOP_CLOSE(cp->c_ovp, flag, cred, td);
284 printf("coda_close: NO container vp %p/cp %p\n", vp, cp);
286 if (--cp->c_ocount == 0)
290 * File was opened for write.
294 if (!IS_UNMOUNTING(cp))
295 error = venus_close(vtomi(vp), &cp->c_fid, flag, cred,
299 CODADEBUG(CODA_CLOSE, myprintf(("close: result %d\n",error)););
304 coda_read(struct vop_read_args *ap)
308 return (coda_rdwr(ap->a_vp, ap->a_uio, UIO_READ, ap->a_ioflag,
309 ap->a_cred, ap->a_uio->uio_td));
313 coda_write(struct vop_write_args *ap)
317 return (coda_rdwr(ap->a_vp, ap->a_uio, UIO_WRITE, ap->a_ioflag,
318 ap->a_cred, ap->a_uio->uio_td));
322 coda_rdwr(struct vnode *vp, struct uio *uiop, enum uio_rw rw, int ioflag,
323 struct ucred *cred, struct thread *td)
326 /* NOTE: container file operation!!! */
328 struct cnode *cp = VTOC(vp);
329 struct vnode *cfvp = cp->c_ovp;
330 int opened_internally = 0;
333 MARK_ENTRY(CODA_RDWR_STATS);
334 CODADEBUG(CODA_RDWR, myprintf(("coda_rdwr(%d, %p, %d, %lld, %d)\n",
335 rw, (void *)uiop->uio_iov->iov_base, uiop->uio_resid,
336 (long long)uiop->uio_offset, uiop->uio_segflg)););
339 * Check for rdwr of control object.
342 MARK_INT_FAIL(CODA_RDWR_STATS);
347 * If file is not already open this must be a page {read,write}
348 * request and we should open it internally.
351 opened_internally = 1;
352 MARK_INT_GEN(CODA_OPEN_STATS);
353 error = VOP_OPEN(vp, (rw == UIO_READ ? FREAD : FWRITE), cred,
356 printf("coda_rdwr: Internally Opening %p\n", vp);
359 printf("coda_rdwr: VOP_OPEN on container failed "
367 * Have UFS handle the call.
369 CODADEBUG(CODA_RDWR, myprintf(("indirect rdwr: fid = %s, refcnt = "
370 "%d\n", coda_f2s(&cp->c_fid), CTOV(cp)->v_usecount)););
371 vn_lock(cfvp, LK_EXCLUSIVE | LK_RETRY, td);
372 if (rw == UIO_READ) {
373 error = VOP_READ(cfvp, uiop, ioflag, cred);
375 error = VOP_WRITE(cfvp, uiop, ioflag, cred);
377 * ufs_write updates the vnode_pager_setsize for the
380 * XXX: Since we now share vm objects between layers, this is
381 * probably unnecessary.
385 if (VOP_GETATTR(cfvp, &attr, cred, td) == 0)
386 vnode_pager_setsize(vp, attr.va_size);
389 VOP_UNLOCK(cfvp, 0, td);
391 MARK_INT_FAIL(CODA_RDWR_STATS);
393 MARK_INT_SAT(CODA_RDWR_STATS);
396 * Do an internal close if necessary.
398 if (opened_internally) {
399 MARK_INT_GEN(CODA_CLOSE_STATS);
400 (void)VOP_CLOSE(vp, (rw == UIO_READ ? FREAD : FWRITE), cred,
405 * Invalidate cached attributes if writing.
408 cp->c_flags &= ~C_VATTR;
413 coda_ioctl(struct vop_ioctl_args *ap)
416 struct vnode *vp = ap->a_vp;
417 int com = ap->a_command;
418 caddr_t data = ap->a_data;
419 int flag = ap->a_fflag;
420 struct ucred *cred = ap->a_cred;
421 struct thread *td = ap->a_td;
425 struct nameidata ndp;
426 struct PioctlData *iap = (struct PioctlData *)data;
428 MARK_ENTRY(CODA_IOCTL_STATS);
429 CODADEBUG(CODA_IOCTL, myprintf(("in coda_ioctl on %s\n", iap->path)););
432 * Don't check for operation on a dying object, for ctlvp it
435 * Must be control object to succeed.
437 if (!IS_CTL_VP(vp)) {
438 MARK_INT_FAIL(CODA_IOCTL_STATS);
439 CODADEBUG(CODA_IOCTL, myprintf(("coda_ioctl error: vp != "
445 * Look up the pathname.
447 * Should we use the name cache here? It would get it from lookupname
448 * sooner or later anyway, right?
450 NDINIT(&ndp, LOOKUP, (iap->follow ? FOLLOW : NOFOLLOW),
451 UIO_USERSPACE, iap->path, td);
455 MARK_INT_FAIL(CODA_IOCTL_STATS);
456 CODADEBUG(CODA_IOCTL, myprintf(("coda_ioctl error: lookup "
457 "returns %d\n", error)););
462 * Make sure this is a coda style cnode, but it may be a different
465 if (tvp->v_op != &coda_vnodeops) {
467 NDFREE(&ndp, NDF_ONLY_PNBUF);
468 MARK_INT_FAIL(CODA_IOCTL_STATS);
469 CODADEBUG(CODA_IOCTL,
470 myprintf(("coda_ioctl error: %s not a coda object\n",
474 if (iap->vi.in_size > VC_MAXDATASIZE) {
478 error = venus_ioctl(vtomi(tvp), &((VTOC(tvp))->c_fid), com, flag,
479 data, cred, td->td_proc);
481 MARK_INT_FAIL(CODA_IOCTL_STATS);
483 CODADEBUG(CODA_IOCTL, myprintf(("Ioctl returns %d \n",
486 NDFREE(&ndp, NDF_ONLY_PNBUF);
491 * To reduce the cost of a user-level venus;we cache attributes in the
492 * kernel. Each cnode has storage allocated for an attribute. If c_vattr is
493 * valid, return a reference to it. Otherwise, get the attributes from venus
494 * and store them in the cnode. There is some question if this method is a
495 * security leak. But I think that in order to make this call, the user must
496 * have done a lookup and opened the file, and therefore should already have
500 coda_getattr(struct vop_getattr_args *ap)
503 struct vnode *vp = ap->a_vp;
504 struct cnode *cp = VTOC(vp);
505 struct vattr *vap = ap->a_vap;
506 struct ucred *cred = ap->a_cred;
507 struct thread *td = ap->a_td;
512 MARK_ENTRY(CODA_GETATTR_STATS);
513 if (IS_UNMOUNTING(cp))
517 * Check for getattr of control object.
520 MARK_INT_FAIL(CODA_GETATTR_STATS);
525 * Check to see if the attributes have already been cached.
527 if (VALID_VATTR(cp)) {
528 CODADEBUG(CODA_GETATTR, myprintf(("attr cache hit: %s\n",
529 coda_f2s(&cp->c_fid))););
530 CODADEBUG(CODA_GETATTR, if (!(codadebug & ~CODA_GETATTR))
531 coda_print_vattr(&cp->c_vattr););
533 MARK_INT_SAT(CODA_GETATTR_STATS);
536 error = venus_getattr(vtomi(vp), &cp->c_fid, cred, td->td_proc, vap);
538 CODADEBUG(CODA_GETATTR, myprintf(("getattr miss %s: result "
539 "%d\n", coda_f2s(&cp->c_fid), error)););
540 CODADEBUG(CODA_GETATTR, if (!(codadebug & ~CODA_GETATTR))
541 coda_print_vattr(vap););
544 * XXX: Since we now share vm objects between layers, this is
545 * probably unnecessary.
550 vnode_pager_setsize(convp, size);
553 * If not open for write, store attributes in cnode.
555 if ((cp->c_owrite == 0) && (coda_attr_cache)) {
557 cp->c_flags |= C_VATTR;
564 coda_setattr(struct vop_setattr_args *ap)
567 struct vnode *vp = ap->a_vp;
568 struct cnode *cp = VTOC(vp);
569 struct vattr *vap = ap->a_vap;
570 struct ucred *cred = ap->a_cred;
571 struct thread *td = ap->a_td;
576 MARK_ENTRY(CODA_SETATTR_STATS);
579 * Check for setattr of control object.
582 MARK_INT_FAIL(CODA_SETATTR_STATS);
585 if (codadebug & CODADBGMSK(CODA_SETATTR))
586 coda_print_vattr(vap);
587 error = venus_setattr(vtomi(vp), &cp->c_fid, vap, cred, td->td_proc);
589 cp->c_flags &= ~(C_VATTR | C_ACCCACHE);
592 * XXX: Since we now share vm objects between layers, this is
593 * probably unnecessary.
595 * XXX: Shouldn't we only be doing this "set" if C_VATTR remains
596 * valid after venus_setattr()?
600 if (size != VNOVAL && convp != NULL)
601 vnode_pager_setsize(convp, size);
602 CODADEBUG(CODA_SETATTR, myprintf(("setattr %d\n", error)););
607 coda_access(struct vop_access_args *ap)
610 struct vnode *vp = ap->a_vp;
611 struct cnode *cp = VTOC(vp);
612 int mode = ap->a_mode;
613 struct ucred *cred = ap->a_cred;
614 struct thread *td = ap->a_td;
618 MARK_ENTRY(CODA_ACCESS_STATS);
621 * Check for access of control object. Only read access is allowed
626 * Bogus hack - all will be marked as successes.
628 MARK_INT_SAT(CODA_ACCESS_STATS);
629 return (((mode & VREAD) && !(mode & (VWRITE | VEXEC)))
634 * We maintain a one-entry LRU positive access cache with each cnode.
635 * In principle we could also track negative results, and for more
636 * than one uid, but we don't yet. Venus is responsible for
637 * invalidating this cache as required.
639 if (coda_access_cache && VALID_ACCCACHE(cp) &&
640 (cred->cr_uid == cp->c_cached_uid) &&
641 (mode & cp->c_cached_mode) == mode) {
642 MARK_INT_SAT(CODA_ACCESS_STATS);
645 error = venus_access(vtomi(vp), &cp->c_fid, mode, cred, td->td_proc);
646 if (error == 0 && coda_access_cache) {
648 * When we have a new successful request, we consider three
651 * - No initialized access cache, in which case cache the
653 * - Cached result for a different user, in which case we
655 * - Cached result for the same user, in which case we add
656 * any newly granted rights to the cached mode.
658 * XXXRW: If we ever move to something more interesting than
659 * uid-based token lookup, we'll need to change this.
661 cp->c_flags |= C_ACCCACHE;
662 if (cp->c_cached_uid != cred->cr_uid) {
663 cp->c_cached_mode = mode;
664 cp->c_cached_uid = cred->cr_uid;
666 cp->c_cached_mode |= mode;
672 coda_readlink(struct vop_readlink_args *ap)
675 struct vnode *vp = ap->a_vp;
676 struct cnode *cp = VTOC(vp);
677 struct uio *uiop = ap->a_uio;
678 struct ucred *cred = ap->a_cred;
679 struct thread *td = ap->a_uio->uio_td;
685 MARK_ENTRY(CODA_READLINK_STATS);
688 * Check for readlink of control object.
691 MARK_INT_FAIL(CODA_READLINK_STATS);
694 if ((coda_symlink_cache) && (VALID_SYMLINK(cp))) {
696 * Symlink was cached.
698 uiop->uio_rw = UIO_READ;
699 error = uiomove(cp->c_symlink, (int)cp->c_symlen, uiop);
701 MARK_INT_FAIL(CODA_READLINK_STATS);
703 MARK_INT_SAT(CODA_READLINK_STATS);
706 error = venus_readlink(vtomi(vp), &cp->c_fid, cred, td != NULL ?
707 td->td_proc : NULL, &str, &len);
709 uiop->uio_rw = UIO_READ;
710 error = uiomove(str, len, uiop);
711 if (coda_symlink_cache) {
714 cp->c_flags |= C_SYMLINK;
718 CODADEBUG(CODA_READLINK, myprintf(("in readlink result %d\n",
724 coda_fsync(struct vop_fsync_args *ap)
727 struct vnode *vp = ap->a_vp;
728 struct cnode *cp = VTOC(vp);
729 struct thread *td = ap->a_td;
731 struct vnode *convp = cp->c_ovp;
734 MARK_ENTRY(CODA_FSYNC_STATS);
737 * Check for fsync on an unmounting object.
739 * XXX: Is this comment true on FreeBSD? It seems likely, since
740 * unmounting is fairly non-atomic.
742 * The NetBSD kernel, in it's infinite wisdom, can try to fsync after
743 * an unmount has been initiated. This is a Bad Thing, which we have
744 * to avoid. Not a legitimate failure for stats.
746 if (IS_UNMOUNTING(cp))
750 * Check for fsync of control object.
753 MARK_INT_SAT(CODA_FSYNC_STATS);
757 vn_lock(convp, LK_EXCLUSIVE | LK_RETRY, td);
758 VOP_FSYNC(convp, MNT_WAIT, td);
759 VOP_UNLOCK(convp, 0, td);
763 * We see fsyncs with usecount == 1 then usecount == 0. For now we
768 if (!vp->v_usecount) {
769 printf("coda_fsync on vnode %p with %d usecount. "
770 "c_flags = %x (%x)\n", vp, vp->v_usecount, cp->c_flags,
771 cp->c_flags&C_PURGING);
777 * We can expect fsync on any vnode at all if venus is purging it.
778 * Venus can't very well answer the fsync request, now can it?
779 * Hopefully, it won't have to, because hopefully, venus preserves
780 * the (possibly untrue) invariant that it never purges an open
783 if (cp->c_flags & C_PURGING)
786 /* XXX: needs research */
788 error = venus_fsync(vtomi(vp), &cp->c_fid, td->td_proc);
789 CODADEBUG(CODA_FSYNC, myprintf(("in fsync result %d\n", error)););
794 coda_inactive(struct vop_inactive_args *ap)
797 * XXX - at the moment, inactive doesn't look at cred, and doesn't
798 * have a proc pointer. Oops.
801 struct vnode *vp = ap->a_vp;
802 struct cnode *cp = VTOC(vp);
803 struct ucred *cred __attribute__((unused)) = NULL;
804 struct thread *td __attribute__((unused)) = curthread;
809 * We don't need to send inactive to venus - DCS.
811 MARK_ENTRY(CODA_INACTIVE_STATS);
812 CODADEBUG(CODA_INACTIVE, myprintf(("in inactive, %s, vfsp %p\n",
813 coda_f2s(&cp->c_fid), vp->v_mount)););
817 * If an array has been allocated to hold the symlink, deallocate it.
819 if ((coda_symlink_cache) && (VALID_SYMLINK(cp))) {
820 if (cp->c_symlink == NULL)
821 panic("coda_inactive: null symlink pointer in cnode");
822 CODA_FREE(cp->c_symlink, cp->c_symlen);
823 cp->c_flags &= ~C_SYMLINK;
828 * Remove it from the table so it can't be found.
831 if ((struct coda_mntinfo *)(vp->v_mount->mnt_data) == NULL) {
832 myprintf(("Help! vfsp->vfs_data was NULL, but vnode %p "
833 "wasn't dying\n", vp));
834 panic("badness in coda_inactive\n");
836 if (IS_UNMOUNTING(cp)) {
838 printf("coda_inactive: IS_UNMOUNTING use %d: vp %p, cp %p\n",
839 vrefcnt(vp), vp, cp);
840 if (cp->c_ovp != NULL)
841 printf("coda_inactive: cp->ovp != NULL use %d: vp "
842 "%p, cp %p\n", vrefcnt(vp), vp, cp);
846 MARK_INT_SAT(CODA_INACTIVE_STATS);
851 * Remote filesystem operations having to do with directory manipulation.
855 * In FreeBSD, lookup returns the vnode locked.
858 coda_lookup(struct vop_cachedlookup_args *ap)
861 struct vnode *dvp = ap->a_dvp;
862 struct cnode *dcp = VTOC(dvp);
863 struct vnode **vpp = ap->a_vpp;
865 * It looks as though ap->a_cnp->ni_cnd->cn_nameptr holds the rest of
866 * the string to xlate, and that we must try to get at least
867 * ap->a_cnp->ni_cnd->cn_namelen of those characters to macth. I
870 struct componentname *cnp = ap->a_cnp;
871 struct ucred *cred = cnp->cn_cred;
872 struct thread *td = cnp->cn_thread;
875 const char *nm = cnp->cn_nameptr;
876 int len = cnp->cn_namelen;
881 MARK_ENTRY(CODA_LOOKUP_STATS);
882 CODADEBUG(CODA_LOOKUP, myprintf(("lookup: %s in %s\n", nm,
883 coda_f2s(&dcp->c_fid))););
886 * Check for lookup of control object.
888 if (IS_CTL_NAME(dvp, nm, len)) {
891 MARK_INT_SAT(CODA_LOOKUP_STATS);
894 if (len+1 > CODA_MAXNAMLEN) {
895 MARK_INT_FAIL(CODA_LOOKUP_STATS);
896 CODADEBUG(CODA_LOOKUP, myprintf(("name too long: lookup, "
897 "%s (%s)\n", coda_f2s(&dcp->c_fid), nm)););
903 error = venus_lookup(vtomi(dvp), &dcp->c_fid, nm, len, cred,
904 td->td_proc, &VFid, &vtype);
906 MARK_INT_FAIL(CODA_LOOKUP_STATS);
907 CODADEBUG(CODA_LOOKUP, myprintf(("lookup error on %s "
908 "(%s)%d\n", coda_f2s(&dcp->c_fid), nm, error)););
911 MARK_INT_SAT(CODA_LOOKUP_STATS);
912 CODADEBUG(CODA_LOOKUP, myprintf(("lookup: %s type %o "
913 "result %d\n", coda_f2s(&VFid), vtype, error)););
914 cp = make_coda_node(&VFid, dvp->v_mount, vtype);
918 * Enter the new vnode in the namecache only if the top bit
921 * And don't enter a new vnode for an invalid one!
923 if (!(vtype & CODA_NOCACHE) && (cnp->cn_flags & MAKEENTRY))
924 cache_enter(dvp, *vpp, cnp);
928 * If we are creating, and this was the last name to be looked up,
929 * and the error was ENOENT, then there really shouldn't be an error
930 * and we can make the leaf NULL and return success. Since this is
931 * supposed to work under Mach as well as FreeBSD, we're leaving this
932 * fn wrapped. We also must tell lookup/namei that we need to save
933 * the last component of the name. (Create will have to free the
934 * name buffer later...lucky us...).
936 if (((cnp->cn_nameiop == CREATE) || (cnp->cn_nameiop == RENAME))
937 && (cnp->cn_flags & ISLASTCN) && (error == ENOENT)) {
939 cnp->cn_flags |= SAVENAME;
944 * If we are removing, and we are at the last element, and we found
945 * it, then we need to keep the name around so that the removal will
946 * go ahead as planned. Unfortunately, this will probably also lock
947 * the to-be-removed vnode, which may or may not be a good idea.
948 * I'll have to look at the bits of coda_remove to make sure. We'll
949 * only save the name if we did in fact find the name, otherwise
950 * coda_remove won't have a chance to free the pathname.
952 if ((cnp->cn_nameiop == DELETE) && (cnp->cn_flags & ISLASTCN)
954 cnp->cn_flags |= SAVENAME;
957 * If the lookup went well, we need to (potentially?) unlock the
958 * parent, and lock the child. We are only responsible for checking
959 * to see if the parent is supposed to be unlocked before we return.
960 * We must always lock the child (provided there is one, and (the
961 * parent isn't locked or it isn't the same as the parent.) Simple,
962 * huh? We can never leave the parent locked unless we are ISLASTCN.
964 if (!error || (error == EJUSTRETURN)) {
965 if (cnp->cn_flags & ISDOTDOT) {
966 VOP_UNLOCK(dvp, 0, td);
968 * The parent is unlocked. As long as there is a
969 * child, lock it without bothering to check anything
973 vn_lock(*ap->a_vpp, LK_EXCLUSIVE | LK_RETRY,
975 vn_lock(dvp, LK_RETRY|LK_EXCLUSIVE, td);
978 * The parent is locked, and may be the same as the
979 * child. If different, go ahead and lock it.
981 if (*ap->a_vpp && (*ap->a_vpp != dvp))
982 vn_lock(*ap->a_vpp, LK_EXCLUSIVE | LK_RETRY,
987 * If the lookup failed, we need to ensure that the leaf is
990 * Don't change any locking?
999 coda_create(struct vop_create_args *ap)
1002 struct vnode *dvp = ap->a_dvp;
1003 struct cnode *dcp = VTOC(dvp);
1004 struct vattr *va = ap->a_vap;
1006 int mode = ap->a_vap->va_mode;
1007 struct vnode **vpp = ap->a_vpp;
1008 struct componentname *cnp = ap->a_cnp;
1009 struct ucred *cred = cnp->cn_cred;
1010 struct thread *td = cnp->cn_thread;
1014 const char *nm = cnp->cn_nameptr;
1015 int len = cnp->cn_namelen;
1019 MARK_ENTRY(CODA_CREATE_STATS);
1022 * All creates are exclusive XXX.
1024 * I'm assuming the 'mode' argument is the file mode bits XXX.
1026 * Check for create of control object.
1028 if (IS_CTL_NAME(dvp, nm, len)) {
1029 *vpp = (struct vnode *)0;
1030 MARK_INT_FAIL(CODA_CREATE_STATS);
1033 error = venus_create(vtomi(dvp), &dcp->c_fid, nm, len, exclusive,
1034 mode, va, cred, td->td_proc, &VFid, &attr);
1037 * If this is an exclusive create, panic if the file already
1040 * Venus should have detected the file and reported EEXIST.
1042 if ((exclusive == 1) && (coda_find(&VFid) != NULL))
1043 panic("cnode existed for newly created file!");
1044 cp = make_coda_node(&VFid, dvp->v_mount, attr.va_type);
1048 * Update va to reflect the new attributes.
1053 * Update the attribute cache and mark it as valid.
1055 if (coda_attr_cache) {
1056 VTOC(*vpp)->c_vattr = attr;
1057 VTOC(*vpp)->c_flags |= C_VATTR;
1061 * Invalidate the parent's attr cache, the modification time
1064 VTOC(dvp)->c_flags &= ~C_VATTR;
1065 cache_enter(dvp, *vpp, cnp);
1066 CODADEBUG(CODA_CREATE, myprintf(("create: %s, result %d\n",
1067 coda_f2s(&VFid), error)););
1069 *vpp = (struct vnode *)0;
1070 CODADEBUG(CODA_CREATE, myprintf(("create error %d\n",
1074 if (cnp->cn_flags & MAKEENTRY)
1075 cache_enter(dvp, *vpp, cnp);
1076 if (cnp->cn_flags & LOCKLEAF)
1077 vn_lock(*ap->a_vpp, LK_EXCLUSIVE | LK_RETRY, td);
1078 } else if (error == ENOENT) {
1080 * XXXRW: We only enter a negative entry if ENOENT is
1081 * returned, not other errors. But will Venus invalidate dvp
1082 * properly in all cases when new files appear via the
1083 * network rather than a local operation?
1085 if (cnp->cn_flags & MAKEENTRY)
1086 cache_enter(dvp, NULL, cnp);
1092 coda_remove(struct vop_remove_args *ap)
1095 struct vnode *vp = ap->a_vp;
1096 struct vnode *dvp = ap->a_dvp;
1097 struct cnode *cp = VTOC(dvp);
1098 struct componentname *cnp = ap->a_cnp;
1099 struct ucred *cred = cnp->cn_cred;
1100 struct thread *td = cnp->cn_thread;
1103 const char *nm = cnp->cn_nameptr;
1104 int len = cnp->cn_namelen;
1109 MARK_ENTRY(CODA_REMOVE_STATS);
1110 CODADEBUG(CODA_REMOVE, myprintf(("remove: %s in %s\n", nm,
1111 coda_f2s(&cp->c_fid))););
1114 * Check for remove of control object.
1116 if (IS_CTL_NAME(dvp, nm, len)) {
1117 MARK_INT_FAIL(CODA_REMOVE_STATS);
1122 * Invalidate the parent's attr cache, the modification time has
1123 * changed. We don't yet know if the last reference to the file is
1124 * being removed, but we do know the reference count on the child has
1125 * changed, so invalidate its attr cache also.
1127 VTOC(dvp)->c_flags &= ~C_VATTR;
1128 VTOC(vp)->c_flags &= ~(C_VATTR | C_ACCCACHE);
1129 error = venus_remove(vtomi(dvp), &cp->c_fid, nm, len, cred,
1132 CODADEBUG(CODA_REMOVE, myprintf(("in remove result %d\n",error)););
1137 coda_link(struct vop_link_args *ap)
1140 struct vnode *vp = ap->a_vp;
1141 struct cnode *cp = VTOC(vp);
1142 struct vnode *tdvp = ap->a_tdvp;
1143 struct cnode *tdcp = VTOC(tdvp);
1144 struct componentname *cnp = ap->a_cnp;
1145 struct ucred *cred = cnp->cn_cred;
1146 struct thread *td = cnp->cn_thread;
1149 const char *nm = cnp->cn_nameptr;
1150 int len = cnp->cn_namelen;
1152 MARK_ENTRY(CODA_LINK_STATS);
1154 if (codadebug & CODADBGMSK(CODA_LINK)) {
1155 myprintf(("nb_link: vp fid: %s\n", coda_f2s(&cp->c_fid)));
1156 myprintf(("nb_link: tdvp fid: %s)\n",
1157 coda_f2s(&tdcp->c_fid)));
1159 if (codadebug & CODADBGMSK(CODA_LINK)) {
1160 myprintf(("link: vp fid: %s\n", coda_f2s(&cp->c_fid)));
1161 myprintf(("link: tdvp fid: %s\n", coda_f2s(&tdcp->c_fid)));
1165 * Check for link to/from control object.
1167 if (IS_CTL_NAME(tdvp, nm, len) || IS_CTL_VP(vp)) {
1168 MARK_INT_FAIL(CODA_LINK_STATS);
1171 error = venus_link(vtomi(vp), &cp->c_fid, &tdcp->c_fid, nm, len,
1175 * Invalidate the parent's attr cache, the modification time has
1178 VTOC(tdvp)->c_flags &= ~C_VATTR;
1179 VTOC(vp)->c_flags &= ~C_VATTR;
1180 CODADEBUG(CODA_LINK, myprintf(("in link result %d\n",error)););
1185 coda_rename(struct vop_rename_args *ap)
1188 struct vnode *fvp = ap->a_fvp;
1189 struct vnode *tvp = ap->a_tvp;
1190 struct vnode *odvp = ap->a_fdvp;
1191 struct cnode *odcp = VTOC(odvp);
1192 struct componentname *fcnp = ap->a_fcnp;
1193 struct vnode *ndvp = ap->a_tdvp;
1194 struct cnode *ndcp = VTOC(ndvp);
1195 struct componentname *tcnp = ap->a_tcnp;
1196 struct ucred *cred = fcnp->cn_cred;
1197 struct thread *td = fcnp->cn_thread;
1200 const char *fnm = fcnp->cn_nameptr;
1201 int flen = fcnp->cn_namelen;
1202 const char *tnm = tcnp->cn_nameptr;
1203 int tlen = tcnp->cn_namelen;
1205 MARK_ENTRY(CODA_RENAME_STATS);
1208 * Check for rename involving control object.
1210 if (IS_CTL_NAME(odvp, fnm, flen) || IS_CTL_NAME(ndvp, tnm, tlen)) {
1211 MARK_INT_FAIL(CODA_RENAME_STATS);
1216 * Remove the entries for both source and target directories, which
1217 * should catch references to the children. Perhaps we could purge
1224 * Invalidate parent directories as modification times have changed.
1225 * Invalidate access cache on renamed file as rights may have
1228 VTOC(odvp)->c_flags &= ~C_VATTR;
1229 VTOC(ndvp)->c_flags &= ~C_VATTR;
1230 VTOC(fvp)->c_flags &= ~C_ACCCACHE;
1231 if (flen+1 > CODA_MAXNAMLEN) {
1232 MARK_INT_FAIL(CODA_RENAME_STATS);
1236 if (tlen+1 > CODA_MAXNAMLEN) {
1237 MARK_INT_FAIL(CODA_RENAME_STATS);
1241 error = venus_rename(vtomi(odvp), &odcp->c_fid, &ndcp->c_fid, fnm,
1242 flen, tnm, tlen, cred, td->td_proc);
1244 CODADEBUG(CODA_RENAME, myprintf(("in rename result %d\n",error)););
1247 * Update namecache to reflect that the names of various objects may
1248 * have changed (or gone away entirely).
1254 * Release parents first, then children.
1270 coda_mkdir(struct vop_mkdir_args *ap)
1273 struct vnode *dvp = ap->a_dvp;
1274 struct cnode *dcp = VTOC(dvp);
1275 struct componentname *cnp = ap->a_cnp;
1276 struct vattr *va = ap->a_vap;
1277 struct vnode **vpp = ap->a_vpp;
1278 struct ucred *cred = cnp->cn_cred;
1279 struct thread *td = cnp->cn_thread;
1282 const char *nm = cnp->cn_nameptr;
1283 int len = cnp->cn_namelen;
1288 MARK_ENTRY(CODA_MKDIR_STATS);
1291 * Check for mkdir of target object.
1293 if (IS_CTL_NAME(dvp, nm, len)) {
1294 *vpp = (struct vnode *)0;
1295 MARK_INT_FAIL(CODA_MKDIR_STATS);
1298 if (len+1 > CODA_MAXNAMLEN) {
1299 *vpp = (struct vnode *)0;
1300 MARK_INT_FAIL(CODA_MKDIR_STATS);
1303 error = venus_mkdir(vtomi(dvp), &dcp->c_fid, nm, len, va, cred,
1304 td->td_proc, &VFid, &ova);
1306 if (coda_find(&VFid) != NULL)
1307 panic("cnode existed for newly created directory!");
1308 cp = make_coda_node(&VFid, dvp->v_mount, va->va_type);
1312 * Enter the new vnode in the Name Cache.
1314 if (cnp->cn_flags & MAKEENTRY)
1315 cache_enter(dvp, *vpp, cnp);
1318 * Update the attr cache and mark as valid.
1320 if (coda_attr_cache) {
1321 VTOC(*vpp)->c_vattr = ova;
1322 VTOC(*vpp)->c_flags |= C_VATTR;
1326 * Invalidate the parent's attr cache, the modification time
1329 VTOC(dvp)->c_flags &= ~C_VATTR;
1330 vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, td);
1331 CODADEBUG( CODA_MKDIR, myprintf(("mkdir: %s result %d\n",
1332 coda_f2s(&VFid), error)););
1335 CODADEBUG(CODA_MKDIR, myprintf(("mkdir error %d\n",error)););
1341 coda_rmdir(struct vop_rmdir_args *ap)
1344 struct vnode *vp = ap->a_vp;
1345 struct vnode *dvp = ap->a_dvp;
1346 struct cnode *dcp = VTOC(dvp);
1347 struct componentname *cnp = ap->a_cnp;
1348 struct ucred *cred = cnp->cn_cred;
1349 struct thread *td = cnp->cn_thread;
1352 const char *nm = cnp->cn_nameptr;
1353 int len = cnp->cn_namelen;
1358 MARK_ENTRY(CODA_RMDIR_STATS);
1361 * Check for rmdir of control object.
1363 if (IS_CTL_NAME(dvp, nm, len)) {
1364 MARK_INT_FAIL(CODA_RMDIR_STATS);
1369 * Possibly somewhat conservative purging, perhaps we just need to
1376 * Invalidate the parent's attr cache, the modification time has
1379 dcp->c_flags &= ~C_VATTR;
1380 error = venus_rmdir(vtomi(dvp), &dcp->c_fid, nm, len, cred,
1382 CODADEBUG(CODA_RMDIR, myprintf(("in rmdir result %d\n", error)););
1387 coda_symlink(struct vop_symlink_args *ap)
1390 struct vnode *tdvp = ap->a_dvp;
1391 struct cnode *tdcp = VTOC(tdvp);
1392 struct componentname *cnp = ap->a_cnp;
1393 struct vattr *tva = ap->a_vap;
1394 char *path = ap->a_target;
1395 struct ucred *cred = cnp->cn_cred;
1396 struct thread *td = cnp->cn_thread;
1397 struct vnode **vpp = ap->a_vpp;
1402 * XXX I'm assuming the following things about coda_symlink's
1404 * t(foo) is the new name/parent/etc being created.
1405 * lname is the contents of the new symlink.
1407 char *nm = cnp->cn_nameptr;
1408 int len = cnp->cn_namelen;
1409 int plen = strlen(path);
1412 * Here's the strategy for the moment: perform the symlink, then do a
1413 * lookup to grab the resulting vnode. I know this requires two
1414 * communications with Venus for a new sybolic link, but that's the
1415 * way the ball bounces. I don't yet want to change the way the Mach
1416 * symlink works. When Mach support is deprecated, we should change
1417 * symlink so that the common case returns the resultant vnode in a
1420 MARK_ENTRY(CODA_SYMLINK_STATS);
1423 * Check for symlink of control object.
1425 if (IS_CTL_NAME(tdvp, nm, len)) {
1426 MARK_INT_FAIL(CODA_SYMLINK_STATS);
1429 if (plen+1 > CODA_MAXPATHLEN) {
1430 MARK_INT_FAIL(CODA_SYMLINK_STATS);
1433 if (len+1 > CODA_MAXNAMLEN) {
1434 MARK_INT_FAIL(CODA_SYMLINK_STATS);
1438 error = venus_symlink(vtomi(tdvp), &tdcp->c_fid, path, plen, nm, len,
1439 tva, cred, td->td_proc);
1442 * Invalidate the parent's attr cache, the modification time has
1445 tdcp->c_flags &= ~C_VATTR;
1447 error = VOP_LOOKUP(tdvp, vpp, cnp);
1449 CODADEBUG(CODA_SYMLINK, myprintf(("in symlink result %d\n",error)););
1454 * Read directory entries.
1456 * XXX: This forwards the operator straight to the cache vnode using
1457 * VOP_READDIR(), rather than calling venus_readdir(). Why?
1460 coda_readdir(struct vop_readdir_args *ap)
1463 struct vnode *vp = ap->a_vp;
1464 struct cnode *cp = VTOC(vp);
1465 struct uio *uiop = ap->a_uio;
1466 struct ucred *cred = ap->a_cred;
1467 int *eofflag = ap->a_eofflag;
1468 u_long **cookies = ap->a_cookies;
1469 int *ncookies = ap->a_ncookies;
1470 struct thread *td = ap->a_uio->uio_td;
1474 int opened_internally = 0;
1476 MARK_ENTRY(CODA_READDIR_STATS);
1477 CODADEBUG(CODA_READDIR, myprintf(("coda_readdir(%p, %d, %lld, %d)\n",
1478 (void *)uiop->uio_iov->iov_base, uiop->uio_resid,
1479 (long long)uiop->uio_offset, uiop->uio_segflg)););
1482 * Check for readdir of control object.
1484 if (IS_CTL_VP(vp)) {
1485 MARK_INT_FAIL(CODA_READDIR_STATS);
1490 * If directory is not already open do an "internal open" on it.
1492 * XXX: Why would this happen? For files, there's memory mapping,
1493 * execution, and other kernel access paths such as ktrace. For
1494 * directories, it is less clear.
1496 if (cp->c_ovp == NULL) {
1497 opened_internally = 1;
1498 MARK_INT_GEN(CODA_OPEN_STATS);
1499 error = VOP_OPEN(vp, FREAD, cred, td, NULL);
1500 printf("coda_readdir: Internally Opening %p\n", vp);
1502 printf("coda_readdir: VOP_OPEN on container failed "
1509 * Have UFS handle the call.
1511 CODADEBUG(CODA_READDIR, myprintf(("indirect readdir: fid = %s, "
1512 "refcnt = %d\n", coda_f2s(&cp->c_fid), vp->v_usecount)););
1513 vn_lock(cp->c_ovp, LK_SHARED | LK_RETRY, td);
1514 error = VOP_READDIR(cp->c_ovp, uiop, cred, eofflag, ncookies,
1516 VOP_UNLOCK(cp->c_ovp, 0, td);
1518 MARK_INT_FAIL(CODA_READDIR_STATS);
1520 MARK_INT_SAT(CODA_READDIR_STATS);
1523 * Do an "internal close" if necessary.
1525 if (opened_internally) {
1526 MARK_INT_GEN(CODA_CLOSE_STATS);
1527 (void)VOP_CLOSE(vp, FREAD, cred, td);
1533 coda_reclaim(struct vop_reclaim_args *ap)
1536 struct vnode *vp = ap->a_vp;
1537 struct cnode *cp = VTOC(vp);
1542 * Forced unmount/flush will let vnodes with non-zero use be
1547 if (IS_UNMOUNTING(cp)) {
1549 if (VTOC(vp)->c_ovp) {
1550 if (IS_UNMOUNTING(cp))
1551 printf("coda_reclaim: c_ovp not void: vp "
1552 "%p, cp %p\n", vp, cp);
1556 if (prtactive && vp->v_usecount != 0)
1557 vprint("coda_reclaim: pushing active", vp);
1560 coda_free(VTOC(vp));
1562 vp->v_object = NULL;
1567 coda_lock(struct vop_lock1_args *ap)
1570 struct vnode *vp = ap->a_vp;
1571 struct cnode *cp = VTOC(vp);
1576 if ((ap->a_flags & LK_INTERLOCK) == 0) {
1578 ap->a_flags |= LK_INTERLOCK;
1581 myprintf(("Attempting lock on %s\n", coda_f2s(&cp->c_fid)));
1582 return (vop_stdlock(ap));
1586 coda_unlock(struct vop_unlock_args *ap)
1589 struct vnode *vp = ap->a_vp;
1590 struct cnode *cp = VTOC(vp);
1596 myprintf(("Attempting unlock on %s\n",
1597 coda_f2s(&cp->c_fid)));
1598 return (vop_stdunlock(ap));
1602 coda_islocked(struct vop_islocked_args *ap)
1607 return (vop_stdislocked(ap));
1611 coda_print_vattr(struct vattr *attr)
1615 switch (attr->va_type) {
1656 myprintf(("attr: type %s mode %d uid %d gid %d fsid %d rdev %d\n",
1657 typestr, (int)attr->va_mode, (int)attr->va_uid,
1658 (int)attr->va_gid, (int)attr->va_fsid, (int)attr->va_rdev));
1659 myprintf((" fileid %d nlink %d size %d blocksize %d bytes %d\n",
1660 (int)attr->va_fileid, (int)attr->va_nlink, (int)attr->va_size,
1661 (int)attr->va_blocksize,(int)attr->va_bytes));
1662 myprintf((" gen %ld flags %ld vaflags %d\n", attr->va_gen,
1663 attr->va_flags, attr->va_vaflags));
1664 myprintf((" atime sec %d nsec %d\n", (int)attr->va_atime.tv_sec,
1665 (int)attr->va_atime.tv_nsec));
1666 myprintf((" mtime sec %d nsec %d\n", (int)attr->va_mtime.tv_sec,
1667 (int)attr->va_mtime.tv_nsec));
1668 myprintf((" ctime sec %d nsec %d\n", (int)attr->va_ctime.tv_sec,
1669 (int)attr->va_ctime.tv_nsec));
1673 * How to print a ucred.
1676 coda_print_cred(struct ucred *cred)
1680 myprintf(("ref %d\tuid %d\n",cred->cr_ref,cred->cr_uid));
1681 for (i=0; i < cred->cr_ngroups; i++)
1682 myprintf(("\tgroup %d: (%d)\n",i,cred->cr_groups[i]));
1687 * Return a vnode for the given fid. If no cnode exists for this fid create
1688 * one and put it in a table hashed by coda_f2i(). If the cnode for this fid
1689 * is already in the table return it (ref count is incremented by coda_find.
1690 * The cnode will be flushed from the table when coda_inactive calls
1694 make_coda_node(CodaFid *fid, struct mount *vfsp, short type)
1701 * XXXRW: This really needs a moderate amount of reworking. We need
1702 * to properly tolerate failures of getnewvnode() and insmntque(),
1703 * and callers need to be able to accept an error back from
1704 * make_coda_node. There may also be more general issues in how we
1705 * handle forced unmount. Finally, if/when Coda loses its dependency
1706 * on Giant, the ordering of this needs rethinking.
1708 cp = coda_find(fid);
1715 err = getnewvnode("coda", vfsp, &coda_vnodeops, &vp);
1717 panic("coda: getnewvnode returned error %d\n", err);
1722 err = insmntque(vp, vfsp);
1724 printf("coda: insmntque failed: error %d", err);
1729 coda_pathconf(struct vop_pathconf_args *ap)
1732 switch (ap->a_name) {
1734 *ap->a_retval = CODA_MAXNAMLEN;
1738 *ap->a_retval = CODA_MAXPATHLEN;
1742 return (vop_stdpathconf(ap));