diff options
author | rvb <rvb@FreeBSD.org> | 1998-09-11 18:50:17 +0000 |
---|---|---|
committer | rvb <rvb@FreeBSD.org> | 1998-09-11 18:50:17 +0000 |
commit | 918e3ab49af89b663522d5ef2f6ca6710a51f835 (patch) | |
tree | 11ae18c8d0b66afd40d389b6c6a1f6fcad53d002 /sys/fs/coda/coda_vfsops.c | |
parent | aac5469d30c451307f3e3a8b2356165d289e444a (diff) | |
download | FreeBSD-src-918e3ab49af89b663522d5ef2f6ca6710a51f835.zip FreeBSD-src-918e3ab49af89b663522d5ef2f6ca6710a51f835.tar.gz |
All the references to cfs, in symbols, structs, and strings
have been changed to coda. (Same for CFS.)
Diffstat (limited to 'sys/fs/coda/coda_vfsops.c')
-rw-r--r-- | sys/fs/coda/coda_vfsops.c | 220 |
1 files changed, 110 insertions, 110 deletions
diff --git a/sys/fs/coda/coda_vfsops.c b/sys/fs/coda/coda_vfsops.c index 0831e17..0abddd3 100644 --- a/sys/fs/coda/coda_vfsops.c +++ b/sys/fs/coda/coda_vfsops.c @@ -26,8 +26,8 @@ * improvements or extensions that they make, and to grant Carnegie * Mellon the rights to redistribute these changes without encumbrance. * - * @(#) src/sys/cfs/cfs_vfsops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ - * $Id: cfs_vfsops.c,v 1.2 1998/09/02 19:09:53 rvb Exp $ + * @(#) src/sys/cfs/coda_vfsops.c,v 1.1.1.1 1998/08/29 21:14:52 rvb Exp $ + * $Id: coda_vfsops.c,v 1.2 1998/09/02 19:09:53 rvb Exp $ * */ @@ -46,7 +46,7 @@ /* * HISTORY - * $Log: cfs_vfsops.c,v $ + * $Log: coda_vfsops.c,v $ * Revision 1.2 1998/09/02 19:09:53 rvb * Pass2 complete * @@ -69,13 +69,13 @@ * Fixes up mainly to flush iopen and friends * * Revision 1.7 98/01/23 11:53:45 rvb - * Bring RVB_CFS1_1 to HEAD + * Bring RVB_CODA1_1 to HEAD * * Revision 1.6.2.6 98/01/23 11:21:07 rvb * Sync with 2.2.5 * * Revision 1.6.2.5 98/01/22 13:05:33 rvb - * Move makecfsnode ctlfid later so vfsp is known + * Move make_coda_node ctlfid later so vfsp is known * * Revision 1.6.2.4 97/12/19 14:26:05 rvb * session id @@ -96,7 +96,7 @@ * Final cfs_venus.c w/o macros, but one locking bug * * Revision 1.5.14.7 97/11/21 13:22:03 rvb - * Catch a few cfscalls in cfs_vfsops.c + * Catch a few coda_calls in coda_vfsops.c * * Revision 1.5.14.6 97/11/20 11:46:48 rvb * Capture current cfs_venus @@ -134,7 +134,7 @@ * Added support for Coda MiniCache and raw inode calls (final commit) * * Revision 1.1.2.1 1995/12/20 01:57:32 bnoble - * Added CFS-specific files + * Added CODA-specific files * * Revision 3.1.1.1 1995/03/04 19:08:02 bnoble * Branch for NetBSD port revisions @@ -162,7 +162,7 @@ * merge kernel/latest and alpha/src/cfs * * Revision 2.3 92/09/30 14:16:32 mja - * Added call to cfs_flush to cfs_unmount. + * Added call to coda_flush to coda_unmount. * [90/12/15 dcs] * * Added contributors blurb. @@ -177,7 +177,7 @@ * * */ -#include <vcfs.h> +#include <vcoda.h> #include <sys/param.h> #include <sys/systm.h> @@ -198,56 +198,56 @@ #include <miscfs/specfs/specdev.h> -MALLOC_DEFINE(M_CFS, "CFS storage", "Various Coda Structures"); +MALLOC_DEFINE(M_CODA, "CODA storage", "Various Coda Structures"); -int cfsdebug = 0; -int cfs_vfsop_print_entry = 0; -#define ENTRY if(cfs_vfsop_print_entry) myprintf(("Entered %s\n",__FUNCTION__)) +int codadebug = 0; +int coda_vfsop_print_entry = 0; +#define ENTRY if(coda_vfsop_print_entry) myprintf(("Entered %s\n",__FUNCTION__)) -struct vnode *cfs_ctlvp; -struct cfs_mntinfo cfs_mnttbl[NVCFS]; /* indexed by minor device number */ +struct vnode *coda_ctlvp; +struct coda_mntinfo coda_mnttbl[NVCODA]; /* indexed by minor device number */ /* structure to keep statistics of internally generated/satisfied calls */ -struct cfs_op_stats cfs_vfsopstats[CFS_VFSOPS_SIZE]; +struct coda_op_stats coda_vfsopstats[CODA_VFSOPS_SIZE]; -#define MARK_ENTRY(op) (cfs_vfsopstats[op].entries++) -#define MARK_INT_SAT(op) (cfs_vfsopstats[op].sat_intrn++) -#define MARK_INT_FAIL(op) (cfs_vfsopstats[op].unsat_intrn++) -#define MRAK_INT_GEN(op) (cfs_vfsopstats[op].gen_intrn++) +#define MARK_ENTRY(op) (coda_vfsopstats[op].entries++) +#define MARK_INT_SAT(op) (coda_vfsopstats[op].sat_intrn++) +#define MARK_INT_FAIL(op) (coda_vfsopstats[op].unsat_intrn++) +#define MRAK_INT_GEN(op) (coda_vfsopstats[op].gen_intrn++) -extern int cfsnc_initialized; /* Set if cache has been initialized */ +extern int coda_nc_initialized; /* Set if cache has been initialized */ extern int vc_nb_open __P((dev_t, int, int, struct proc *)); -struct vfsops cfs_vfsops = { - cfs_mount, - cfs_start, - cfs_unmount, - cfs_root, - cfs_quotactl, - cfs_nb_statfs, - cfs_sync, - cfs_vget, +struct vfsops coda_vfsops = { + coda_mount, + coda_start, + coda_unmount, + coda_root, + coda_quotactl, + coda_nb_statfs, + coda_sync, + coda_vget, (int (*) (struct mount *, struct fid *, struct sockaddr *, struct vnode **, int *, struct ucred **)) eopnotsupp, (int (*) (struct vnode *, struct fid *)) eopnotsupp, - cfs_init, + coda_init, }; -VFS_SET(cfs_vfsops, cfs, VFCF_NETWORK); +VFS_SET(coda_vfsops, coda, VFCF_NETWORK); int -cfs_vfsopstats_init(void) +coda_vfsopstats_init(void) { register int i; - for (i=0;i<CFS_VFSOPS_SIZE;i++) { - cfs_vfsopstats[i].opcode = i; - cfs_vfsopstats[i].entries = 0; - cfs_vfsopstats[i].sat_intrn = 0; - cfs_vfsopstats[i].unsat_intrn = 0; - cfs_vfsopstats[i].gen_intrn = 0; + for (i=0;i<CODA_VFSOPS_SIZE;i++) { + coda_vfsopstats[i].opcode = i; + coda_vfsopstats[i].entries = 0; + coda_vfsopstats[i].sat_intrn = 0; + coda_vfsopstats[i].unsat_intrn = 0; + coda_vfsopstats[i].gen_intrn = 0; } return 0; @@ -259,7 +259,7 @@ cfs_vfsopstats_init(void) */ /*ARGSUSED*/ int -cfs_mount(vfsp, path, data, ndp, p) +coda_mount(vfsp, path, data, ndp, p) struct mount *vfsp; /* Allocated and initialized by mount(2) */ char *path; /* path covered: ignored by the fs-layer */ caddr_t data; /* Need to define a data type for this in netbsd? */ @@ -269,7 +269,7 @@ cfs_mount(vfsp, path, data, ndp, p) struct vnode *dvp; struct cnode *cp; dev_t dev; - struct cfs_mntinfo *mi; + struct coda_mntinfo *mi; struct vnode *rootvp; ViceFid rootfid; ViceFid ctlfid; @@ -277,12 +277,12 @@ cfs_mount(vfsp, path, data, ndp, p) ENTRY; - cfs_vfsopstats_init(); - cfs_vnodeopstats_init(); + coda_vfsopstats_init(); + coda_vnodeopstats_init(); - MARK_ENTRY(CFS_MOUNT_STATS); - if (CFS_MOUNTED(vfsp)) { - MARK_INT_FAIL(CFS_MOUNT_STATS); + MARK_ENTRY(CODA_MOUNT_STATS); + if (CODA_MOUNTED(vfsp)) { + MARK_INT_FAIL(CODA_MOUNT_STATS); return(EBUSY); } @@ -293,18 +293,18 @@ cfs_mount(vfsp, path, data, ndp, p) dvp = ndp->ni_vp; if (error) { - MARK_INT_FAIL(CFS_MOUNT_STATS); + MARK_INT_FAIL(CODA_MOUNT_STATS); return (error); } if (dvp->v_type != VCHR) { - MARK_INT_FAIL(CFS_MOUNT_STATS); + MARK_INT_FAIL(CODA_MOUNT_STATS); vrele(dvp); return(ENXIO); } dev = dvp->v_specinfo->si_rdev; vrele(dvp); if (major(dev) >= nchrdev || major(dev) < 0) { - MARK_INT_FAIL(CFS_MOUNT_STATS); + MARK_INT_FAIL(CODA_MOUNT_STATS); return(ENXIO); } @@ -313,22 +313,22 @@ cfs_mount(vfsp, path, data, ndp, p) */ if (cdevsw[major(dev)]->d_open != vc_nb_open) { - MARK_INT_FAIL(CFS_MOUNT_STATS); + MARK_INT_FAIL(CODA_MOUNT_STATS); return(ENXIO); } - if (minor(dev) >= NVCFS || minor(dev) < 0) { - MARK_INT_FAIL(CFS_MOUNT_STATS); + if (minor(dev) >= NVCODA || minor(dev) < 0) { + MARK_INT_FAIL(CODA_MOUNT_STATS); return(ENXIO); } /* * Initialize the mount record and link it to the vfs struct */ - mi = &cfs_mnttbl[minor(dev)]; + mi = &coda_mnttbl[minor(dev)]; if (!VC_OPEN(&mi->mi_vcomm)) { - MARK_INT_FAIL(CFS_MOUNT_STATS); + MARK_INT_FAIL(CODA_MOUNT_STATS); return(ENODEV); } @@ -340,27 +340,27 @@ cfs_mount(vfsp, path, data, ndp, p) /* * Make a root vnode to placate the Vnode interface, but don't - * actually make the CFS_ROOT call to venus until the first call - * to cfs_root in case a server is down while venus is starting. + * 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 = makecfsnode(&rootfid, vfsp, VDIR); + cp = make_coda_node(&rootfid, vfsp, VDIR); rootvp = CTOV(cp); rootvp->v_flag |= VROOT; ctlfid.Volume = CTL_VOL; ctlfid.Vnode = CTL_VNO; ctlfid.Unique = CTL_UNI; -/* cp = makecfsnode(&ctlfid, vfsp, VCHR); +/* 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 when closing down the system. */ - cp = makecfsnode(&ctlfid, 0, VCHR); + cp = make_coda_node(&ctlfid, 0, VCHR); - cfs_ctlvp = CTOV(cp); + coda_ctlvp = CTOV(cp); /* Add vfs and rootvp to chain of vfs hanging off mntinfo */ mi->mi_vfsp = vfsp; @@ -377,18 +377,18 @@ cfs_mount(vfsp, path, data, ndp, p) /* error is currently guaranteed to be zero, but in case some code changes... */ - CFSDEBUG(1, - myprintf(("cfs_mount returned %d\n",error));); + CODADEBUG(1, + myprintf(("coda_mount returned %d\n",error));); if (error) - MARK_INT_FAIL(CFS_MOUNT_STATS); + MARK_INT_FAIL(CODA_MOUNT_STATS); else - MARK_INT_SAT(CFS_MOUNT_STATS); + MARK_INT_SAT(CODA_MOUNT_STATS); return(error); } int -cfs_start(vfsp, flags, p) +coda_start(vfsp, flags, p) struct mount *vfsp; int flags; struct proc *p; @@ -398,18 +398,18 @@ cfs_start(vfsp, flags, p) } int -cfs_unmount(vfsp, mntflags, p) +coda_unmount(vfsp, mntflags, p) struct mount *vfsp; int mntflags; struct proc *p; { - struct cfs_mntinfo *mi = vftomi(vfsp); + struct coda_mntinfo *mi = vftomi(vfsp); int active, error = 0; ENTRY; - MARK_ENTRY(CFS_UMOUNT_STATS); - if (!CFS_MOUNTED(vfsp)) { - MARK_INT_FAIL(CFS_UMOUNT_STATS); + MARK_ENTRY(CODA_UMOUNT_STATS); + if (!CODA_MOUNTED(vfsp)) { + MARK_INT_FAIL(CODA_UMOUNT_STATS); return(EINVAL); } @@ -418,13 +418,13 @@ cfs_unmount(vfsp, mntflags, p) return (EBUSY); /* Venus is still running */ #ifdef DEBUG - printf("cfs_unmount: ROOT: vp %p, cp %p\n", mi->mi_rootvp, VTOC(mi->mi_rootvp)); + printf("coda_unmount: ROOT: vp %p, cp %p\n", mi->mi_rootvp, VTOC(mi->mi_rootvp)); #endif vrele(mi->mi_rootvp); - active = cfs_kill(vfsp, NOT_DOWNCALL); + active = coda_kill(vfsp, NOT_DOWNCALL); error = vflush(mi->mi_vfsp, NULLVP, FORCECLOSE); - printf("cfs_unmount: active = %d, vflush active %d\n", active, error); + printf("coda_unmount: active = %d, vflush active %d\n", active, error); error = 0; /* I'm going to take this out to allow lookups to go through. I'm * not sure it's important anyway. -- DCS 2/2/94 @@ -436,9 +436,9 @@ cfs_unmount(vfsp, mntflags, p) mi->mi_rootvp = NULL; if (error) - MARK_INT_FAIL(CFS_UMOUNT_STATS); + MARK_INT_FAIL(CODA_UMOUNT_STATS); else - MARK_INT_SAT(CFS_UMOUNT_STATS); + MARK_INT_SAT(CODA_UMOUNT_STATS); return(error); } @@ -449,18 +449,18 @@ cfs_unmount(vfsp, mntflags, p) * find root of cfs */ int -cfs_root(vfsp, vpp) +coda_root(vfsp, vpp) struct mount *vfsp; struct vnode **vpp; { - struct cfs_mntinfo *mi = vftomi(vfsp); + struct coda_mntinfo *mi = vftomi(vfsp); struct vnode **result; int error; struct proc *p = curproc; /* XXX - bnoble */ ViceFid VFid; ENTRY; - MARK_ENTRY(CFS_ROOT_STATS); + MARK_ENTRY(CODA_ROOT_STATS); result = NULL; if (vfsp == mi->mi_vfsp) { @@ -476,7 +476,7 @@ cfs_root(vfsp, vpp) #else vget(*vpp, LK_EXCLUSIVE, p); #endif - MARK_INT_SAT(CFS_ROOT_STATS); + MARK_INT_SAT(CODA_ROOT_STATS); return(0); } } @@ -488,9 +488,9 @@ cfs_root(vfsp, vpp) * Save the new rootfid in the cnode, and rehash the cnode into the * cnode hash with the new fid key. */ - cfs_unsave(VTOC(mi->mi_rootvp)); + coda_unsave(VTOC(mi->mi_rootvp)); VTOC(mi->mi_rootvp)->c_fid = VFid; - cfs_save(VTOC(mi->mi_rootvp)); + coda_save(VTOC(mi->mi_rootvp)); *vpp = mi->mi_rootvp; #if 1 @@ -500,16 +500,16 @@ cfs_root(vfsp, vpp) vget(*vpp, LK_EXCLUSIVE, p); #endif - MARK_INT_SAT(CFS_ROOT_STATS); + MARK_INT_SAT(CODA_ROOT_STATS); goto exit; } else if (error == ENODEV) { /* Gross hack here! */ /* - * If Venus fails to respond to the CFS_ROOT call, cfscall returns + * If Venus fails to respond to the CODA_ROOT call, coda_call returns * ENODEV. Return the uninitialized root vnode to allow vfs * operations such as unmount to continue. Without this hack, * there is no way to do an unmount if Venus dies before a - * successful CFS_ROOT call is done. All vnode operations + * successful CODA_ROOT call is done. All vnode operations * will fail. */ *vpp = mi->mi_rootvp; @@ -520,12 +520,12 @@ cfs_root(vfsp, vpp) vget(*vpp, LK_EXCLUSIVE, p); #endif - MARK_INT_FAIL(CFS_ROOT_STATS); + MARK_INT_FAIL(CODA_ROOT_STATS); error = 0; goto exit; } else { - CFSDEBUG( CFS_ROOT, myprintf(("error %d in CFS_ROOT\n", error)); ); - MARK_INT_FAIL(CFS_ROOT_STATS); + CODADEBUG( CODA_ROOT, myprintf(("error %d in CODA_ROOT\n", error)); ); + MARK_INT_FAIL(CODA_ROOT_STATS); goto exit; } @@ -535,7 +535,7 @@ cfs_root(vfsp, vpp) } int -cfs_quotactl(vfsp, cmd, uid, arg, p) +coda_quotactl(vfsp, cmd, uid, arg, p) struct mount *vfsp; int cmd; uid_t uid; @@ -550,15 +550,15 @@ cfs_quotactl(vfsp, cmd, uid, arg, p) * Get file system statistics. */ int -cfs_nb_statfs(vfsp, sbp, p) +coda_nb_statfs(vfsp, sbp, p) register struct mount *vfsp; struct statfs *sbp; struct proc *p; { ENTRY; -/* MARK_ENTRY(CFS_STATFS_STATS); */ - if (!CFS_MOUNTED(vfsp)) { -/* MARK_INT_FAIL(CFS_STATFS_STATS);*/ +/* MARK_ENTRY(CODA_STATFS_STATS); */ + if (!CODA_MOUNTED(vfsp)) { +/* MARK_INT_FAIL(CODA_STATFS_STATS);*/ return(EINVAL); } @@ -579,8 +579,8 @@ cfs_nb_statfs(vfsp, sbp, p) sbp->f_ffree = NB_SFS_SIZ; bcopy((caddr_t)&(vfsp->mnt_stat.f_fsid), (caddr_t)&(sbp->f_fsid), sizeof (fsid_t)); strcpy(sbp->f_mntonname, "/coda"); - strcpy(sbp->f_mntfromname, "CFS"); -/* MARK_INT_SAT(CFS_STATFS_STATS); */ + strcpy(sbp->f_mntfromname, "CODA"); +/* MARK_INT_SAT(CODA_STATFS_STATS); */ return(0); } @@ -588,20 +588,20 @@ cfs_nb_statfs(vfsp, sbp, p) * Flush any pending I/O. */ int -cfs_sync(vfsp, waitfor, cred, p) +coda_sync(vfsp, waitfor, cred, p) struct mount *vfsp; int waitfor; struct ucred *cred; struct proc *p; { ENTRY; - MARK_ENTRY(CFS_SYNC_STATS); - MARK_INT_SAT(CFS_SYNC_STATS); + MARK_ENTRY(CODA_SYNC_STATS); + MARK_INT_SAT(CODA_SYNC_STATS); return(0); } int -cfs_vget(vfsp, ino, vpp) +coda_vget(vfsp, ino, vpp) struct mount *vfsp; ino_t ino; struct vnode **vpp; @@ -616,7 +616,7 @@ cfs_vget(vfsp, ino, vpp) * a type-specific fid. */ int -cfs_fhtovp(vfsp, fhp, nam, vpp, exflagsp, creadanonp) +coda_fhtovp(vfsp, fhp, nam, vpp, exflagsp, creadanonp) register struct mount *vfsp; struct fid *fhp; struct mbuf *nam; @@ -633,33 +633,33 @@ cfs_fhtovp(vfsp, fhp, nam, vpp, exflagsp, creadanonp) ENTRY; - MARK_ENTRY(CFS_VGET_STATS); + MARK_ENTRY(CODA_VGET_STATS); /* Check for vget of control object. */ if (IS_CTL_FID(&cfid->cfid_fid)) { - *vpp = cfs_ctlvp; - vref(cfs_ctlvp); - MARK_INT_SAT(CFS_VGET_STATS); + *vpp = coda_ctlvp; + vref(coda_ctlvp); + MARK_INT_SAT(CODA_VGET_STATS); return(0); } error = venus_fhtovp(vftomi(vfsp), &cfid->cfid_fid, p->p_cred->pc_ucred, p, &VFid, &vtype); if (error) { - CFSDEBUG(CFS_VGET, myprintf(("vget error %d\n",error));) + CODADEBUG(CODA_VGET, myprintf(("vget error %d\n",error));) *vpp = (struct vnode *)0; } else { - CFSDEBUG(CFS_VGET, + CODADEBUG(CODA_VGET, myprintf(("vget: vol %lx vno %lx uni %lx type %d result %d\n", VFid.Volume, VFid.Vnode, VFid.Unique, vtype, error)); ) - cp = makecfsnode(&VFid, vfsp, vtype); + cp = make_coda_node(&VFid, vfsp, vtype); *vpp = CTOV(cp); } return(error); } int -cfs_vptofh(vnp, fidp) +coda_vptofh(vnp, fidp) struct vnode *vnp; struct fid *fidp; { @@ -668,7 +668,7 @@ cfs_vptofh(vnp, fidp) } int -cfs_init(struct vfsconf *vfsp) +coda_init(struct vfsconf *vfsp) { ENTRY; return 0; @@ -685,7 +685,7 @@ getNewVnode(vpp) struct vnode **vpp; { struct cfid cfid; - struct cfs_mntinfo *mi = vftomi((*vpp)->v_mount); + struct coda_mntinfo *mi = vftomi((*vpp)->v_mount); ENTRY; @@ -699,7 +699,7 @@ getNewVnode(vpp) if (mi->mi_vfsp == NULL) return ENODEV; - return cfs_fhtovp(mi->mi_vfsp, (struct fid*)&cfid, NULL, vpp, + return coda_fhtovp(mi->mi_vfsp, (struct fid*)&cfid, NULL, vpp, NULL, NULL); } |