]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: rename variables for locked range in defrag_prepare_one_folio()
authorDavid Sterba <dsterba@suse.com>
Tue, 10 Jun 2025 12:17:51 +0000 (14:17 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jul 2025 21:58:01 +0000 (23:58 +0200)
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>
fs/btrfs/defrag.c

index 6dca263b224e87c0bc6a1e8d608f12b8c6b0b5a2..faa563ee300049845101aa0733d86498cf933cd0 100644 (file)
@@ -848,8 +848,8 @@ static struct folio *defrag_prepare_one_folio(struct btrfs_inode *inode, pgoff_t
 {
        struct address_space *mapping = inode->vfs_inode.i_mapping;
        gfp_t mask = btrfs_alloc_write_mask(mapping);
-       u64 folio_start;
-       u64 folio_end;
+       u64 lock_start;
+       u64 lock_end;
        struct extent_state *cached_state = NULL;
        struct folio *folio;
        int ret;
@@ -885,15 +885,15 @@ again:
                return ERR_PTR(ret);
        }
 
-       folio_start = folio_pos(folio);
-       folio_end = folio_pos(folio) + folio_size(folio) - 1;
+       lock_start = folio_pos(folio);
+       lock_end = folio_pos(folio) + folio_size(folio) - 1;
        /* Wait for any existing ordered extent in the range */
        while (1) {
                struct btrfs_ordered_extent *ordered;
 
-               btrfs_lock_extent(&inode->io_tree, folio_start, folio_end, &cached_state);
-               ordered = btrfs_lookup_ordered_range(inode, folio_start, folio_size(folio));
-               btrfs_unlock_extent(&inode->io_tree, folio_start, folio_end, &cached_state);
+               btrfs_lock_extent(&inode->io_tree, lock_start, lock_end, &cached_state);
+               ordered = btrfs_lookup_ordered_range(inode, lock_start, folio_size(folio));
+               btrfs_unlock_extent(&inode->io_tree, lock_start, lock_end, &cached_state);
                if (!ordered)
                        break;