Author: rmacklem
Date: Tue Jan  3 04:12:40 2012
New Revision: 229365
URL: http://svn.freebsd.org/changeset/base/229365

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/8/sys/fs/nfsclient/nfs_clvnops.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/conf/ldscript.mips.octeon1.32   (props changed)
  stable/8/sys/conf/ldscript.mips.octeon1.64   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- stable/8/sys/fs/nfsclient/nfs_clvnops.c     Tue Jan  3 03:38:50 2012        
(r229364)
+++ stable/8/sys/fs/nfsclient/nfs_clvnops.c     Tue Jan  3 04:12:40 2012        
(r229365)
@@ -2516,6 +2516,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));
 }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to