svn commit: r229287 - stable/9/sys/fs/nfsclient

Rick Macklem rmacklem at FreeBSD.org
Mon Jan 2 16:54:22 UTC 2012


Author: rmacklem
Date: Mon Jan  2 16:54:21 2012
New Revision: 229287
URL: http://svn.freebsd.org/changeset/base/229287

Log:
  MFC: r227543
  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.

Modified:
  stable/9/sys/fs/nfsclient/nfs_clvnops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- stable/9/sys/fs/nfsclient/nfs_clvnops.c	Mon Jan  2 16:45:29 2012	(r229286)
+++ stable/9/sys/fs/nfsclient/nfs_clvnops.c	Mon Jan  2 16:54:21 2012	(r229287)
@@ -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-stable-9 mailing list