summaryrefslogtreecommitdiffstats
path: root/sys/coda/coda_vnops.c
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2003-09-07 07:43:10 +0000
committertjr <tjr@FreeBSD.org>2003-09-07 07:43:10 +0000
commitffc45a6f38ccebcfc3c288c480c7d4b50ce07097 (patch)
treec3cf2ae6864b0278a40f0dfa5991f2f8900c75eb /sys/coda/coda_vnops.c
parent0e8da904ef6c53f55935dad56701ad688b7b737c (diff)
downloadFreeBSD-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/coda/coda_vnops.c')
-rw-r--r--sys/coda/coda_vnops.c103
1 files changed, 44 insertions, 59 deletions
diff --git a/sys/coda/coda_vnops.c b/sys/coda/coda_vnops.c
index 8e44455..a1d24e9 100644
--- a/sys/coda/coda_vnops.c
+++ b/sys/coda/coda_vnops.c
@@ -489,10 +489,8 @@ printf("coda_rdwr: Internally Opening %p\n", vp);
}
/* Have UFS handle the call. */
- CODADEBUG(CODA_RDWR, myprintf(("indirect rdwr: fid = (%lx.%lx.%lx), refcnt = %d\n",
- cp->c_fid.Volume, cp->c_fid.Vnode,
- cp->c_fid.Unique, vrefcnt(CTOV(cp)))); )
-
+ CODADEBUG(CODA_RDWR, myprintf(("indirect rdwr: fid = %s, refcnt = %d\n",
+ coda_f2s(&cp->c_fid), CTOV(cp)->v_usecount)); )
if (rw == UIO_READ) {
error = VOP_READ(cfvp, uiop, ioflag, cred);
} else {
@@ -639,10 +637,8 @@ coda_getattr(v)
/* Check to see if the attributes have already been cached */
if (VALID_VATTR(cp)) {
- CODADEBUG(CODA_GETATTR, { myprintf(("attr cache hit: (%lx.%lx.%lx)\n",
- cp->c_fid.Volume,
- cp->c_fid.Vnode,
- cp->c_fid.Unique));});
+ CODADEBUG(CODA_GETATTR, { myprintf(("attr cache hit: %s\n",
+ coda_f2s(&cp->c_fid)));});
CODADEBUG(CODA_GETATTR, if (!(codadebug & ~CODA_GETATTR))
print_vattr(&cp->c_vattr); );
@@ -654,11 +650,8 @@ coda_getattr(v)
error = venus_getattr(vtomi(vp), &cp->c_fid, cred, td->td_proc, vap);
if (!error) {
- CODADEBUG(CODA_GETATTR, myprintf(("getattr miss (%lx.%lx.%lx): result %d\n",
- cp->c_fid.Volume,
- cp->c_fid.Vnode,
- cp->c_fid.Unique,
- error)); )
+ CODADEBUG(CODA_GETATTR, myprintf(("getattr miss %s: result %d\n",
+ coda_f2s(&cp->c_fid), error)); )
CODADEBUG(CODA_GETATTR, if (!(codadebug & ~CODA_GETATTR))
print_vattr(vap); );
@@ -905,10 +898,9 @@ coda_inactive(v)
return 0;
}
- CODADEBUG(CODA_INACTIVE, myprintf(("in inactive, %lx.%lx.%lx. vfsp %p\n",
- cp->c_fid.Volume, cp->c_fid.Vnode,
- cp->c_fid.Unique, vp->v_mount));)
-
+ CODADEBUG(CODA_INACTIVE, myprintf(("in inactive, %s, vfsp %p\n",
+ coda_f2s(&cp->c_fid), vp->v_mount));)
+
/* If an array has been allocated to hold the symlink, deallocate it */
if ((coda_symlink_cache) && (VALID_SYMLINK(cp))) {
if (cp->c_symlink == NULL)
@@ -980,15 +972,14 @@ coda_lookup(v)
struct cnode *cp;
const char *nm = cnp->cn_nameptr;
int len = cnp->cn_namelen;
- ViceFid VFid;
+ CodaFid VFid;
int vtype;
int error = 0;
MARK_ENTRY(CODA_LOOKUP_STATS);
- CODADEBUG(CODA_LOOKUP, myprintf(("lookup: %s in %lx.%lx.%lx\n",
- nm, dcp->c_fid.Volume,
- dcp->c_fid.Vnode, dcp->c_fid.Unique)););
+ CODADEBUG(CODA_LOOKUP, myprintf(("lookup: %s in %s\n",
+ nm, coda_f2s(&dcp->c_fid))););
/* Check for lookup of control object. */
if (IS_CTL_NAME(dvp, nm, len)) {
@@ -1000,9 +991,9 @@ coda_lookup(v)
if (len+1 > CODA_MAXNAMLEN) {
MARK_INT_FAIL(CODA_LOOKUP_STATS);
- CODADEBUG(CODA_LOOKUP, myprintf(("name too long: lookup, %lx.%lx.%lx(%s)\n",
- dcp->c_fid.Volume, dcp->c_fid.Vnode,
- dcp->c_fid.Unique, nm)););
+
+ CODADEBUG(CODA_LOOKUP, myprintf(("name too long: lookup, %s (%s)\n",
+ coda_f2s(&dcp->c_fid), nm)););
*vpp = (struct vnode *)0;
error = EINVAL;
goto exit;
@@ -1022,16 +1013,15 @@ coda_lookup(v)
if (error) {
MARK_INT_FAIL(CODA_LOOKUP_STATS);
- CODADEBUG(CODA_LOOKUP, myprintf(("lookup error on %lx.%lx.%lx(%s)%d\n",
- dcp->c_fid.Volume, dcp->c_fid.Vnode, dcp->c_fid.Unique, nm, error));)
+
+ CODADEBUG(CODA_LOOKUP, myprintf(("lookup error on %s (%s)%d\n",
+ coda_f2s(&dcp->c_fid), nm, error));)
*vpp = (struct vnode *)0;
} else {
MARK_INT_SAT(CODA_LOOKUP_STATS);
CODADEBUG(CODA_LOOKUP,
- myprintf(("lookup: vol %lx vno %lx uni %lx type %o result %d\n",
- VFid.Volume, VFid.Vnode, VFid.Unique, vtype,
- error)); )
-
+ myprintf(("lookup: %s type %o result %d\n",
+ coda_f2s(&VFid), vtype, error)); )
cp = make_coda_node(&VFid, dvp->v_mount, vtype);
*vpp = CTOV(cp);
@@ -1141,7 +1131,7 @@ coda_create(v)
struct cnode *cp;
const char *nm = cnp->cn_nameptr;
int len = cnp->cn_namelen;
- ViceFid VFid;
+ CodaFid VFid;
struct vattr attr;
MARK_ENTRY(CODA_CREATE_STATS);
@@ -1186,8 +1176,8 @@ coda_create(v)
coda_nc_enter(VTOC(dvp), nm, len, cred, VTOC(*vpp));
CODADEBUG(CODA_CREATE,
- myprintf(("create: (%lx.%lx.%lx), result %d\n",
- VFid.Volume, VFid.Vnode, VFid.Unique, error)); )
+ myprintf(("create: %s, result %d\n",
+ coda_f2s(&VFid), error)); )
} else {
*vpp = (struct vnode *)0;
CODADEBUG(CODA_CREATE, myprintf(("create error %d\n", error));)
@@ -1228,10 +1218,8 @@ coda_remove(v)
MARK_ENTRY(CODA_REMOVE_STATS);
- CODADEBUG(CODA_REMOVE, myprintf(("remove: %s in %lx.%lx.%lx\n",
- nm, cp->c_fid.Volume, cp->c_fid.Vnode,
- cp->c_fid.Unique)););
-
+ CODADEBUG(CODA_REMOVE, myprintf(("remove: %s in %s\n",
+ nm, coda_f2s(&cp->c_fid))););
/* Remove the file's entry from the CODA Name Cache */
/* We're being conservative here, it might be that this person
* doesn't really have sufficient access to delete the file
@@ -1290,19 +1278,16 @@ coda_link(v)
MARK_ENTRY(CODA_LINK_STATS);
if (codadebug & CODADBGMSK(CODA_LINK)) {
-
- myprintf(("nb_link: vp fid: (%lx.%lx.%lx)\n",
- cp->c_fid.Volume, cp->c_fid.Vnode, cp->c_fid.Unique));
- myprintf(("nb_link: tdvp fid: (%lx.%lx.%lx)\n",
- tdcp->c_fid.Volume, tdcp->c_fid.Vnode, tdcp->c_fid.Unique));
-
+ myprintf(("nb_link: vp fid: %s\n",
+ coda_f2s(&cp->c_fid)));
+ myprintf(("nb_link: tdvp fid: %s)\n",
+ coda_f2s(&tdcp->c_fid)));
}
if (codadebug & CODADBGMSK(CODA_LINK)) {
- myprintf(("link: vp fid: (%lx.%lx.%lx)\n",
- cp->c_fid.Volume, cp->c_fid.Vnode, cp->c_fid.Unique));
- myprintf(("link: tdvp fid: (%lx.%lx.%lx)\n",
- tdcp->c_fid.Volume, tdcp->c_fid.Vnode, tdcp->c_fid.Unique));
-
+ myprintf(("link: vp fid: %s\n",
+ coda_f2s(&cp->c_fid)));
+ myprintf(("link: tdvp fid: %s\n",
+ coda_f2s(&tdcp->c_fid)));
}
/* Check for link to/from control object. */
@@ -1435,7 +1420,7 @@ coda_mkdir(v)
const char *nm = cnp->cn_nameptr;
int len = cnp->cn_namelen;
struct cnode *cp;
- ViceFid VFid;
+ CodaFid VFid;
struct vattr ova;
MARK_ENTRY(CODA_MKDIR_STATS);
@@ -1478,9 +1463,9 @@ coda_mkdir(v)
/* Invalidate the parent's attr cache, the modification time has changed */
VTOC(dvp)->c_flags &= ~C_VATTR;
- CODADEBUG( CODA_MKDIR, myprintf(("mkdir: (%lx.%lx.%lx) result %d\n",
- VFid.Volume, VFid.Vnode, VFid.Unique, error)); )
- } else {
+ CODADEBUG( CODA_MKDIR, myprintf(("mkdir: %s result %d\n",
+ coda_f2s(&VFid), error)); )
+ } else {
*vpp = (struct vnode *)0;
CODADEBUG(CODA_MKDIR, myprintf(("mkdir error %d\n",error));)
}
@@ -1663,7 +1648,7 @@ printf("coda_readdir: Internally Opening %p\n", vp);
}
/* Have UFS handle the call. */
- CODADEBUG(CODA_READDIR, myprintf(("indirect readdir: fid = (%lx.%lx.%lx), refcnt = %d\n",cp->c_fid.Volume, cp->c_fid.Vnode, cp->c_fid.Unique, vrefcnt(vp))); )
+ CODADEBUG(CODA_READDIR, myprintf(("indirect readdir: fid = %s, refcnt = %d\n", coda_f2s(&cp->c_fid), vp->v_usecount)); )
error = VOP_READDIR(cp->c_ovp, uiop, cred, eofflag, ncookies,
cookies);
@@ -1774,8 +1759,8 @@ coda_lock(v)
ENTRY;
if (coda_lockdebug) {
- myprintf(("Attempting lock on %lx.%lx.%lx\n",
- cp->c_fid.Volume, cp->c_fid.Vnode, cp->c_fid.Unique));
+ myprintf(("Attempting lock on %s\n",
+ coda_f2s(&cp->c_fid)));
}
#ifndef DEBUG_LOCKS
@@ -1800,8 +1785,8 @@ coda_unlock(v)
ENTRY;
if (coda_lockdebug) {
- myprintf(("Attempting unlock on %lx.%lx.%lx\n",
- cp->c_fid.Volume, cp->c_fid.Vnode, cp->c_fid.Unique));
+ myprintf(("Attempting unlock on %s\n",
+ coda_f2s(&cp->c_fid)));
}
return (lockmgr(&cp->c_lock, ap->a_flags | LK_RELEASE, &vp->v_interlock, td));
@@ -1920,14 +1905,14 @@ print_cred(cred)
/*
* Return a vnode for the given fid.
* If no cnode exists for this fid create one and put it
- * in a table hashed by fid.Volume and fid.Vnode. If the cnode for
+ * in a table hashed by coda_f2i(). If the cnode for
* this fid is already in the table return it (ref count is
* incremented by coda_find. The cnode will be flushed from the
* table when coda_inactive calls coda_unsave.
*/
struct cnode *
make_coda_node(fid, vfsp, type)
- ViceFid *fid; struct mount *vfsp; short type;
+ CodaFid *fid; struct mount *vfsp; short type;
{
struct cnode *cp;
int err;
OpenPOWER on IntegriCloud