]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: remove do_list variable at btrfs_set_delalloc_extent()
authorFilipe Manana <fdmanana@suse.com>
Fri, 9 Feb 2024 12:35:20 +0000 (12:35 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 4 Mar 2024 15:24:50 +0000 (16:24 +0100)
The "do_list" variable is only used once, plus its name/meaning is a bit
confusing, so remove it and directory use btrfs_is_free_space_inode().

Reviewed-by: Boris Burkov <boris@bur.io>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c

index 04d836673e1270ba31fb853ab75eea7753bb9a5f..27dd909e755e707c73e221b50c768d40c1b2c6a8 100644 (file)
@@ -2462,7 +2462,6 @@ void btrfs_set_delalloc_extent(struct btrfs_inode *inode, struct extent_state *s
                u64 len = state->end + 1 - state->start;
                u64 prev_delalloc_bytes;
                u32 num_extents = count_max_extents(fs_info, len);
-               bool do_list = !btrfs_is_free_space_inode(inode);
 
                spin_lock(&inode->lock);
                btrfs_mod_outstanding_extents(inode, num_extents);
@@ -2487,7 +2486,7 @@ void btrfs_set_delalloc_extent(struct btrfs_inode *inode, struct extent_state *s
                 * and are therefore protected against concurrent calls of this
                 * function and btrfs_clear_delalloc_extent().
                 */
-               if (do_list && prev_delalloc_bytes == 0)
+               if (!btrfs_is_free_space_inode(inode) && prev_delalloc_bytes == 0)
                        btrfs_add_delalloc_inode(inode);
        }