diff mbox

btrfs: Use locked_end rather than open coding it

Message ID 1509528965-4818-1-git-send-email-nborisov@suse.com (mailing list archive)
State New, archived
Headers show

Commit Message

Nikolay Borisov Nov. 1, 2017, 9:36 a.m. UTC
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>
---
 fs/btrfs/file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

David Sterba Nov. 1, 2017, 6:02 p.m. UTC | #1
On Wed, Nov 01, 2017 at 11:36:05AM +0200, Nikolay Borisov wrote:
> 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>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index ecbe186cb5da..2a18a5f9c68e 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -3142,8 +3142,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) {