summaryrefslogtreecommitdiffstats
path: root/sys/nfs/nfs_lock.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2001-09-12 08:38:13 +0000
committerjulian <julian@FreeBSD.org>2001-09-12 08:38:13 +0000
commit5596676e6c6c1e81e899cd0531f9b1c28a292669 (patch)
treeb1a19fcdf05759281fab0d89efb13f0fdf42102e /sys/nfs/nfs_lock.c
parent83e00d4274950d2b531c24692cd123538ffbddb9 (diff)
downloadFreeBSD-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/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 e2fa91c..b97b3b8 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);
OpenPOWER on IntegriCloud