Skip to content

Commit c9ed36a

Browse files
committed
btrfs: rename variables for locked range in defrag_prepare_one_folio()
In preparation to use a helper for folio_pos + folio_size, rename the variables for the locked range so they don't use the 'folio_' prefix. As the locking ranges take inclusive end of the range (hence the "-1") this would be confusing as the folio helpers typically use exclusive end of the range. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 1892833 commit c9ed36a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

fs/btrfs/defrag.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -848,8 +848,8 @@ static struct folio *defrag_prepare_one_folio(struct btrfs_inode *inode, pgoff_t
848848
{
849849
struct address_space *mapping = inode->vfs_inode.i_mapping;
850850
gfp_t mask = btrfs_alloc_write_mask(mapping);
851-
u64 folio_start;
852-
u64 folio_end;
851+
u64 lock_start;
852+
u64 lock_end;
853853
struct extent_state *cached_state = NULL;
854854
struct folio *folio;
855855
int ret;
@@ -885,15 +885,15 @@ static struct folio *defrag_prepare_one_folio(struct btrfs_inode *inode, pgoff_t
885885
return ERR_PTR(ret);
886886
}
887887

888-
folio_start = folio_pos(folio);
889-
folio_end = folio_pos(folio) + folio_size(folio) - 1;
888+
lock_start = folio_pos(folio);
889+
lock_end = folio_pos(folio) + folio_size(folio) - 1;
890890
/* Wait for any existing ordered extent in the range */
891891
while (1) {
892892
struct btrfs_ordered_extent *ordered;
893893

894-
btrfs_lock_extent(&inode->io_tree, folio_start, folio_end, &cached_state);
895-
ordered = btrfs_lookup_ordered_range(inode, folio_start, folio_size(folio));
896-
btrfs_unlock_extent(&inode->io_tree, folio_start, folio_end, &cached_state);
894+
btrfs_lock_extent(&inode->io_tree, lock_start, lock_end, &cached_state);
895+
ordered = btrfs_lookup_ordered_range(inode, lock_start, folio_size(folio));
896+
btrfs_unlock_extent(&inode->io_tree, lock_start, lock_end, &cached_state);
897897
if (!ordered)
898898
break;
899899

0 commit comments

Comments
 (0)