diff options
author | julian <julian@FreeBSD.org> | 2001-09-12 08:38:13 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2001-09-12 08:38:13 +0000 |
commit | 5596676e6c6c1e81e899cd0531f9b1c28a292669 (patch) | |
tree | b1a19fcdf05759281fab0d89efb13f0fdf42102e /sys/fs/coda | |
parent | 83e00d4274950d2b531c24692cd123538ffbddb9 (diff) | |
download | FreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.zip FreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.tar.gz |
KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.
Sorry john! (your next MFC will be a doosie!)
Reviewed by: peter@freebsd.org, dillon@freebsd.org
X-MFC after: ha ha ha ha
Diffstat (limited to 'sys/fs/coda')
-rw-r--r-- | sys/fs/coda/coda_psdev.c | 23 | ||||
-rw-r--r-- | sys/fs/coda/coda_psdev.h | 8 | ||||
-rw-r--r-- | sys/fs/coda/coda_vfsops.c | 41 | ||||
-rw-r--r-- | sys/fs/coda/coda_vfsops.h | 12 | ||||
-rw-r--r-- | sys/fs/coda/coda_vnops.c | 143 | ||||
-rw-r--r-- | sys/fs/coda/coda_vnops.h | 2 |
6 files changed, 118 insertions, 111 deletions
diff --git a/sys/fs/coda/coda_psdev.c b/sys/fs/coda/coda_psdev.c index 0d8560f..2346c7c 100644 --- a/sys/fs/coda/coda_psdev.c +++ b/sys/fs/coda/coda_psdev.c @@ -117,11 +117,11 @@ vcodaattach(n) } int -vc_nb_open(dev, flag, mode, p) +vc_nb_open(dev, flag, mode, td) dev_t dev; int flag; int mode; - struct proc *p; /* NetBSD only */ + struct thread *td; /* NetBSD only */ { register struct vcomm *vcp; @@ -149,11 +149,11 @@ vc_nb_open(dev, flag, mode, p) } int -vc_nb_close (dev, flag, mode, p) +vc_nb_close (dev, flag, mode, td) dev_t dev; int flag; int mode; - struct proc *p; + struct thread *td; { register struct vcomm *vcp; register struct vmsg *vmp, *nvmp = NULL; @@ -225,7 +225,7 @@ vc_nb_close (dev, flag, mode, p) #endif } - err = dounmount(mi->mi_vfsp, flag, p); + err = dounmount(mi->mi_vfsp, flag, td); if (err) myprintf(("Error %d unmounting vfs in vcclose(%d)\n", err, minor(dev))); @@ -387,12 +387,12 @@ vc_nb_write(dev, uiop, flag) } int -vc_nb_ioctl(dev, cmd, addr, flag, p) +vc_nb_ioctl(dev, cmd, addr, flag, td) dev_t dev; u_long cmd; caddr_t addr; int flag; - struct proc *p; + struct thread *td; { ENTRY; @@ -441,10 +441,10 @@ vc_nb_ioctl(dev, cmd, addr, flag, p) } int -vc_nb_poll(dev, events, p) +vc_nb_poll(dev, events, td) dev_t dev; int events; - struct proc *p; + struct thread *td; { register struct vcomm *vcp; int event_msk = 0; @@ -463,7 +463,7 @@ vc_nb_poll(dev, events, p) if (!EMPTY(vcp->vc_requests)) return(events & (POLLIN|POLLRDNORM)); - selrecord(p, &(vcp->vc_selproc)); + selrecord(curthread, &(vcp->vc_selproc)); return(0); } @@ -490,7 +490,8 @@ coda_call(mntinfo, inSize, outSize, buffer) struct vmsg *vmp; int error; #ifdef CTL_C - struct proc *p = curproc; + struct thread *td = curthread; + struct proc *p = td->td_proc; sigset_t psig_omask; sigset_t tempset; int i; diff --git a/sys/fs/coda/coda_psdev.h b/sys/fs/coda/coda_psdev.h index c6276f3..c6ecf7f 100644 --- a/sys/fs/coda/coda_psdev.h +++ b/sys/fs/coda/coda_psdev.h @@ -31,9 +31,9 @@ * */ -int vc_nb_open(dev_t dev, int flag, int mode, struct proc *p); -int vc_nb_close (dev_t dev, int flag, int mode, struct proc *p); +int vc_nb_open(dev_t dev, int flag, int mode, struct thread *p); +int vc_nb_close (dev_t dev, int flag, int mode, struct thread *p); int vc_nb_read(dev_t dev, struct uio *uiop, int flag); int vc_nb_write(dev_t dev, struct uio *uiop, int flag); -int vc_nb_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p); -int vc_nb_poll(dev_t dev, int events, struct proc *p); +int vc_nb_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct thread *p); +int vc_nb_poll(dev_t dev, int events, struct thread *p); diff --git a/sys/fs/coda/coda_vfsops.c b/sys/fs/coda/coda_vfsops.c index 8bcd36f..d01d5a7 100644 --- a/sys/fs/coda/coda_vfsops.c +++ b/sys/fs/coda/coda_vfsops.c @@ -83,7 +83,7 @@ struct coda_op_stats coda_vfsopstats[CODA_VFSOPS_SIZE]; #define MRAK_INT_GEN(op) (coda_vfsopstats[op].gen_intrn++) extern int coda_nc_initialized; /* Set if cache has been initialized */ -extern int vc_nb_open __P((dev_t, int, int, struct proc *)); +extern int vc_nb_open __P((dev_t, int, int, struct thread *)); int coda_vfsopstats_init(void) @@ -107,12 +107,12 @@ coda_vfsopstats_init(void) */ /*ARGSUSED*/ int -coda_mount(vfsp, path, data, ndp, p) +coda_mount(vfsp, path, data, ndp, td) 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? */ struct nameidata *ndp; /* Clobber this to lookup the device name */ - struct proc *p; /* The ever-famous proc pointer */ + struct thread *td; /* The ever-famous proc pointer */ { struct vnode *dvp; struct cnode *cp; @@ -135,7 +135,7 @@ coda_mount(vfsp, path, data, ndp, p) } /* Validate mount device. Similar to getmdev(). */ - NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, data, p); + NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, data, td); error = namei(ndp); dvp = ndp->ni_vp; @@ -233,10 +233,10 @@ coda_mount(vfsp, path, data, ndp, p) } int -coda_unmount(vfsp, mntflags, p) +coda_unmount(vfsp, mntflags, td) struct mount *vfsp; int mntflags; - struct proc *p; + struct thread *td; { struct coda_mntinfo *mi = vftomi(vfsp); int active, error = 0; @@ -292,8 +292,12 @@ coda_root(vfsp, vpp) struct coda_mntinfo *mi = vftomi(vfsp); struct vnode **result; int error; - struct proc *p = curproc; /* XXX - bnoble */ + struct thread *td = curthread; /* XXX - bnoble */ + struct proc *p = td->td_proc; ViceFid VFid; + + ENTRY; + ENTRY; MARK_ENTRY(CODA_ROOT_STATS); @@ -308,9 +312,9 @@ coda_root(vfsp, vpp) /* On Mach, this is vref. On NetBSD, VOP_LOCK */ #if 1 vref(*vpp); - vn_lock(*vpp, LK_EXCLUSIVE, p); + vn_lock(*vpp, LK_EXCLUSIVE, td); #else - vget(*vpp, LK_EXCLUSIVE, p); + vget(*vpp, LK_EXCLUSIVE, td); #endif MARK_INT_SAT(CODA_ROOT_STATS); return(0); @@ -331,9 +335,9 @@ coda_root(vfsp, vpp) *vpp = mi->mi_rootvp; #if 1 vref(*vpp); - vn_lock(*vpp, LK_EXCLUSIVE, p); + vn_lock(*vpp, LK_EXCLUSIVE, td); #else - vget(*vpp, LK_EXCLUSIVE, p); + vget(*vpp, LK_EXCLUSIVE, td); #endif MARK_INT_SAT(CODA_ROOT_STATS); @@ -351,9 +355,9 @@ coda_root(vfsp, vpp) *vpp = mi->mi_rootvp; #if 1 vref(*vpp); - vn_lock(*vpp, LK_EXCLUSIVE, p); + vn_lock(*vpp, LK_EXCLUSIVE, td); #else - vget(*vpp, LK_EXCLUSIVE, p); + vget(*vpp, LK_EXCLUSIVE, td); #endif MARK_INT_FAIL(CODA_ROOT_STATS); @@ -374,10 +378,10 @@ coda_root(vfsp, vpp) * Get file system statistics. */ int -coda_nb_statfs(vfsp, sbp, p) +coda_nb_statfs(vfsp, sbp, td) register struct mount *vfsp; struct statfs *sbp; - struct proc *p; + struct thread *td; { ENTRY; /* MARK_ENTRY(CODA_STATFS_STATS); */ @@ -412,11 +416,11 @@ coda_nb_statfs(vfsp, sbp, p) * Flush any pending I/O. */ int -coda_sync(vfsp, waitfor, cred, p) +coda_sync(vfsp, waitfor, cred, td) struct mount *vfsp; int waitfor; struct ucred *cred; - struct proc *p; + struct thread *td; { ENTRY; MARK_ENTRY(CODA_SYNC_STATS); @@ -441,7 +445,8 @@ coda_fhtovp(vfsp, fhp, nam, vpp, exflagsp, creadanonp) struct cfid *cfid = (struct cfid *)fhp; struct cnode *cp = 0; int error; - struct proc *p = curproc; /* XXX -mach */ + struct thread *td = curthread; /* XXX -mach */ + struct proc *p = td->td_proc; ViceFid VFid; int vtype; diff --git a/sys/fs/coda/coda_vfsops.h b/sys/fs/coda/coda_vfsops.h index 7fc9adf..57b9a5a 100644 --- a/sys/fs/coda/coda_vfsops.h +++ b/sys/fs/coda/coda_vfsops.h @@ -48,13 +48,13 @@ struct mount; int coda_vfsopstats_init(void); int coda_mount(struct mount *, char *, caddr_t, struct nameidata *, - struct proc *); -int coda_start(struct mount *, int, struct proc *); -int coda_unmount(struct mount *, int, struct proc *); + struct thread *); +int coda_start(struct mount *, int, struct thread *); +int coda_unmount(struct mount *, int, struct thread *); int coda_root(struct mount *, struct vnode **); -int coda_quotactl(struct mount *, int, uid_t, caddr_t, struct proc *); -int coda_nb_statfs(struct mount *, struct statfs *, struct proc *); -int coda_sync(struct mount *, int, struct ucred *, struct proc *); +int coda_quotactl(struct mount *, int, uid_t, caddr_t, struct thread *); +int coda_nb_statfs(struct mount *, struct statfs *, struct thread *); +int coda_sync(struct mount *, int, struct ucred *, struct thread *); int coda_vget(struct mount *, ino_t, struct vnode **); int coda_fhtovp(struct mount *, struct fid *, struct mbuf *, struct vnode **, int *, struct ucred **); diff --git a/sys/fs/coda/coda_vnops.c b/sys/fs/coda/coda_vnops.c index dd0a96e..8fd7170d 100644 --- a/sys/fs/coda/coda_vnops.c +++ b/sys/fs/coda/coda_vnops.c @@ -235,7 +235,7 @@ coda_open(v) struct cnode *cp = VTOC(*vpp); int flag = ap->a_mode & (~O_EXCL); struct ucred *cred = ap->a_cred; - struct proc *p = ap->a_p; + struct thread *td = ap->a_td; /* locals */ int error; struct vnode *vp; @@ -256,7 +256,7 @@ coda_open(v) return(0); } - error = venus_open(vtomi((*vpp)), &cp->c_fid, flag, cred, p, &dev, &inode); + error = venus_open(vtomi((*vpp)), &cp->c_fid, flag, cred, td->td_proc, &dev, &inode); if (error) return (error); if (!error) { @@ -272,7 +272,7 @@ coda_open(v) return (error); /* We get the vnode back locked. Needs unlocked */ - VOP_UNLOCK(vp, 0, p); + VOP_UNLOCK(vp, 0, td); /* Keep a reference until the close comes in. */ vref(*vpp); @@ -297,14 +297,14 @@ coda_open(v) cp->c_inode = inode; /* Open the cache file. */ - error = VOP_OPEN(vp, flag, cred, p); + error = VOP_OPEN(vp, flag, cred, td); if (error) { printf("coda_open: VOP_OPEN on container failed %d\n", error); return (error); } /* grab (above) does this when it calls newvnode unless it's in the cache*/ if (vp->v_type == VREG) { - error = vfs_object_create(vp, p, cred); + error = vfs_object_create(vp, td, cred); if (error != 0) { printf("coda_open: vfs_object_create() returns %d\n", error); vput(vp); @@ -327,7 +327,7 @@ coda_close(v) struct cnode *cp = VTOC(vp); int flag = ap->a_fflag; struct ucred *cred = ap->a_cred; - struct proc *p = ap->a_p; + struct thread *td = ap->a_td; /* locals */ int error; @@ -348,7 +348,7 @@ coda_close(v) #ifdef hmm vgone(cp->c_ovp); #else - VOP_CLOSE(cp->c_ovp, flag, cred, p); /* Do errors matter here? */ + VOP_CLOSE(cp->c_ovp, flag, cred, td); /* Do errors matter here? */ vrele(cp->c_ovp); #endif } else { @@ -358,7 +358,7 @@ coda_close(v) } return ENODEV; } else { - VOP_CLOSE(cp->c_ovp, flag, cred, p); /* Do errors matter here? */ + VOP_CLOSE(cp->c_ovp, flag, cred, td); /* Do errors matter here? */ vrele(cp->c_ovp); } @@ -368,7 +368,7 @@ coda_close(v) if (flag & FWRITE) /* file was opened for write */ --cp->c_owrite; - error = venus_close(vtomi(vp), &cp->c_fid, flag, cred, p); + error = venus_close(vtomi(vp), &cp->c_fid, flag, cred, td->td_proc); vrele(CTOV(cp)); CODADEBUG(CODA_CLOSE, myprintf(("close: result %d\n",error)); ) @@ -383,7 +383,7 @@ coda_read(v) ENTRY; return(coda_rdwr(ap->a_vp, ap->a_uio, UIO_READ, - ap->a_ioflag, ap->a_cred, ap->a_uio->uio_procp)); + ap->a_ioflag, ap->a_cred, ap->a_uio->uio_td)); } int @@ -394,24 +394,25 @@ coda_write(v) ENTRY; return(coda_rdwr(ap->a_vp, ap->a_uio, UIO_WRITE, - ap->a_ioflag, ap->a_cred, ap->a_uio->uio_procp)); + ap->a_ioflag, ap->a_cred, ap->a_uio->uio_td)); } int -coda_rdwr(vp, uiop, rw, ioflag, cred, p) +coda_rdwr(vp, uiop, rw, ioflag, cred, td) struct vnode *vp; struct uio *uiop; enum uio_rw rw; int ioflag; struct ucred *cred; - struct proc *p; + struct thread *td; { /* upcall decl */ /* NOTE: container file operation!!! */ /* locals */ struct cnode *cp = VTOC(vp); struct vnode *cfvp = cp->c_ovp; - struct proc *lp = p; + struct proc *p = td->td_proc; + struct thread *ltd = td; int igot_internally = 0; int opened_internally = 0; int error = 0; @@ -448,7 +449,7 @@ coda_rdwr(vp, uiop, rw, ioflag, cred, p) PROC_UNLOCK(p); } else - lp = curproc; + ltd = curthread; if (cp->c_inode != 0 && !iscore) { igot_internally = 1; @@ -458,23 +459,23 @@ coda_rdwr(vp, uiop, rw, ioflag, cred, p) return(error); } /* - * We get the vnode back locked by curproc in both Mach and + * We get the vnode back locked by curthread in both Mach and * NetBSD. Needs unlocked */ - VOP_UNLOCK(cfvp, 0, lp); + VOP_UNLOCK(cfvp, 0, ltd); } else { opened_internally = 1; MARK_INT_GEN(CODA_OPEN_STATS); error = VOP_OPEN(vp, (rw == UIO_READ ? FREAD : FWRITE), - cred, p); + cred, td); printf("coda_rdwr: Internally Opening %p\n", vp); if (error) { printf("coda_rdwr: VOP_OPEN on container failed %d\n", error); return (error); } if (vp->v_type == VREG) { - error = vfs_object_create(vp, p, cred); + error = vfs_object_create(vp, td, cred); if (error != 0) { printf("coda_rdwr: vfs_object_create() returns %d\n", error); vput(vp); @@ -501,7 +502,7 @@ printf("coda_rdwr: Internally Opening %p\n", vp); { struct vattr attr; - if (VOP_GETATTR(cfvp, &attr, cred, p) == 0) { + if (VOP_GETATTR(cfvp, &attr, cred, td) == 0) { vnode_pager_setsize(vp, attr.va_size); } } @@ -515,7 +516,7 @@ printf("coda_rdwr: Internally Opening %p\n", vp); /* Do an internal close if necessary. */ if (opened_internally) { MARK_INT_GEN(CODA_CLOSE_STATS); - (void)VOP_CLOSE(vp, (rw == UIO_READ ? FREAD : FWRITE), cred, p); + (void)VOP_CLOSE(vp, (rw == UIO_READ ? FREAD : FWRITE), cred, td); } /* Invalidate cached attributes if writing. */ @@ -537,7 +538,7 @@ coda_ioctl(v) caddr_t data = ap->a_data; int flag = ap->a_fflag; struct ucred *cred = ap->a_cred; - struct proc *p = ap->a_p; + struct thread *td = ap->a_td; /* locals */ int error; struct vnode *tvp; @@ -562,7 +563,7 @@ coda_ioctl(v) /* Should we use the name cache here? It would get it from lookupname sooner or later anyway, right? */ - NDINIT(&ndp, LOOKUP, (iap->follow ? FOLLOW : NOFOLLOW), UIO_USERSPACE, iap->path, p); + NDINIT(&ndp, LOOKUP, (iap->follow ? FOLLOW : NOFOLLOW), UIO_USERSPACE, iap->path, td); error = namei(&ndp); tvp = ndp.ni_vp; @@ -591,7 +592,7 @@ coda_ioctl(v) NDFREE(&ndp, 0); return(EINVAL); } - error = venus_ioctl(vtomi(tvp), &((VTOC(tvp))->c_fid), com, flag, data, cred, p); + error = venus_ioctl(vtomi(tvp), &((VTOC(tvp))->c_fid), com, flag, data, cred, td->td_proc); if (error) MARK_INT_FAIL(CODA_IOCTL_STATS); @@ -622,7 +623,7 @@ coda_getattr(v) struct cnode *cp = VTOC(vp); struct vattr *vap = ap->a_vap; struct ucred *cred = ap->a_cred; - struct proc *p = ap->a_p; + struct thread *td = ap->a_td; /* locals */ int error; @@ -651,7 +652,7 @@ coda_getattr(v) return(0); } - error = venus_getattr(vtomi(vp), &cp->c_fid, cred, p, vap); + 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", @@ -689,7 +690,7 @@ coda_setattr(v) struct cnode *cp = VTOC(vp); register struct vattr *vap = ap->a_vap; struct ucred *cred = ap->a_cred; - struct proc *p = ap->a_p; + struct thread *td = ap->a_td; /* locals */ int error; @@ -704,7 +705,7 @@ coda_setattr(v) if (codadebug & CODADBGMSK(CODA_SETATTR)) { print_vattr(vap); } - error = venus_setattr(vtomi(vp), &cp->c_fid, vap, cred, p); + error = venus_setattr(vtomi(vp), &cp->c_fid, vap, cred, td->td_proc); if (!error) cp->c_flags &= ~C_VATTR; @@ -729,7 +730,7 @@ coda_access(v) struct cnode *cp = VTOC(vp); int mode = ap->a_mode; struct ucred *cred = ap->a_cred; - struct proc *p = ap->a_p; + struct thread *td = ap->a_td; /* locals */ int error; @@ -758,7 +759,7 @@ coda_access(v) } } - error = venus_access(vtomi(vp), &cp->c_fid, mode, cred, p); + error = venus_access(vtomi(vp), &cp->c_fid, mode, cred, td->td_proc); return(error); } @@ -773,7 +774,7 @@ coda_readlink(v) struct cnode *cp = VTOC(vp); struct uio *uiop = ap->a_uio; struct ucred *cred = ap->a_cred; - struct proc *p = ap->a_uio->uio_procp; + struct thread *td = ap->a_uio->uio_td; /* locals */ int error; char *str; @@ -797,7 +798,7 @@ coda_readlink(v) return(error); } - error = venus_readlink(vtomi(vp), &cp->c_fid, cred, p, &str, &len); + error = venus_readlink(vtomi(vp), &cp->c_fid, cred, td->td_proc, &str, &len); if (!error) { uiop->uio_rw = UIO_READ; @@ -824,7 +825,7 @@ coda_fsync(v) struct vnode *vp = ap->a_vp; struct cnode *cp = VTOC(vp); struct ucred *cred = ap->a_cred; - struct proc *p = ap->a_p; + struct thread *td = ap->a_td; /* locals */ struct vnode *convp = cp->c_ovp; int error; @@ -847,7 +848,7 @@ coda_fsync(v) } if (convp) - VOP_FSYNC(convp, cred, MNT_WAIT, p); + VOP_FSYNC(convp, cred, MNT_WAIT, td); /* * We see fsyncs with usecount == 1 then usecount == 0. @@ -873,7 +874,7 @@ coda_fsync(v) /* needs research */ return 0; - error = venus_fsync(vtomi(vp), &cp->c_fid, cred, p); + error = venus_fsync(vtomi(vp), &cp->c_fid, cred, td->td_proc); CODADEBUG(CODA_FSYNC, myprintf(("in fsync result %d\n",error)); ); return(error); @@ -890,7 +891,7 @@ coda_inactive(v) struct vnode *vp = ap->a_vp; struct cnode *cp = VTOC(vp); struct ucred *cred __attribute__((unused)) = NULL; - struct proc *p __attribute__((unused)) = curproc; + struct thread *td __attribute__((unused)) = curthread; /* upcall decl */ /* locals */ @@ -930,7 +931,7 @@ coda_inactive(v) printf("coda_inactive: cp->ovp != NULL use %d: vp %p, cp %p\n", vp->v_usecount, vp, cp); #endif - lockmgr(&cp->c_lock, LK_RELEASE, &vp->v_interlock, p); + lockmgr(&cp->c_lock, LK_RELEASE, &vp->v_interlock, td); } else { #ifdef OLD_DIAGNOSTIC if (CTOV(cp)->v_usecount) { @@ -940,7 +941,7 @@ coda_inactive(v) panic("coda_inactive: cp->ovp != NULL"); } #endif - VOP_UNLOCK(vp, 0, p); + VOP_UNLOCK(vp, 0, td); vgone(vp); } @@ -972,7 +973,7 @@ coda_lookup(v) */ struct componentname *cnp = ap->a_cnp; struct ucred *cred = cnp->cn_cred; - struct proc *p = cnp->cn_proc; + struct thread *td = cnp->cn_thread; /* locals */ struct cnode *cp; const char *nm = cnp->cn_nameptr; @@ -1015,7 +1016,7 @@ coda_lookup(v) } else { /* The name wasn't cached, so we need to contact Venus */ - error = venus_lookup(vtomi(dvp), &dcp->c_fid, nm, len, cred, p, &VFid, &vtype); + error = venus_lookup(vtomi(dvp), &dcp->c_fid, nm, len, cred, td->td_proc, &VFid, &vtype); if (error) { MARK_INT_FAIL(CODA_LOOKUP_STATS); @@ -1086,7 +1087,7 @@ coda_lookup(v) */ if (!error || (error == EJUSTRETURN)) { if (!(cnp->cn_flags & LOCKPARENT) || !(cnp->cn_flags & ISLASTCN)) { - if ((error = VOP_UNLOCK(dvp, 0, p))) { + if ((error = VOP_UNLOCK(dvp, 0, td))) { return error; } /* @@ -1094,7 +1095,7 @@ coda_lookup(v) * lock it without bothering to check anything else. */ if (*ap->a_vpp) { - if ((error = VOP_LOCK(*ap->a_vpp, LK_EXCLUSIVE, p))) { + if ((error = VOP_LOCK(*ap->a_vpp, LK_EXCLUSIVE, td))) { printf("coda_lookup: "); panic("unlocked parent but couldn't lock child"); } @@ -1103,7 +1104,7 @@ coda_lookup(v) /* The parent is locked, and may be the same as the child */ if (*ap->a_vpp && (*ap->a_vpp != dvp)) { /* Different, go ahead and lock it. */ - if ((error = VOP_LOCK(*ap->a_vpp, LK_EXCLUSIVE, p))) { + if ((error = VOP_LOCK(*ap->a_vpp, LK_EXCLUSIVE, td))) { printf("coda_lookup: "); panic("unlocked parent but couldn't lock child"); } @@ -1132,7 +1133,7 @@ coda_create(v) struct vnode **vpp = ap->a_vpp; struct componentname *cnp = ap->a_cnp; struct ucred *cred = cnp->cn_cred; - struct proc *p = cnp->cn_proc; + struct thread *td = cnp->cn_thread; /* locals */ int error; struct cnode *cp; @@ -1153,7 +1154,7 @@ coda_create(v) return(EACCES); } - error = venus_create(vtomi(dvp), &dcp->c_fid, nm, len, exclusive, mode, va, cred, p, &VFid, &attr); + error = venus_create(vtomi(dvp), &dcp->c_fid, nm, len, exclusive, mode, va, cred, td->td_proc, &VFid, &attr); if (!error) { @@ -1192,7 +1193,7 @@ coda_create(v) if (!error) { if (cnp->cn_flags & LOCKLEAF) { - if ((error = VOP_LOCK(*ap->a_vpp, LK_EXCLUSIVE, p))) { + if ((error = VOP_LOCK(*ap->a_vpp, LK_EXCLUSIVE, td))) { printf("coda_create: "); panic("unlocked parent but couldn't lock child"); } @@ -1216,7 +1217,7 @@ coda_remove(v) struct cnode *cp = VTOC(dvp); struct componentname *cnp = ap->a_cnp; struct ucred *cred = cnp->cn_cred; - struct proc *p = cnp->cn_proc; + struct thread *td = cnp->cn_thread; /* locals */ int error; const char *nm = cnp->cn_nameptr; @@ -1259,7 +1260,7 @@ coda_remove(v) return(ENOENT); } - error = venus_remove(vtomi(dvp), &cp->c_fid, nm, len, cred, p); + error = venus_remove(vtomi(dvp), &cp->c_fid, nm, len, cred, td->td_proc); CODADEBUG(CODA_REMOVE, myprintf(("in remove result %d\n",error)); ) @@ -1278,7 +1279,7 @@ coda_link(v) struct cnode *tdcp = VTOC(tdvp); struct componentname *cnp = ap->a_cnp; struct ucred *cred = cnp->cn_cred; - struct proc *p = cnp->cn_proc; + struct thread *td = cnp->cn_thread; /* locals */ int error; const char *nm = cnp->cn_nameptr; @@ -1308,7 +1309,7 @@ coda_link(v) return(EACCES); } - error = venus_link(vtomi(vp), &cp->c_fid, &tdcp->c_fid, nm, len, cred, p); + error = venus_link(vtomi(vp), &cp->c_fid, &tdcp->c_fid, nm, len, cred, td->td_proc); /* Invalidate the parent's attr cache, the modification time has changed */ VTOC(tdvp)->c_flags &= ~C_VATTR; @@ -1332,7 +1333,7 @@ coda_rename(v) struct cnode *ndcp = VTOC(ndvp); struct componentname *tcnp = ap->a_tcnp; struct ucred *cred = fcnp->cn_cred; - struct proc *p = fcnp->cn_proc; + struct thread *td = fcnp->cn_thread; /* true args */ int error; const char *fnm = fcnp->cn_nameptr; @@ -1346,7 +1347,7 @@ coda_rename(v) This could be Bad. XXX */ #ifdef OLD_DIAGNOSTIC if ((fcnp->cn_cred != tcnp->cn_cred) - || (fcnp->cn_proc != tcnp->cn_proc)) + || (fcnp->cn_thread != tcnp->cn_thread)) { panic("coda_rename: component names don't agree"); } @@ -1389,7 +1390,7 @@ coda_rename(v) goto exit; } - error = venus_rename(vtomi(odvp), &odcp->c_fid, &ndcp->c_fid, fnm, flen, tnm, tlen, cred, p); + error = venus_rename(vtomi(odvp), &odcp->c_fid, &ndcp->c_fid, fnm, flen, tnm, tlen, cred, td->td_proc); exit: CODADEBUG(CODA_RENAME, myprintf(("in rename result %d\n",error));) @@ -1426,7 +1427,7 @@ coda_mkdir(v) register struct vattr *va = ap->a_vap; struct vnode **vpp = ap->a_vpp; struct ucred *cred = cnp->cn_cred; - struct proc *p = cnp->cn_proc; + struct thread *td = cnp->cn_thread; /* locals */ int error; const char *nm = cnp->cn_nameptr; @@ -1450,7 +1451,7 @@ coda_mkdir(v) return(EACCES); } - error = venus_mkdir(vtomi(dvp), &dcp->c_fid, nm, len, va, cred, p, &VFid, &ova); + error = venus_mkdir(vtomi(dvp), &dcp->c_fid, nm, len, va, cred, td->td_proc, &VFid, &ova); if (!error) { if (coda_find(&VFid) != NULL) @@ -1495,7 +1496,7 @@ coda_rmdir(v) struct cnode *dcp = VTOC(dvp); struct componentname *cnp = ap->a_cnp; struct ucred *cred = cnp->cn_cred; - struct proc *p = cnp->cn_proc; + struct thread *td = cnp->cn_thread; /* true args */ int error; const char *nm = cnp->cn_nameptr; @@ -1527,7 +1528,7 @@ coda_rmdir(v) /* Invalidate the parent's attr cache, the modification time has changed */ dcp->c_flags &= ~C_VATTR; - error = venus_rmdir(vtomi(dvp), &dcp->c_fid, nm, len, cred, p); + error = venus_rmdir(vtomi(dvp), &dcp->c_fid, nm, len, cred, td->td_proc); CODADEBUG(CODA_RMDIR, myprintf(("in rmdir result %d\n", error)); ) @@ -1546,7 +1547,7 @@ coda_symlink(v) struct vattr *tva = ap->a_vap; char *path = ap->a_target; struct ucred *cred = cnp->cn_cred; - struct proc *p = cnp->cn_proc; + struct thread *td = cnp->cn_thread; struct vnode **vpp = ap->a_vpp; /* locals */ int error; @@ -1589,7 +1590,7 @@ coda_symlink(v) goto exit; } - error = venus_symlink(vtomi(tdvp), &tdcp->c_fid, path, plen, nm, len, tva, cred, p); + error = venus_symlink(vtomi(tdvp), &tdcp->c_fid, path, plen, nm, len, tva, cred, td->td_proc); /* Invalidate the parent's attr cache, the modification time has changed */ tdcp->c_flags &= ~C_VATTR; @@ -1618,7 +1619,7 @@ coda_readdir(v) int *eofflag = ap->a_eofflag; u_long **cookies = ap->a_cookies; int *ncookies = ap->a_ncookies; - struct proc *p = ap->a_uio->uio_procp; + struct thread *td = ap->a_uio->uio_td; /* upcall decl */ /* locals */ int error = 0; @@ -1643,14 +1644,14 @@ coda_readdir(v) if (cp->c_ovp == NULL) { opened_internally = 1; MARK_INT_GEN(CODA_OPEN_STATS); - error = VOP_OPEN(vp, FREAD, cred, p); + error = VOP_OPEN(vp, FREAD, cred, td); printf("coda_readdir: Internally Opening %p\n", vp); if (error) { printf("coda_readdir: VOP_OPEN on container failed %d\n", error); return (error); } if (vp->v_type == VREG) { - error = vfs_object_create(vp, p, cred); + error = vfs_object_create(vp, td, cred); if (error != 0) { printf("coda_readdir: vfs_object_create() returns %d\n", error); vput(vp); @@ -1672,7 +1673,7 @@ printf("coda_readdir: Internally Opening %p\n", vp); /* Do an "internal close" if necessary. */ if (opened_internally) { MARK_INT_GEN(CODA_CLOSE_STATS); - (void)VOP_CLOSE(vp, FREAD, cred, p); + (void)VOP_CLOSE(vp, FREAD, cred, td); } } @@ -1693,7 +1694,7 @@ coda_bmap(v) daddr_t bn __attribute__((unused)) = ap->a_bn; /* fs block number */ struct vnode **vpp = ap->a_vpp; /* RETURN vp of device */ daddr_t *bnp __attribute__((unused)) = ap->a_bnp; /* RETURN device block number */ - struct proc *p __attribute__((unused)) = curproc; + struct thread *td __attribute__((unused)) = curthread; /* upcall decl */ /* locals */ @@ -1731,7 +1732,7 @@ coda_strategy(v) /* true args */ struct vop_strategy_args *ap = v; register struct buf *bp __attribute__((unused)) = ap->a_bp; - struct proc *p __attribute__((unused)) = curproc; + struct thread *td __attribute__((unused)) = curthread; /* upcall decl */ /* locals */ @@ -1786,7 +1787,7 @@ coda_lock(v) struct vop_lock_args *ap = v; struct vnode *vp = ap->a_vp; struct cnode *cp = VTOC(vp); - struct proc *p = ap->a_p; + struct thread *td = ap->a_td; /* upcall decl */ /* locals */ @@ -1798,9 +1799,9 @@ coda_lock(v) } #ifndef DEBUG_LOCKS - return (lockmgr(&cp->c_lock, ap->a_flags, &vp->v_interlock, p)); + return (lockmgr(&cp->c_lock, ap->a_flags, &vp->v_interlock, td)); #else - return (debuglockmgr(&cp->c_lock, ap->a_flags, &vp->v_interlock, p, + return (debuglockmgr(&cp->c_lock, ap->a_flags, &vp->v_interlock, td, "coda_lock", vp->filename, vp->line)); #endif } @@ -1813,7 +1814,7 @@ coda_unlock(v) struct vop_unlock_args *ap = v; struct vnode *vp = ap->a_vp; struct cnode *cp = VTOC(vp); - struct proc *p = ap->a_p; + struct thread *td = ap->a_td; /* upcall decl */ /* locals */ @@ -1823,7 +1824,7 @@ coda_unlock(v) cp->c_fid.Volume, cp->c_fid.Vnode, cp->c_fid.Unique)); } - return (lockmgr(&cp->c_lock, ap->a_flags | LK_RELEASE, &vp->v_interlock, p)); + return (lockmgr(&cp->c_lock, ap->a_flags | LK_RELEASE, &vp->v_interlock, td)); } int @@ -1835,7 +1836,7 @@ coda_islocked(v) struct cnode *cp = VTOC(ap->a_vp); ENTRY; - return (lockstatus(&cp->c_lock, ap->a_p)); + return (lockstatus(&cp->c_lock, ap->a_td)); } /* How one looks up a vnode given a device/inode pair: */ diff --git a/sys/fs/coda/coda_vnops.h b/sys/fs/coda/coda_vnops.h index 9fcd978..663d357 100644 --- a/sys/fs/coda/coda_vnops.h +++ b/sys/fs/coda/coda_vnops.h @@ -82,7 +82,7 @@ int coda_fbsd_getpages __P((void *)); int (**coda_vnodeop_p)(void *); int coda_rdwr(struct vnode *vp, struct uio *uiop, enum uio_rw rw, - int ioflag, struct ucred *cred, struct proc *p); + int ioflag, struct ucred *cred, struct thread *td); int coda_grab_vnode(dev_t dev, ino_t ino, struct vnode **vpp); void print_vattr(struct vattr *attr); void print_cred(struct ucred *cred); |