aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorNikolay Borisov2019-09-27 13:23:17 +0300
committerDavid Sterba2019-11-18 12:46:59 +0100
commit2034f3b470ccfd4103737cf4d2a25a52ce9ad002 (patch)
treee9163a8945d34b559698e6c4aa136bf1e08e3998 /fs
parentd79b7c26b12279038b8b84bfcbe7bb3e53382b3f (diff)
btrfs: Simplify btrfs_file_llseek
Handle SEEK_END/SEEK_CUR in a single 'default' case by directly returning from generic_file_llseek. This makes the 'out' label redundant. Finally return directly the vale from vfs_setpos. No semantic changes. Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/file.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 35cfc738f6b7..949212289c89 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -3422,10 +3422,8 @@ static loff_t btrfs_file_llseek(struct file *file, loff_t offset, int whence)
int ret;
switch (whence) {
- case SEEK_END:
- case SEEK_CUR:
- offset = generic_file_llseek(file, offset, whence);
- goto out;
+ default:
+ return generic_file_llseek(file, offset, whence);
case SEEK_DATA:
case SEEK_HOLE:
inode_lock_shared(inode);
@@ -3436,9 +3434,7 @@ static loff_t btrfs_file_llseek(struct file *file, loff_t offset, int whence)
return ret;
}
- offset = vfs_setpos(file, offset, inode->i_sb->s_maxbytes);
-out:
- return offset;
+ return vfs_setpos(file, offset, inode->i_sb->s_maxbytes);
}
static int btrfs_file_open(struct inode *inode, struct file *filp)