From 2034f3b470ccfd4103737cf4d2a25a52ce9ad002 Mon Sep 17 00:00:00 2001 From: Nikolay Borisov Date: Fri, 27 Sep 2019 13:23:17 +0300 Subject: [PATCH] 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 Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba --- fs/btrfs/file.c | 10 +++------- 1 file 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)