From ad77d0b1c1c3c09a9bf76bebb397102d08ed35c6 Mon Sep 17 00:00:00 2001 From: rmacklem Date: Wed, 15 Apr 2015 20:16:31 +0000 Subject: File systems that do not use the buffer cache (such as ZFS) must use VOP_FSYNC() to perform the NFS server's Commit operation. This patch adds a mnt_kern_flag called MNTK_USES_BCACHE which is set by file systems that use the buffer cache. If this flag is not set, the NFS server always does a VOP_FSYNC(). This should be ok for old file system modules that do not set MNTK_USES_BCACHE, since calling VOP_FSYNC() is correct, although it might not be optimal for file systems that use the buffer cache. Reviewed by: kib MFC after: 2 weeks --- sys/fs/nandfs/nandfs_vfsops.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sys/fs/nandfs') diff --git a/sys/fs/nandfs/nandfs_vfsops.c b/sys/fs/nandfs/nandfs_vfsops.c index eb07d4f..7132635 100644 --- a/sys/fs/nandfs/nandfs_vfsops.c +++ b/sys/fs/nandfs/nandfs_vfsops.c @@ -1391,6 +1391,7 @@ nandfs_mountfs(struct vnode *devvp, struct mount *mp) nmp->nm_ronly = ronly; MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; + mp->mnt_kern_flag |= MNTK_USES_BCACHE; MNT_IUNLOCK(mp); nmp->nm_nandfsdev = nandfsdev; /* Add our mountpoint */ -- cgit v1.1