diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2009-05-22 15:01:47 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2009-05-22 15:01:47 +0000 |
commit | 7c92f3c6dc7ba86a3689e0ad152a11feba4ad5a5 (patch) | |
tree | 537979427c839da2a267af63fb5faabd9ef18d84 /sys/fs/nfsclient/nfs_clvnops.c | |
parent | f360591bdc06c18859c1e45424966d3502830a35 (diff) | |
download | FreeBSD-src-7c92f3c6dc7ba86a3689e0ad152a11feba4ad5a5.zip FreeBSD-src-7c92f3c6dc7ba86a3689e0ad152a11feba4ad5a5.tar.gz |
Change the code in the experimental nfs client to avoid flushing
writes upon close when a write delegation is held by the client.
This should be safe to do, now that nfsv4 Close operations are
delayed until ncl_inactive() is called for the vnode.
Approved by: kib (mentor)
Diffstat (limited to 'sys/fs/nfsclient/nfs_clvnops.c')
-rw-r--r-- | sys/fs/nfsclient/nfs_clvnops.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 4b320ac..047e3eb 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -687,12 +687,8 @@ nfs_close(struct vop_close_args *ap) int cm = newnfs_commit_on_close ? 1 : 0; error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, cm); /* np->n_flag &= ~NMODIFIED; */ - } else if (NFS_ISV4(vp)) { - int cm; - if (newnfs_commit_on_close != 0) - cm = 1; - else - cm = nfscl_mustflush(vp); + } else if (NFS_ISV4(vp) && nfscl_mustflush(vp)) { + int cm = newnfs_commit_on_close ? 1 : 0; error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, cm); /* as above w.r.t. races when clearing NMODIFIED */ /* np->n_flag &= ~NMODIFIED; */ |