aboutsummaryrefslogtreecommitdiffstats
path: root/fs/read_write.c
diff options
context:
space:
mode:
authorLukas Bulwahn <lukas.bulwahn@gmail.com>2021-08-24 13:12:59 +0200
committerJeff Layton <jlayton@kernel.org>2021-08-24 07:52:45 -0400
commit2949e8427af3bb74a1e26354cb68c1700663c827 (patch)
treef346f4ccd3c06204147845f4a54c5127507dc967 /fs/read_write.c
parentfs: remove mandatory file locking support (diff)
downloadlinux-dev-2949e8427af3bb74a1e26354cb68c1700663c827.tar.xz
linux-dev-2949e8427af3bb74a1e26354cb68c1700663c827.zip
fs: clean up after mandatory file locking support removal
Commit 3efee0567b4a ("fs: remove mandatory file locking support") removes some operations in functions rw_verify_area(). As these functions are now simplified, do some syntactic clean-up as follow-up to the removal as well, which was pointed out by compiler warnings and static analysis. No functional change. Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com> Signed-off-by: Jeff Layton <jlayton@kernel.org>
Diffstat (limited to 'fs/read_write.c')
-rw-r--r--fs/read_write.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/read_write.c b/fs/read_write.c
index ffe821b8588e..af057c57bdc6 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -365,12 +365,8 @@ out_putf:
int rw_verify_area(int read_write, struct file *file, const loff_t *ppos, size_t count)
{
- struct inode *inode;
- int retval = -EINVAL;
-
- inode = file_inode(file);
if (unlikely((ssize_t) count < 0))
- return retval;
+ return -EINVAL;
/*
* ranged mandatory locking does not apply to streams - it makes sense
@@ -381,12 +377,12 @@ int rw_verify_area(int read_write, struct file *file, const loff_t *ppos, size_t
if (unlikely(pos < 0)) {
if (!unsigned_offsets(file))
- return retval;
+ return -EINVAL;
if (count >= -pos) /* both values are in 0..LLONG_MAX */
return -EOVERFLOW;
} else if (unlikely((loff_t) (pos + count) < 0)) {
if (!unsigned_offsets(file))
- return retval;
+ return -EINVAL;
}
}