summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient/nfs_bio.c
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2004-12-06 21:11:15 +0000
committerps <ps@FreeBSD.org>2004-12-06 21:11:15 +0000
commiteeccf3813d92c16c33f1985fb7edf26c7c20c808 (patch)
tree83e874ad8aa3b9b3120558628b84b3010046974d /sys/nfsclient/nfs_bio.c
parent2b5157cd0d38228760370d2fcb197f915ce3b93d (diff)
downloadFreeBSD-src-eeccf3813d92c16c33f1985fb7edf26c7c20c808.zip
FreeBSD-src-eeccf3813d92c16c33f1985fb7edf26c7c20c808.tar.gz
Rewrite of the NFS client's reply handling. We now have NFS socket
upcalls which do RPC header parsing and match up the reply with the request. NFS calls now sleep on the nfsreq structure. This enables us to eliminate the NFS recvlock. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
Diffstat (limited to 'sys/nfsclient/nfs_bio.c')
-rw-r--r--sys/nfsclient/nfs_bio.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c
index bc2cf53..9e9af49 100644
--- a/sys/nfsclient/nfs_bio.c
+++ b/sys/nfsclient/nfs_bio.c
@@ -1036,7 +1036,11 @@ nfs_getcacheblk(struct vnode *vp, daddr_t bn, int size, struct thread *td)
nmp = VFSTONFS(mp);
if (nmp->nm_flag & NFSMNT_INT) {
+ sigset_t oldset;
+
+ nfs_set_sigmask(td, &oldset);
bp = getblk(vp, bn, size, PCATCH, 0, 0);
+ nfs_restore_sigmask(td, &oldset);
while (bp == NULL) {
if (nfs_sigintr(nmp, NULL, td))
return (NULL);
@@ -1208,8 +1212,8 @@ again:
NFS_DPF(ASYNCIO,
("nfs_asyncio: waiting for mount %p queue to drain\n", nmp));
nmp->nm_bufqwant = TRUE;
- error = tsleep(&nmp->nm_bufq, slpflag | PRIBIO,
- "nfsaio", slptimeo);
+ error = nfs_tsleep(td, &nmp->nm_bufq, slpflag | PRIBIO,
+ "nfsaio", slptimeo);
if (error) {
error2 = nfs_sigintr(nmp, NULL, td);
if (error2)
@@ -1511,6 +1515,8 @@ nfs_meta_setsize(struct vnode *vp, struct ucred *cred, struct thread *td, u_quad
lbn = nsize / biosize;
bufsize = nsize & (biosize - 1);
bp = nfs_getcacheblk(vp, lbn, bufsize, td);
+ if (!bp)
+ return EINTR;
if (bp->b_dirtyoff > bp->b_bcount)
bp->b_dirtyoff = bp->b_bcount;
if (bp->b_dirtyend > bp->b_bcount)
OpenPOWER on IntegriCloud