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
This commit is contained in:
rmacklem 2011-11-15 23:35:43 +00:00
parent 9f9ff5a473
commit 38a861b847

View File

@ -2580,6 +2580,16 @@ nfs_strategy(struct vop_strategy_args *ap)
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));
}