diff options
author | jhb <jhb@FreeBSD.org> | 2002-02-27 19:18:10 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2002-02-27 19:18:10 +0000 |
commit | b8b3ac8816b79f4b10e71029cabb891ae0c33e03 (patch) | |
tree | 42d652ae46be9db4862eef10266827ddea3cb240 /sys/nfsclient | |
parent | 56094fdb72b398e3c7bcf13e638de2b00e5b0197 (diff) | |
download | FreeBSD-src-b8b3ac8816b79f4b10e71029cabb891ae0c33e03.zip FreeBSD-src-b8b3ac8816b79f4b10e71029cabb891ae0c33e03.tar.gz |
Use thread0.td_ucred instead of proc0.p_ucred. This change is cosmetic
and isn't strictly required. However, it lowers the number of false
positives found when grep'ing the kernel sources for p_ucred to ensure
proper locking.
Diffstat (limited to 'sys/nfsclient')
-rw-r--r-- | sys/nfsclient/nfs_lock.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/nfsclient/nfs_lock.c b/sys/nfsclient/nfs_lock.c index 2998463..4726c2c 100644 --- a/sys/nfsclient/nfs_lock.c +++ b/sys/nfsclient/nfs_lock.c @@ -156,7 +156,7 @@ nfs_dolock(struct vop_advlock_args *ap) NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, _PATH_LCKFIFO, td); fmode = FFLAGS(O_WRONLY); - error = vn_open_cred(&nd, &fmode, 0, proc0.p_ucred); + error = vn_open_cred(&nd, &fmode, 0, thread0.td_ucred); if (error != 0) { return (error == ENOENT ? EOPNOTSUPP : error); } @@ -166,10 +166,10 @@ nfs_dolock(struct vop_advlock_args *ap) ioflg = IO_UNIT; for (;;) { - VOP_LEASE(wvp, td, proc0.p_ucred, LEASE_WRITE); + VOP_LEASE(wvp, td, thread0.td_ucred, LEASE_WRITE); error = vn_rdwr(UIO_WRITE, wvp, (caddr_t)&msg, sizeof(msg), 0, - UIO_SYSSPACE, ioflg, proc0.p_ucred, NULL, td); + UIO_SYSSPACE, ioflg, thread0.td_ucred, NULL, td); if (error && (((ioflg & IO_NDELAY) == 0) || error != EAGAIN)) { break; @@ -219,7 +219,7 @@ nfs_dolock(struct vop_advlock_args *ap) break; } - if ((error1 = vn_close(wvp, FWRITE, proc0.p_ucred, td)) && error == 0) + if ((error1 = vn_close(wvp, FWRITE, thread0.td_ucred, td)) && error == 0) return (error1); return (error); |