diff options
-rw-r--r-- | sys/fs/coda/cnode.h | 3 | ||||
-rw-r--r-- | sys/fs/coda/coda_fbsd.c | 14 | ||||
-rw-r--r-- | sys/fs/coda/coda_namecache.c | 10 | ||||
-rw-r--r-- | sys/fs/coda/coda_psdev.c | 26 | ||||
-rw-r--r-- | sys/fs/coda/coda_psdev.h | 12 | ||||
-rw-r--r-- | sys/fs/coda/coda_venus.c | 3 | ||||
-rw-r--r-- | sys/fs/coda/coda_vfsops.c | 52 | ||||
-rw-r--r-- | sys/fs/coda/coda_vfsops.h | 7 | ||||
-rw-r--r-- | sys/fs/coda/coda_vnops.c | 29 | ||||
-rw-r--r-- | sys/fs/coda/coda_vnops.h | 4 |
10 files changed, 56 insertions, 104 deletions
diff --git a/sys/fs/coda/cnode.h b/sys/fs/coda/cnode.h index 414145d..6f040c0 100644 --- a/sys/fs/coda/cnode.h +++ b/sys/fs/coda/cnode.h @@ -101,7 +101,7 @@ struct cnode { struct vattr c_vattr; /* attributes */ char *c_symlink; /* pointer to symbolic link */ u_short c_symlen; /* length of symbolic link */ - struct cnode *c_next; /* links if on NetBSD machine */ + struct cnode *c_next; /* links if on FreeBSD machine */ }; #define VTOC(vp) ((struct cnode *)(vp)->v_data) #define CTOV(cp) ((struct vnode *)((cp)->c_vnode)) @@ -195,4 +195,3 @@ int coda_vnodeopstats_init(void); #define CODA_RDWR ((u_long) 31) #endif /* _CNODE_H_ */ - diff --git a/sys/fs/coda/coda_fbsd.c b/sys/fs/coda/coda_fbsd.c index bf4e10c..ab1e360 100644 --- a/sys/fs/coda/coda_fbsd.c +++ b/sys/fs/coda/coda_fbsd.c @@ -53,13 +53,13 @@ __FBSDID("$FreeBSD$"); static struct cdevsw codadevsw = { .d_version = D_VERSION, .d_flags = D_NEEDGIANT, - .d_open = vc_nb_open, - .d_close = vc_nb_close, - .d_read = vc_nb_read, - .d_write = vc_nb_write, - .d_ioctl = vc_nb_ioctl, - .d_poll = vc_nb_poll, - .d_name = "Coda", + .d_open = vc_open, + .d_close = vc_close, + .d_read = vc_read, + .d_write = vc_write, + .d_ioctl = vc_ioctl, + .d_poll = vc_poll, + .d_name = "coda", }; static eventhandler_tag clonetag; diff --git a/sys/fs/coda/coda_namecache.c b/sys/fs/coda/coda_namecache.c index af8508c..4fed042 100644 --- a/sys/fs/coda/coda_namecache.c +++ b/sys/fs/coda/coda_namecache.c @@ -203,8 +203,8 @@ coda_nc_find(dcp, name, namelen, cred, hash) printf("nref %d, nuid %d, ngid %d // oref %d, ocred %d, ogid %d\n", cred->cr_ref, cred->cr_uid, cred->cr_gid, cncp->cred->cr_ref, cncp->cred->cr_uid, cncp->cred->cr_gid); - print_cred(cred); - print_cred(cncp->cred); + coda_print_cred(cred); + coda_print_cred(cncp->cred); } #endif } @@ -421,7 +421,6 @@ coda_nc_zapParentfid(fid, dcstat) } } - /* * Remove all entries which have the same fid as the input */ @@ -459,6 +458,8 @@ coda_nc_zapfid(fid, dcstat) /* * Remove all entries which match the fid and the cred + * + * XXX: This is unused. */ void coda_nc_zapvnode(fid, cred, dcstat) @@ -477,9 +478,6 @@ coda_nc_zapvnode(fid, cred, dcstat) CODA_NC_DEBUG(CODA_NC_ZAPVNODE, myprintf(("Zapvnode: fid %s cred %p\n", coda_f2s(fid), cred)); ) - - - } /* diff --git a/sys/fs/coda/coda_psdev.c b/sys/fs/coda/coda_psdev.c index 4f9b42e..3b474cf 100644 --- a/sys/fs/coda/coda_psdev.c +++ b/sys/fs/coda/coda_psdev.c @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> +#include <sys/conf.h> #include <sys/ioccom.h> #include <sys/kernel.h> #include <sys/lock.h> @@ -87,8 +88,6 @@ int coda_pcatch = PCATCH; #define ENTRY if(coda_psdev_print_entry) myprintf(("Entered %s\n",__func__)) -void vcodaattach(int n); - struct vmsg { struct queue vm_chain; caddr_t vm_data; @@ -102,17 +101,10 @@ struct vmsg { #define VM_READ 1 #define VM_WRITE 2 -#define VM_INTR 4 - -/* vcodaattach: do nothing */ -void -vcodaattach(n) - int n; -{ -} +#define VM_INTR 4 /* Unused. */ int -vc_nb_open(dev, flag, mode, td) +vc_open(dev, flag, mode, td) struct cdev *dev; int flag; int mode; @@ -145,7 +137,7 @@ vc_nb_open(dev, flag, mode, td) } int -vc_nb_close (dev, flag, mode, td) +vc_close (dev, flag, mode, td) struct cdev *dev; int flag; int mode; @@ -226,7 +218,7 @@ vc_nb_close (dev, flag, mode, td) } int -vc_nb_read(dev, uiop, flag) +vc_read(dev, uiop, flag) struct cdev *dev; struct uio *uiop; int flag; @@ -254,7 +246,7 @@ vc_nb_read(dev, uiop, flag) #ifdef OLD_DIAGNOSTIC if (vmp->vm_chain.forw == 0 || vmp->vm_chain.back == 0) - panic("vc_nb_read: bad chain"); + panic("vc_read: bad chain"); #endif REMQUE(vmp->vm_chain); @@ -277,7 +269,7 @@ vc_nb_read(dev, uiop, flag) } int -vc_nb_write(dev, uiop, flag) +vc_write(dev, uiop, flag) struct cdev *dev; struct uio *uiop; int flag; @@ -394,7 +386,7 @@ vc_nb_write(dev, uiop, flag) } int -vc_nb_ioctl(dev, cmd, addr, flag, td) +vc_ioctl(dev, cmd, addr, flag, td) struct cdev *dev; u_long cmd; caddr_t addr; @@ -448,7 +440,7 @@ vc_nb_ioctl(dev, cmd, addr, flag, td) } int -vc_nb_poll(dev, events, td) +vc_poll(dev, events, td) struct cdev *dev; int events; struct thread *td; diff --git a/sys/fs/coda/coda_psdev.h b/sys/fs/coda/coda_psdev.h index 5d1193ba..a446e3d 100644 --- a/sys/fs/coda/coda_psdev.h +++ b/sys/fs/coda/coda_psdev.h @@ -31,9 +31,9 @@ * */ -int vc_nb_open(struct cdev *dev, int flag, int mode, struct thread *p); -int vc_nb_close (struct cdev *dev, int flag, int mode, struct thread *p); -int vc_nb_read(struct cdev *dev, struct uio *uiop, int flag); -int vc_nb_write(struct cdev *dev, struct uio *uiop, int flag); -int vc_nb_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *p); -int vc_nb_poll(struct cdev *dev, int events, struct thread *p); +d_open_t vc_open; +d_close_t vc_close; +d_read_t vc_read; +d_write_t vc_write; +d_ioctl_t vc_ioctl; +d_poll_t vc_poll; diff --git a/sys/fs/coda/coda_venus.c b/sys/fs/coda/coda_venus.c index 746436e..03df54e 100644 --- a/sys/fs/coda/coda_venus.c +++ b/sys/fs/coda/coda_venus.c @@ -621,6 +621,9 @@ venus_symlink(void *mdp, CodaFid *fid, return error; } +/* + * XXX: Unused. + */ int venus_readdir(void *mdp, CodaFid *fid, int count, int offset, diff --git a/sys/fs/coda/coda_vfsops.c b/sys/fs/coda/coda_vfsops.c index 5860616..e5c4b19 100644 --- a/sys/fs/coda/coda_vfsops.c +++ b/sys/fs/coda/coda_vfsops.c @@ -347,7 +347,7 @@ coda_root(vfsp, flags, vpp, td) * Get filesystem statistics. */ int -coda_nb_statfs(vfsp, sbp, td) +coda_statfs(vfsp, sbp, td) register struct mount *vfsp; struct statfs *sbp; struct thread *td; @@ -361,17 +361,17 @@ coda_nb_statfs(vfsp, sbp, td) /* XXX - what to do about f_flags, others? --bnoble */ /* Below This is what AFS does - #define NB_SFS_SIZ 0x895440 + #define CODA_SFS_SIZ 0x895440 */ sbp->f_flags = 0; sbp->f_bsize = 8192; /* XXX */ sbp->f_iosize = 8192; /* XXX */ -#define NB_SFS_SIZ 0x8AB75D - sbp->f_blocks = NB_SFS_SIZ; - sbp->f_bfree = NB_SFS_SIZ; - sbp->f_bavail = NB_SFS_SIZ; - sbp->f_files = NB_SFS_SIZ; - sbp->f_ffree = NB_SFS_SIZ; +#define CODA_SFS_SIZ 0x8AB75D + sbp->f_blocks = CODA_SFS_SIZ; + sbp->f_bfree = CODA_SFS_SIZ; + sbp->f_bavail = CODA_SFS_SIZ; + sbp->f_files = CODA_SFS_SIZ; + sbp->f_ffree = CODA_SFS_SIZ; MARK_INT_SAT(CODA_STATFS_STATS); return(0); } @@ -395,6 +395,11 @@ coda_sync(vfsp, waitfor, td) * fhtovp is now what vget used to be in 4.3-derived systems. For * some silly reason, vget is now keyed by a 32 bit ino_t, rather than * a type-specific fid. + * + * XXX: coda_fhtovp is currently not hooked up, so no NFS export for Coda. + * We leave it here in the hopes that someone will find it someday and hook + * it up. Among other things, it will need some reworking to match the + * vfs_fhtovp_t prototype. */ int coda_fhtovp(vfsp, fhp, nam, vpp, exflagsp, creadanonp) @@ -439,39 +444,10 @@ coda_fhtovp(vfsp, fhp, nam, vpp, exflagsp, creadanonp) return(error); } -/* - * To allow for greater ease of use, some vnodes may be orphaned when - * Venus dies. Certain operations should still be allowed to go - * through, but without propagating ophan-ness. So this function will - * get a new vnode for the file from the current run of Venus. */ - -int -getNewVnode(vpp) - struct vnode **vpp; -{ - struct cfid cfid; - struct coda_mntinfo *mi = vftomi((*vpp)->v_mount); - - ENTRY; - - cfid.cfid_len = (short)sizeof(CodaFid); - cfid.cfid_fid = VTOC(*vpp)->c_fid; /* Structure assignment. */ - /* XXX ? */ - - /* We're guessing that if set, the 1st element on the list is a - * valid vnode to use. If not, return ENODEV as venus is dead. - */ - if (mi->mi_vfsp == NULL) - return ENODEV; - - return coda_fhtovp(mi->mi_vfsp, (struct fid*)&cfid, NULL, vpp, - NULL, NULL); -} - struct vfsops coda_vfsops = { .vfs_mount = coda_mount, .vfs_root = coda_root, - .vfs_statfs = coda_nb_statfs, + .vfs_statfs = coda_statfs, .vfs_sync = coda_sync, .vfs_unmount = coda_unmount, }; diff --git a/sys/fs/coda/coda_vfsops.h b/sys/fs/coda/coda_vfsops.h index 4dbc473..b661e0a 100644 --- a/sys/fs/coda/coda_vfsops.h +++ b/sys/fs/coda/coda_vfsops.h @@ -53,10 +53,5 @@ int coda_fhtovp(struct mount *, struct fid *, struct mbuf *, struct vnode **, vfs_mount_t coda_mount; vfs_unmount_t coda_unmount; vfs_root_t coda_root; -vfs_quotactl_t coda_quotactl; -vfs_statfs_t coda_nb_statfs; +vfs_statfs_t coda_statfs; vfs_sync_t coda_sync; -vfs_vget_t coda_vget; -vfs_init_t coda_init; - -int getNewVnode(struct vnode **vpp); diff --git a/sys/fs/coda/coda_vnops.c b/sys/fs/coda/coda_vnops.c index 297a2dd..3206268 100644 --- a/sys/fs/coda/coda_vnops.c +++ b/sys/fs/coda/coda_vnops.c @@ -146,17 +146,7 @@ struct vop_vector coda_vnodeops = { }; -/* A generic do-nothing. For lease_check, advlock */ -int -coda_vop_nop(void *anon) { - struct vnodeop_desc **desc = (struct vnodeop_desc **)anon; - - if (codadebug) { - myprintf(("Vnode operation %s called, but unsupported\n", - (*desc)->vdesc_name)); - } - return (0); -} +static void coda_print_vattr(struct vattr *attr); int coda_vnodeopstats_init(void) @@ -390,8 +380,6 @@ coda_rdwr(struct vnode *vp, struct uio *uiop, enum uio_rw rw, int ioflag, return(error); } - - int coda_ioctl(struct vop_ioctl_args *ap) { @@ -504,7 +492,7 @@ coda_getattr(struct vop_getattr_args *ap) 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); ); + coda_print_vattr(&cp->c_vattr); ); *vap = cp->c_vattr; MARK_INT_SAT(CODA_GETATTR_STATS); @@ -518,7 +506,7 @@ coda_getattr(struct vop_getattr_args *ap) coda_f2s(&cp->c_fid), error)); ) CODADEBUG(CODA_GETATTR, if (!(codadebug & ~CODA_GETATTR)) - print_vattr(vap); ); + coda_print_vattr(vap); ); { int size = vap->va_size; struct vnode *convp = cp->c_ovp; @@ -557,7 +545,7 @@ coda_setattr(struct vop_setattr_args *ap) } if (codadebug & CODADBGMSK(CODA_SETATTR)) { - print_vattr(vap); + coda_print_vattr(vap); } error = venus_setattr(vtomi(vp), &cp->c_fid, vap, cred, td->td_proc); @@ -1422,6 +1410,9 @@ coda_symlink(struct vop_symlink_args *ap) /* * Read directory entries. + * + * XXXRW: This forwards the operator straight to the cache vnode using + * VOP_READDIR(), rather than calling venus_readdir(). Why? */ int coda_readdir(struct vop_readdir_args *ap) @@ -1577,8 +1568,8 @@ coda_islocked(struct vop_islocked_args *ap) return (vop_stdislocked(ap)); } -void -print_vattr(struct vattr *attr) +static void +coda_print_vattr(struct vattr *attr) { char *typestr; @@ -1636,7 +1627,7 @@ print_vattr(struct vattr *attr) /* How to print a ucred */ void -print_cred(struct ucred *cred) +coda_print_cred(struct ucred *cred) { int i; diff --git a/sys/fs/coda/coda_vnops.h b/sys/fs/coda/coda_vnops.h index 29b962c..45d49ef 100644 --- a/sys/fs/coda/coda_vnops.h +++ b/sys/fs/coda/coda_vnops.h @@ -75,11 +75,9 @@ vop_lock1_t coda_lock; vop_unlock_t coda_unlock; vop_islocked_t coda_islocked; int coda_vop_error(void *); -int coda_vop_nop(void *); vop_pathconf_t coda_pathconf; int coda_rdwr(struct vnode *vp, struct uio *uiop, enum uio_rw rw, int ioflag, struct ucred *cred, struct thread *td); int coda_grab_vnode(struct cdev *dev, ino_t ino, struct vnode **vpp); -void print_vattr(struct vattr *attr); -void print_cred(struct ucred *cred); +void coda_print_cred(struct ucred *cred); |