From: Nikolay Borisov <nborisov@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH 2/3] btrfs: Simplify btrfs_file_llseek
Date: Thu, 26 Sep 2019 14:39:52 +0300 [thread overview]
Message-ID: <20190926113953.19569-3-nborisov@suse.com> (raw)
In-Reply-To: <20190926113953.19569-1-nborisov@suse.com>
Handle SEEK_END/SEEK_CUR in a single 'default' case by directly
returning from generic_file_llsee. This makes the 'out' label redundant.
Finally return directly the vale from vfs_setpos. No semantic changesl.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
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 31111a94251a..8845403287ed 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -3413,10 +3413,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:
if (offset >= i_size_read(inode))
@@ -3427,9 +3425,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)
--
2.17.1
next prev parent reply other threads:[~2019-09-26 11:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-26 11:39 [PATCH 0/3] Improve btrfs llseek implementation Nikolay Borisov
2019-09-26 11:39 ` [PATCH 1/3] btrfs: Speed up btrfs_file_llseek Nikolay Borisov
2019-09-26 18:27 ` Josef Bacik
2019-09-26 11:39 ` Nikolay Borisov [this message]
2019-09-26 12:02 ` [PATCH 2/3] btrfs: Simplify btrfs_file_llseek Johannes Thumshirn
2019-09-26 18:27 ` Josef Bacik
2019-09-26 11:39 ` [PATCH 3/3] btrfs: Return offset from find_desired_extent Nikolay Borisov
2019-09-26 12:04 ` Johannes Thumshirn
2019-09-26 18:28 ` Josef Bacik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190926113953.19569-3-nborisov@suse.com \
--to=nborisov@suse.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox