svn commit: r227543 - head/sys/fs/nfsclient
Rick Macklem
rmacklem at FreeBSD.org
Tue Nov 15 23:35:44 UTC 2011
Author: rmacklem
Date: Tue Nov 15 23:35:43 2011
New Revision: 227543
URL: http://svn.freebsd.org/changeset/base/227543
Log:
Modify the new NFS client so that nfs_fsync() only calls ncl_flush()
for regular files. Since other file types don't write into the
buffer cache, calling ncl_flush() is almost a no-op. However, it does
clear the NMODIFIED flag and this shouldn't be done by nfs_fsync() for
directories.
MFC after: 2 weeks
Modified:
head/sys/fs/nfsclient/nfs_clvnops.c
Modified: head/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvnops.c Tue Nov 15 23:32:30 2011 (r227542)
+++ head/sys/fs/nfsclient/nfs_clvnops.c Tue Nov 15 23:35:43 2011 (r227543)
@@ -2580,6 +2580,16 @@ nfs_strategy(struct vop_strategy_args *a
static int
nfs_fsync(struct vop_fsync_args *ap)
{
+
+ if (ap->a_vp->v_type != VREG) {
+ /*
+ * For NFS, metadata is changed synchronously on the server,
+ * so there is nothing to flush. Also, ncl_flush() clears
+ * the NMODIFIED flag and that shouldn't be done here for
+ * directories.
+ */
+ return (0);
+ }
return (ncl_flush(ap->a_vp, ap->a_waitfor, NULL, ap->a_td, 1, 0));
}
More information about the svn-src-all
mailing list