mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 19:57:43 +03:00
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 <bass6@llnl.gov> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #2804
This commit is contained in:
committed by
Brian Behlendorf
parent
88904bb3e3
commit
bc151f7b31
@@ -473,15 +473,6 @@ zfs_read(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
@@ -650,15 +641,6 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
|
||||
return (SET_ERROR(EINVAL));
|
||||
}
|
||||
|
||||
/*
|
||||
* 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.
|
||||
|
||||
Reference in New Issue
Block a user