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/kern/vfs_lookup.c | |
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/kern/vfs_lookup.c')
-rw-r--r-- | sys/kern/vfs_lookup.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 4875533..470abba 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -100,15 +100,16 @@ namei(ndp) struct uio auio; int error, linklen; struct componentname *cnp = &ndp->ni_cnd; - struct proc *p = cnp->cn_proc; + struct thread *td = cnp->cn_thread; + struct proc *p = td->td_proc; - ndp->ni_cnd.cn_cred = ndp->ni_cnd.cn_proc->p_ucred; - KASSERT(cnp->cn_cred && cnp->cn_proc, ("namei: bad cred/proc")); + ndp->ni_cnd.cn_cred = ndp->ni_cnd.cn_thread->td_proc->p_ucred; + KASSERT(cnp->cn_cred && p, ("namei: bad cred/proc")); KASSERT((cnp->cn_nameiop & (~OPMASK)) == 0, ("namei: nameiop contaminated with flags")); KASSERT((cnp->cn_flags & OPMASK) == 0, ("namei: flags contaminated with nameiops")); - fdp = cnp->cn_proc->p_fd; + fdp = p->p_fd; /* * Get a buffer for the name to be translated, and copy the @@ -136,8 +137,8 @@ namei(ndp) } ndp->ni_loopcnt = 0; #ifdef KTRACE - if (KTRPOINT(cnp->cn_proc, KTR_NAMEI)) - ktrnamei(cnp->cn_proc->p_tracep, cnp->cn_pnbuf); + if (KTRPOINT(p, KTR_NAMEI)) + ktrnamei(p->p_tracep, cnp->cn_pnbuf); #endif /* @@ -182,14 +183,13 @@ namei(ndp) (cnp->cn_nameiop != DELETE) && ((cnp->cn_flags & (NOOBJ|LOCKLEAF)) == LOCKLEAF)) - vfs_object_create(ndp->ni_vp, - ndp->ni_cnd.cn_proc, + vfs_object_create(ndp->ni_vp, td, ndp->ni_cnd.cn_cred); return (0); } if ((cnp->cn_flags & LOCKPARENT) && ndp->ni_pathlen == 1) - VOP_UNLOCK(ndp->ni_dvp, 0, p); + VOP_UNLOCK(ndp->ni_dvp, 0, td); if (ndp->ni_loopcnt++ >= MAXSYMLINKS) { error = ELOOP; break; @@ -205,7 +205,7 @@ namei(ndp) auio.uio_offset = 0; auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_SYSSPACE; - auio.uio_procp = (struct proc *)0; + auio.uio_td = (struct thread *)0; auio.uio_resid = MAXPATHLEN; error = VOP_READLINK(ndp->ni_vp, &auio, cnp->cn_cred); if (error) { @@ -296,7 +296,7 @@ lookup(ndp) int error = 0; int dpunlocked = 0; /* dp has already been unlocked */ struct componentname *cnp = &ndp->ni_cnd; - struct proc *p = cnp->cn_proc; + struct thread *td = cnp->cn_thread; /* * Setup: break out flag bits into variables. @@ -312,7 +312,7 @@ lookup(ndp) cnp->cn_flags &= ~ISSYMLINK; dp = ndp->ni_startdir; ndp->ni_startdir = NULLVP; - vn_lock(dp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(dp, LK_EXCLUSIVE | LK_RETRY, td); dirloop: /* @@ -392,7 +392,7 @@ dirloop: } ndp->ni_vp = dp; if (!(cnp->cn_flags & (LOCKPARENT | LOCKLEAF))) - VOP_UNLOCK(dp, 0, p); + VOP_UNLOCK(dp, 0, td); /* XXX This should probably move to the top of function. */ if (cnp->cn_flags & SAVESTART) panic("lookup: SAVESTART"); @@ -432,7 +432,7 @@ dirloop: dp = dp->v_mount->mnt_vnodecovered; vput(tdp); VREF(dp); - vn_lock(dp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(dp, LK_EXCLUSIVE | LK_RETRY, td); } } @@ -459,7 +459,7 @@ unionlookup: else vput(tdp); VREF(dp); - vn_lock(dp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(dp, LK_EXCLUSIVE | LK_RETRY, td); goto unionlookup; } @@ -514,11 +514,11 @@ unionlookup: */ while (dp->v_type == VDIR && (mp = dp->v_mountedhere) && (cnp->cn_flags & NOCROSSMOUNT) == 0) { - if (vfs_busy(mp, 0, 0, p)) + if (vfs_busy(mp, 0, 0, td)) continue; - VOP_UNLOCK(dp, 0, p); + VOP_UNLOCK(dp, 0, td); error = VFS_ROOT(mp, &tdp); - vfs_unbusy(mp, p); + vfs_unbusy(mp, td); if (error) { dpunlocked = 1; goto bad2; @@ -587,13 +587,13 @@ nextname: vrele(ndp->ni_dvp); if ((cnp->cn_flags & LOCKLEAF) == 0) - VOP_UNLOCK(dp, 0, p); + VOP_UNLOCK(dp, 0, td); return (0); bad2: if ((cnp->cn_flags & (LOCKPARENT | PDIRUNLOCK)) == LOCKPARENT && *ndp->ni_next == '\0') - VOP_UNLOCK(ndp->ni_dvp, 0, p); + VOP_UNLOCK(ndp->ni_dvp, 0, td); vrele(ndp->ni_dvp); bad: if (dpunlocked) @@ -613,7 +613,7 @@ relookup(dvp, vpp, cnp) struct vnode *dvp, **vpp; struct componentname *cnp; { - struct proc *p = cnp->cn_proc; + struct thread *td = cnp->cn_thread; struct vnode *dp = 0; /* the directory we are searching */ int docache; /* == 0 do not cache last component */ int wantparent; /* 1 => wantparent or lockparent flag */ @@ -635,7 +635,7 @@ relookup(dvp, vpp, cnp) rdonly = cnp->cn_flags & RDONLY; cnp->cn_flags &= ~ISSYMLINK; dp = dvp; - vn_lock(dp, LK_EXCLUSIVE | LK_RETRY, p); + vn_lock(dp, LK_EXCLUSIVE | LK_RETRY, td); /* dirloop: */ /* @@ -669,7 +669,7 @@ relookup(dvp, vpp, cnp) goto bad; } if (!(cnp->cn_flags & LOCKLEAF)) - VOP_UNLOCK(dp, 0, p); + VOP_UNLOCK(dp, 0, td); *vpp = dp; /* XXX This should probably move to the top of function. */ if (cnp->cn_flags & SAVESTART) @@ -730,15 +730,15 @@ relookup(dvp, vpp, cnp) if (vn_canvmio(dp) == TRUE && ((cnp->cn_flags & (NOOBJ|LOCKLEAF)) == LOCKLEAF)) - vfs_object_create(dp, cnp->cn_proc, cnp->cn_cred); + vfs_object_create(dp, td, cnp->cn_cred); if ((cnp->cn_flags & LOCKLEAF) == 0) - VOP_UNLOCK(dp, 0, p); + VOP_UNLOCK(dp, 0, td); return (0); bad2: if ((cnp->cn_flags & LOCKPARENT) && (cnp->cn_flags & ISLASTCN)) - VOP_UNLOCK(dvp, 0, p); + VOP_UNLOCK(dvp, 0, td); vrele(dvp); bad: vput(dp); |