aboutsummaryrefslogtreecommitdiff
path: root/sys/nfs/nfs_lock.c
diff options
context:
space:
mode:
authorJulian Elischer <julian@FreeBSD.org>2001-09-12 08:38:13 +0000
committerJulian Elischer <julian@FreeBSD.org>2001-09-12 08:38:13 +0000
commitb40ce4165d5eb3a5de1515245055350ae3dbab8e (patch)
treeb1a19fcdf05759281fab0d89efb13f0fdf42102e /sys/nfs/nfs_lock.c
parent9b36a30ee46a7766f269fe832ef3a2daa2ec04f0 (diff)
downloadsrc-b40ce4165d5eb3a5de1515245055350ae3dbab8e.tar.gz
src-b40ce4165d5eb3a5de1515245055350ae3dbab8e.zip
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
Notes
Notes: svn path=/head/; revision=83366
Diffstat (limited to 'sys/nfs/nfs_lock.c')
-rw-r--r--sys/nfs/nfs_lock.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/nfs/nfs_lock.c b/sys/nfs/nfs_lock.c
index e2fa91c1db54..b97b3b8213e6 100644
--- a/sys/nfs/nfs_lock.c
+++ b/sys/nfs/nfs_lock.c
@@ -87,14 +87,17 @@ nfs_dolock(ap)
{
LOCKD_MSG msg;
struct nameidata nd;
- struct proc *p;
+ struct thread *td;
uid_t saved_uid;
struct vnode *vp, *wvp;
int error, error1;
struct flock *fl;
int fmode, ioflg;
+ struct proc *p;
+
+ td = curthread;
+ p = td->td_proc;
- p = curproc;
vp = ap->a_vp;
fl = ap->a_fl;
@@ -148,7 +151,7 @@ nfs_dolock(ap)
* complain that the user's file is missing, which isn't the case.
* Note that we use proc0's cred, so the fifo is opened as root.
*/
- NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, _PATH_LCKFIFO, p);
+ NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, _PATH_LCKFIFO, td);
/*
* XXX Hack to temporarily allow this process (regardless of it's creds)
@@ -166,15 +169,15 @@ nfs_dolock(ap)
return (error == ENOENT ? EOPNOTSUPP : error);
}
wvp = nd.ni_vp;
- VOP_UNLOCK(wvp, 0, p); /* vn_open leaves it locked */
+ VOP_UNLOCK(wvp, 0, td); /* vn_open leaves it locked */
ioflg = IO_UNIT;
for (;;) {
- VOP_LEASE(wvp, p, proc0.p_ucred, LEASE_WRITE);
+ VOP_LEASE(wvp, td, proc0.p_ucred, LEASE_WRITE);
error = vn_rdwr(UIO_WRITE, wvp, (caddr_t)&msg, sizeof(msg), 0,
- UIO_SYSSPACE, ioflg, proc0.p_ucred, NULL, p);
+ UIO_SYSSPACE, ioflg, proc0.p_ucred, NULL, td);
if (error && (((ioflg & IO_NDELAY) == 0) || error != EAGAIN)) {
break;
@@ -224,7 +227,7 @@ nfs_dolock(ap)
break;
}
- if ((error1 = vn_close(wvp, FWRITE, proc0.p_ucred, p)) && error == 0)
+ if ((error1 = vn_close(wvp, FWRITE, proc0.p_ucred, td)) && error == 0)
return (error1);
return (error);