diff options
author | kib <kib@FreeBSD.org> | 2009-07-14 22:54:29 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2009-07-14 22:54:29 +0000 |
commit | 50c96d8f042d19384144c442c22ee0e0a7314ca9 (patch) | |
tree | a0fd9946a1d3f491996b7e401f7dd0872d11817a /sys/nfsclient | |
parent | c7441b67e68fb8dbdec2ca853f77acf72e7cf0e9 (diff) | |
download | FreeBSD-src-50c96d8f042d19384144c442c22ee0e0a7314ca9.zip FreeBSD-src-50c96d8f042d19384144c442c22ee0e0a7314ca9.tar.gz |
Use PBDRY flag for msleep(9) in NFS and NLM when sleeping thread owns
kernel resources that block other threads, like vnode locks. The SIGSTOP
sent to such thread (process, rather) shall not stop it until thread
releases the resources.
Tested by: pho
Reviewed by: jhb
Approved by: re (kensmith)
Diffstat (limited to 'sys/nfsclient')
-rw-r--r-- | sys/nfsclient/nfs_bio.c | 8 | ||||
-rw-r--r-- | sys/nfsclient/nfs_vnops.c | 6 | ||||
-rw-r--r-- | sys/nfsclient/nfsmount.h | 2 |
3 files changed, 9 insertions, 7 deletions
diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c index c803d68..945bc51 100644 --- a/sys/nfsclient/nfs_bio.c +++ b/sys/nfsclient/nfs_bio.c @@ -1254,7 +1254,7 @@ nfs_getcacheblk(struct vnode *vp, daddr_t bn, int size, struct thread *td) sigset_t oldset; nfs_set_sigmask(td, &oldset); - bp = getblk(vp, bn, size, PCATCH, 0, 0); + bp = getblk(vp, bn, size, NFS_PCATCH, 0, 0); nfs_restore_sigmask(td, &oldset); while (bp == NULL) { if (nfs_sigintr(nmp, td)) @@ -1291,7 +1291,7 @@ nfs_vinvalbuf(struct vnode *vp, int flags, struct thread *td, int intrflg) if ((nmp->nm_flag & NFSMNT_INT) == 0) intrflg = 0; if (intrflg) { - slpflag = PCATCH; + slpflag = NFS_PCATCH; slptimeo = 2 * hz; } else { slpflag = 0; @@ -1370,7 +1370,7 @@ nfs_asyncio(struct nfsmount *nmp, struct buf *bp, struct ucred *cred, struct thr } again: if (nmp->nm_flag & NFSMNT_INT) - slpflag = PCATCH; + slpflag = NFS_PCATCH; gotiod = FALSE; /* @@ -1439,7 +1439,7 @@ again: mtx_unlock(&nfs_iod_mtx); return (error2); } - if (slpflag == PCATCH) { + if (slpflag == NFS_PCATCH) { slpflag = 0; slptimeo = 2 * hz; } diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index d644836..692b38b 100644 --- a/sys/nfsclient/nfs_vnops.c +++ b/sys/nfsclient/nfs_vnops.c @@ -2934,7 +2934,7 @@ nfs_flush(struct vnode *vp, int waitfor, int commit) int bvecsize = 0, bveccount; if (nmp->nm_flag & NFSMNT_INT) - slpflag = PCATCH; + slpflag = NFS_PCATCH; if (!commit) passone = 0; bo = &vp->v_bufobj; @@ -3132,7 +3132,7 @@ loop: error = EINTR; goto done; } - if (slpflag == PCATCH) { + if (slpflag & PCATCH) { slpflag = 0; slptimeo = 2 * hz; } @@ -3170,7 +3170,7 @@ loop: error = nfs_sigintr(nmp, td); if (error) goto done; - if (slpflag == PCATCH) { + if (slpflag & PCATCH) { slpflag = 0; slptimeo = 2 * hz; } diff --git a/sys/nfsclient/nfsmount.h b/sys/nfsclient/nfsmount.h index 99d12d9..47d7ef3 100644 --- a/sys/nfsclient/nfsmount.h +++ b/sys/nfsclient/nfsmount.h @@ -107,6 +107,8 @@ struct nfsmount { #define NFS_TPRINTF_DELAY 30 #endif +#define NFS_PCATCH (PCATCH | PBDRY) + #endif #endif |