diff options
author | tjr <tjr@FreeBSD.org> | 2003-09-07 07:43:10 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2003-09-07 07:43:10 +0000 |
commit | ffc45a6f38ccebcfc3c288c480c7d4b50ce07097 (patch) | |
tree | c3cf2ae6864b0278a40f0dfa5991f2f8900c75eb /sys/fs/coda/coda_vfsops.c | |
parent | 0e8da904ef6c53f55935dad56701ad688b7b737c (diff) | |
download | FreeBSD-src-ffc45a6f38ccebcfc3c288c480c7d4b50ce07097.zip FreeBSD-src-ffc45a6f38ccebcfc3c288c480c7d4b50ce07097.tar.gz |
Add support for the Coda 6.x venus<->kernel interface. This extends
FIDs to be 128-bits wide and adds support for realms.
Add a new CODA_COMPAT_5 option, which requests support for the old
Coda 5.x interface instead of the new one.
Create a new coda5.ko module that supports the 5.x interface, and make
the existing coda.ko module use the new 6.x interface. These modules
cannot both be loaded at the same time.
Obtained from: Jan Harkes & the coda-6.0.2 distribution,
NetBSD (drochner) (CODA_COMPAT_5 option).
Diffstat (limited to 'sys/fs/coda/coda_vfsops.c')
-rw-r--r-- | sys/fs/coda/coda_vfsops.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/sys/fs/coda/coda_vfsops.c b/sys/fs/coda/coda_vfsops.c index 3c326bd..fff32303 100644 --- a/sys/fs/coda/coda_vfsops.c +++ b/sys/fs/coda/coda_vfsops.c @@ -117,8 +117,8 @@ coda_mount(vfsp, path, data, ndp, td) dev_t dev; struct coda_mntinfo *mi; struct vnode *rootvp; - ViceFid rootfid; - ViceFid ctlfid; + CodaFid rootfid = INVAL_FID; + CodaFid ctlfid = CTL_FID; int error; ENTRY; @@ -187,16 +187,10 @@ coda_mount(vfsp, path, data, ndp, td) * actually make the CODA_ROOT call to venus until the first call * to coda_root in case a server is down while venus is starting. */ - rootfid.Volume = 0; - rootfid.Vnode = 0; - rootfid.Unique = 0; cp = make_coda_node(&rootfid, vfsp, VDIR); rootvp = CTOV(cp); rootvp->v_vflag |= VV_ROOT; - ctlfid.Volume = CTL_VOL; - ctlfid.Vnode = CTL_VNO; - ctlfid.Unique = CTL_UNI; /* cp = make_coda_node(&ctlfid, vfsp, VCHR); The above code seems to cause a loop in the cnode links. I don't totally understand when it happens, it is caught @@ -255,7 +249,6 @@ coda_unmount(vfsp, mntflags, td) printf("coda_unmount: ROOT: vp %p, cp %p\n", mi->mi_rootvp, VTOC(mi->mi_rootvp)); #endif vrele(mi->mi_rootvp); - active = coda_kill(vfsp, NOT_DOWNCALL); ASSERT_VOP_LOCKED(mi->mi_rootvp, "coda_unmount"); mi->mi_rootvp->v_vflag &= ~VV_ROOT; @@ -294,7 +287,8 @@ coda_root(vfsp, vpp) int error; struct thread *td = curthread; /* XXX - bnoble */ struct proc *p = td->td_proc; - ViceFid VFid; + CodaFid VFid; + static const CodaFid invalfid = INVAL_FID; ENTRY; MARK_ENTRY(CODA_ROOT_STATS); @@ -312,10 +306,8 @@ coda_root(vfsp, vpp) * node to avoid a deadlock. This bug is fixed in the Coda CVS * repository but not in any released versions as of 6 Mar 2003. */ - if ((VTOC(mi->mi_rootvp)->c_fid.Volume != 0) || - (VTOC(mi->mi_rootvp)->c_fid.Vnode != 0) || - (VTOC(mi->mi_rootvp)->c_fid.Unique != 0) || - mi->mi_started == 0) + if (memcmp(&VTOC(mi->mi_rootvp)->c_fid, &invalfid, + sizeof(CodaFid)) != 0 || mi->mi_started == 0) { /* Found valid root. */ *vpp = mi->mi_rootvp; /* On Mach, this is vref. On NetBSD, VOP_LOCK */ @@ -469,7 +461,7 @@ coda_fhtovp(vfsp, fhp, nam, vpp, exflagsp, creadanonp) int error; struct thread *td = curthread; /* XXX -mach */ struct proc *p = td->td_proc; - ViceFid VFid; + CodaFid VFid; int vtype; ENTRY; @@ -490,9 +482,8 @@ coda_fhtovp(vfsp, fhp, nam, vpp, exflagsp, creadanonp) *vpp = (struct vnode *)0; } else { CODADEBUG(CODA_VGET, - myprintf(("vget: vol %lx vno %lx uni %lx type %d result %d\n", - VFid.Volume, VFid.Vnode, VFid.Unique, vtype, error)); ) - + myprintf(("vget: %s type %d result %d\n", + coda_f2s(&VFid), vtype, error)); ) cp = make_coda_node(&VFid, vfsp, vtype); *vpp = CTOV(cp); } @@ -514,7 +505,7 @@ getNewVnode(vpp) ENTRY; - cfid.cfid_len = (short)sizeof(ViceFid); + cfid.cfid_len = (short)sizeof(CodaFid); cfid.cfid_fid = VTOC(*vpp)->c_fid; /* Structure assignment. */ /* XXX ? */ |