mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 10:54:35 +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
@@ -1546,7 +1546,6 @@ zfs_trunc(znode_t *zp, uint64_t end)
|
||||
int
|
||||
zfs_freesp(znode_t *zp, uint64_t off, uint64_t len, int flag, boolean_t log)
|
||||
{
|
||||
struct inode *ip = ZTOI(zp);
|
||||
dmu_tx_t *tx;
|
||||
zfs_sb_t *zsb = ZTOZSB(zp);
|
||||
zilog_t *zilog = zsb->z_log;
|
||||
@@ -1567,15 +1566,6 @@ zfs_freesp(znode_t *zp, uint64_t off, uint64_t len, int flag, boolean_t log)
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for any locks in the region to be freed.
|
||||
*/
|
||||
if (ip->i_flock && mandatory_lock(ip)) {
|
||||
uint64_t length = (len ? len : zp->z_size - off);
|
||||
if (!lock_may_write(ip, off, length))
|
||||
return (SET_ERROR(EAGAIN));
|
||||
}
|
||||
|
||||
if (len == 0) {
|
||||
error = zfs_trunc(zp, off);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user