diff options
author | ps <ps@FreeBSD.org> | 2009-06-08 21:23:54 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2009-06-08 21:23:54 +0000 |
commit | ae099c88f7861bc25232add17bd3b45cbcd2dce7 (patch) | |
tree | 0aab3ab07073d31e07902129e05eb637c62a659d /sys/kern/vfs_vnops.c | |
parent | c73264cfa4ed7bc2c45eff025ba203d7390c7e22 (diff) | |
download | FreeBSD-src-ae099c88f7861bc25232add17bd3b45cbcd2dce7.zip FreeBSD-src-ae099c88f7861bc25232add17bd3b45cbcd2dce7.tar.gz |
Simply shared vnode locking and extend it to also include fsync.
Also, in vop_write, no longer assert for exclusive locks on the
vnode.
Reviewed by: jhb, kmacy, jeffr
Diffstat (limited to 'sys/kern/vfs_vnops.c')
-rw-r--r-- | sys/kern/vfs_vnops.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 702faae..9ffb6a6 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -376,8 +376,8 @@ vn_rdwr(rw, vp, base, len, offset, segflg, ioflg, active_cred, file_cred, (error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) return (error); - if (mp != NULL && - (mp->mnt_kern_flag & MNTK_SHARED_WRITES)) { + if (MNT_SHARED_WRITES(mp) || + ((mp == NULL) && MNT_SHARED_WRITES(vp->v_mount))) { lock_flags = LK_SHARED; } else { lock_flags = LK_EXCLUSIVE; @@ -592,7 +592,8 @@ vn_write(fp, uio, active_cred, flags, td) (error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) goto unlock; - if (mp != NULL && (mp->mnt_kern_flag & MNTK_SHARED_WRITES) && + if ((MNT_SHARED_WRITES(mp) || + ((mp == NULL) && MNT_SHARED_WRITES(vp->v_mount))) && (flags & FOF_OFFSET) != 0) { lock_flags = LK_SHARED; } else { |