summaryrefslogtreecommitdiff
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2017-11-01 11:36:05 +0200
committerDavid Sterba <dsterba@suse.com>2018-01-22 16:08:11 +0100
commit96b09dde92515956c992c1b330f00399487f47b3 (patch)
treea3f3128f2a0d13ca7b6a46f43b2c62210320ae8f /fs/btrfs/file.c
parent6b7d6e933433a43062ce9355a4126b59bd2519e3 (diff)
btrfs: Use locked_end rather than open coding it
Right before we go into this loop locked_end is set to alloc_end - 1 and is being used in nearby functions, no need to have exceptions. This just makes the code consistent, no functional changes. 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/btrfs/file.c')
-rw-r--r--fs/btrfs/file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 89fb9eff714f..559d716221df 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -2896,8 +2896,8 @@ static long btrfs_fallocate(struct file *file, int mode,
*/
lock_extent_bits(&BTRFS_I(inode)->io_tree, alloc_start,
locked_end, &cached_state);
- ordered = btrfs_lookup_first_ordered_extent(inode,
- alloc_end - 1);
+ ordered = btrfs_lookup_first_ordered_extent(inode, locked_end);
+
if (ordered &&
ordered->file_offset + ordered->len > alloc_start &&
ordered->file_offset < alloc_end) {