aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/zfs_vnops.c
diff options
context:
space:
mode:
authorNed Bass <[email protected]>2014-10-16 13:52:56 -0700
committerBrian Behlendorf <[email protected]>2014-10-22 11:06:53 -0700
commitbc151f7b312dea09c6ec5b9a320e65140789643a (patch)
tree1c238332d6eed1b2c0b722191b6967cc189d9b1f /module/zfs/zfs_vnops.c
parent88904bb3e3f4a385108343aee1ac7ee0d83e25dc (diff)
Remove checks for mandatory locks
The Linux VFS handles mandatory locks generically so we shouldn't need to check for conflicting locks in zfs_read(), zfs_write(), or zfs_freesp(). Linux 3.18 removed the lock_may_read() and lock_may_write() interfaces which we were relying on for this purpose. Rather than emulating those interfaces we remove the redundant checks. Signed-off-by: Ned Bass <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #2804
Diffstat (limited to 'module/zfs/zfs_vnops.c')
-rw-r--r--module/zfs/zfs_vnops.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c
index 33f9e0ec9..2f55e562e 100644
--- a/module/zfs/zfs_vnops.c
+++ b/module/zfs/zfs_vnops.c
@@ -474,15 +474,6 @@ zfs_read(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
}
/*
- * Check for mandatory locks
- */
- if (mandatory_lock(ip) &&
- !lock_may_read(ip, uio->uio_loffset, uio->uio_resid)) {
- ZFS_EXIT(zsb);
- return (SET_ERROR(EAGAIN));
- }
-
- /*
* If we're in FRSYNC mode, sync out this znode before reading it.
*/
if (ioflag & FRSYNC || zsb->z_os->os_sync == ZFS_SYNC_ALWAYS)
@@ -651,15 +642,6 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
}
/*
- * Check for mandatory locks before calling zfs_range_lock()
- * in order to prevent a deadlock with locks set via fcntl().
- */
- if (mandatory_lock(ip) && !lock_may_write(ip, woff, n)) {
- ZFS_EXIT(zsb);
- return (SET_ERROR(EAGAIN));
- }
-
- /*
* Pre-fault the pages to ensure slow (eg NFS) pages
* don't hold up txg.
* Skip this if uio contains loaned arc_buf.