linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs: Use locked_end rather than open coding it
@ 2017-11-01  9:36 Nikolay Borisov
  2017-11-01 18:02 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Nikolay Borisov @ 2017-11-01  9:36 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Nikolay Borisov

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(-)

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) {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] btrfs: Use locked_end rather than open coding it
  2017-11-01  9:36 [PATCH] btrfs: Use locked_end rather than open coding it Nikolay Borisov
@ 2017-11-01 18:02 ` David Sterba
  0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2017-11-01 18:02 UTC (permalink / raw)
  To: Nikolay Borisov; +Cc: linux-btrfs

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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-01 18:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-01  9:36 [PATCH] btrfs: Use locked_end rather than open coding it Nikolay Borisov
2017-11-01 18:02 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).