1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-20 11:11:24 +00:00

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:
Rick Macklem 2011-11-15 23:35:43 +00:00
parent 96ef942084
commit a5e583eea0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=227543

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));
}