diff options
-rw-r--r-- | sys/fs/ext2fs/ext2_vfsops.c | 3 | ||||
-rw-r--r-- | sys/fs/fuse/fuse_vfsops.c | 1 | ||||
-rw-r--r-- | sys/fs/msdosfs/msdosfs_vfsops.c | 1 | ||||
-rw-r--r-- | sys/fs/nandfs/nandfs_vfsops.c | 1 | ||||
-rw-r--r-- | sys/fs/nfsclient/nfs_clvfsops.c | 3 | ||||
-rw-r--r-- | sys/fs/nfsserver/nfs_nfsdport.c | 5 | ||||
-rw-r--r-- | sys/fs/nullfs/null_vfsops.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 1 | ||||
-rw-r--r-- | sys/sys/mount.h | 1 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 2 |
10 files changed, 16 insertions, 4 deletions
diff --git a/sys/fs/ext2fs/ext2_vfsops.c b/sys/fs/ext2fs/ext2_vfsops.c index d55bc56..ce943ea 100644 --- a/sys/fs/ext2fs/ext2_vfsops.c +++ b/sys/fs/ext2fs/ext2_vfsops.c @@ -661,7 +661,8 @@ ext2_mountfs(struct vnode *devvp, struct mount *mp) * Initialize filesystem stat information in mount struct. */ MNT_ILOCK(mp); - mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED; + mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED | + MNTK_USES_BCACHE; MNT_IUNLOCK(mp); return (0); out: diff --git a/sys/fs/fuse/fuse_vfsops.c b/sys/fs/fuse/fuse_vfsops.c index c00a96c..0a33373 100644 --- a/sys/fs/fuse/fuse_vfsops.c +++ b/sys/fs/fuse/fuse_vfsops.c @@ -337,6 +337,7 @@ fuse_vfsop_mount(struct mount *mp) MNT_ILOCK(mp); mp->mnt_data = data; mp->mnt_flag |= MNT_LOCAL; + mp->mnt_kern_flag |= MNTK_USES_BCACHE; MNT_IUNLOCK(mp); /* We need this here as this slot is used by getnewvnode() */ mp->mnt_stat.f_iosize = PAGE_SIZE; diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index 1165934..7c6d3ed 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -759,6 +759,7 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp) mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum; MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; + mp->mnt_kern_flag |= MNTK_USES_BCACHE; MNT_IUNLOCK(mp); if (pmp->pm_flags & MSDOSFS_LARGEFS) diff --git a/sys/fs/nandfs/nandfs_vfsops.c b/sys/fs/nandfs/nandfs_vfsops.c index fd9b0c9..8585e6e 100644 --- a/sys/fs/nandfs/nandfs_vfsops.c +++ b/sys/fs/nandfs/nandfs_vfsops.c @@ -1385,6 +1385,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 */ diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c index 462d762..6ce469d 100644 --- a/sys/fs/nfsclient/nfs_clvfsops.c +++ b/sys/fs/nfsclient/nfs_clvfsops.c @@ -1193,7 +1193,8 @@ nfs_mount(struct mount *mp) out: if (!error) { MNT_ILOCK(mp); - mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_NO_IOPF; + mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_NO_IOPF | + MNTK_USES_BCACHE; MNT_IUNLOCK(mp); } return (error); diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index c94d425..cae2e9f 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -1270,8 +1270,11 @@ nfsvno_fsync(struct vnode *vp, u_int64_t off, int cnt, struct ucred *cred, * file is done. At this time VOP_FSYNC does not accept offset and * byte count parameters so call VOP_FSYNC the whole file for now. * The same is true for NFSv4: RFC 3530 Sec. 14.2.3. + * File systems that do not use the buffer cache (as indicated + * by MNTK_USES_BCACHE not being set) must use VOP_FSYNC(). */ - if (cnt == 0 || cnt > MAX_COMMIT_COUNT) { + if (cnt == 0 || cnt > MAX_COMMIT_COUNT || + (vp->v_mount->mnt_kern_flag & MNTK_USES_BCACHE) == 0) { /* * Give up and do the whole thing */ diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index 80824a5..64e1e29 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -198,6 +198,8 @@ nullfs_mount(struct mount *mp) MNTK_EXTENDED_SHARED); } mp->mnt_kern_flag |= MNTK_LOOKUP_EXCL_DOTDOT; + mp->mnt_kern_flag |= lowerrootvp->v_mount->mnt_kern_flag & + MNTK_USES_BCACHE; MNT_IUNLOCK(mp); mp->mnt_data = xmp; vfs_getnewfsid(mp); diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 5fa2da2..7b625be 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -3138,6 +3138,7 @@ DB_SHOW_COMMAND(mount, db_show_mount) MNT_KERN_FLAG(MNTK_VGONE_WAITER); MNT_KERN_FLAG(MNTK_LOOKUP_EXCL_DOTDOT); MNT_KERN_FLAG(MNTK_MARKER); + MNT_KERN_FLAG(MNTK_USES_BCACHE); MNT_KERN_FLAG(MNTK_NOASYNC); MNT_KERN_FLAG(MNTK_UNMOUNT); MNT_KERN_FLAG(MNTK_MWAIT); diff --git a/sys/sys/mount.h b/sys/sys/mount.h index a78e924..b57d47d 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -355,6 +355,7 @@ void __mnt_vnode_markerfree_active(struct vnode **mvp, struct mount *); #define MNTK_LOOKUP_EXCL_DOTDOT 0x00000800 #define MNTK_MARKER 0x00001000 #define MNTK_UNMAPPED_BUFS 0x00002000 +#define MNTK_USES_BCACHE 0x00004000 /* FS uses the buffer cache. */ #define MNTK_NOASYNC 0x00800000 /* disable async */ #define MNTK_UNMOUNT 0x01000000 /* unmount in progress */ #define MNTK_MWAIT 0x02000000 /* waiting for unmount to finish */ diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 881da62..c0b6c9f 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1055,7 +1055,7 @@ ffs_mountfs(devvp, mp, td) */ MNT_ILOCK(mp); mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_EXTENDED_SHARED | - MNTK_NO_IOPF | MNTK_UNMAPPED_BUFS; + MNTK_NO_IOPF | MNTK_UNMAPPED_BUFS | MNTK_USES_BCACHE; MNT_IUNLOCK(mp); #ifdef UFS_EXTATTR #ifdef UFS_EXTATTR_AUTOSTART |