diff options
author | Christoph Hellwig <hch@lst.de> | 2015-12-03 12:59:49 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-12-08 05:09:16 +0100 |
commit | acc15575e78e534c12549d8057a692f490a50f61 (patch) | |
tree | a177119e84264c8a8db1e04090f97a7335ccfc69 /fs/read_write.c | |
parent | vfs: Add vfs_copy_file_range() support for pagecache copies (diff) | |
download | linux-acc15575e78e534c12549d8057a692f490a50f61.tar.xz linux-acc15575e78e534c12549d8057a692f490a50f61.zip |
locks: new locks_mandatory_area calling convention
Pass a loff_t end for the last byte instead of the 32-bit count
parameter to allow full file clones even on 32-bit architectures.
While we're at it also simplify the read/write selection.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: J. Bruce Fields <bfields@fieldses.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/read_write.c')
-rw-r--r-- | fs/read_write.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/read_write.c b/fs/read_write.c index c81ef394a3d4..6cfad4761fd8 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -396,9 +396,8 @@ int rw_verify_area(int read_write, struct file *file, const loff_t *ppos, size_t } if (unlikely(inode->i_flctx && mandatory_lock(inode))) { - retval = locks_mandatory_area( - read_write == READ ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE, - inode, file, pos, count); + retval = locks_mandatory_area(inode, file, pos, pos + count - 1, + read_write == READ ? F_RDLCK : F_WRLCK); if (retval < 0) return retval; } |