diff options
author | ps <ps@FreeBSD.org> | 2004-12-06 16:35:58 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2004-12-06 16:35:58 +0000 |
commit | ebd6438ae16fb25f9f0412f8b01b740ca32cb53c (patch) | |
tree | e4186f768c6ef39be01f575f676dc0f1dba1a306 /sys/nfsclient/nfs_vnops.c | |
parent | a98750ac1b62fbe60d03f1bcd66f4e61da67d5bd (diff) | |
download | FreeBSD-src-ebd6438ae16fb25f9f0412f8b01b740ca32cb53c.zip FreeBSD-src-ebd6438ae16fb25f9f0412f8b01b740ca32cb53c.tar.gz |
- If all data has been committed to stable storage on the server, it
is safe to turn off the nfsnode's NMODIFIED flag.
- Move the check for signals to the top of the loop where we loop
around the dirty buffers on the vnode, scheduling writes. This
ensures that we'll break ouf of the flush operation on reception of
a signal.
Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
Diffstat (limited to 'sys/nfsclient/nfs_vnops.c')
-rw-r--r-- | sys/nfsclient/nfs_vnops.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c index 48153d8..50e1496 100644 --- a/sys/nfsclient/nfs_vnops.c +++ b/sys/nfsclient/nfs_vnops.c @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include <sys/sysctl.h> #include <vm/vm.h> +#include <vm/vm_object.h> #include <vm/vm_extern.h> #include <vm/vm_object.h> @@ -2815,6 +2816,10 @@ loop: s = splbio(); VI_LOCK(vp); TAILQ_FOREACH_SAFE(bp, &vp->v_bufobj.bo_dirty.bv_hd, b_bobufs, nbp) { + if (nfs_sigintr(nmp, NULL, td)) { + error = EINTR; + goto done; + } if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL)) { if (waitfor != MNT_WAIT || passone) continue; @@ -2827,9 +2832,6 @@ loop: panic("nfs_fsync: inconsistent lock"); if (error == ENOLCK) goto loop; - error = nfs_sigintr(nmp, NULL, td); - if (error) - goto done; if (slpflag == PCATCH) { slpflag = 0; slptimeo = 2 * hz; @@ -2883,6 +2885,8 @@ loop: error = np->n_error; np->n_flag &= ~NWRITEERR; } + if (commit && vp->v_bufobj.bo_dirty.bv_cnt == 0) + np->n_flag &= ~NMODIFIED; done: if (bvec != NULL && bvec != bvec_on_stack) free(bvec, M_TEMP); |