Skip to content

Commit 3c74920

Browse files
fdmananakdave
authored andcommitted
btrfs: use fs_info from local variable in btrfs_convert_free_space_to_extents()
There's no need to dereference the block group to extract fs_info as we have already stored fs_info in a local variable. So use the local variable instead. Reviewed-by: Boris Burkov <boris@bur.io> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent c26634e commit 3c74920

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/btrfs/free-space-tree.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,16 +438,16 @@ int btrfs_convert_free_space_to_extents(struct btrfs_trans_handle *trans,
438438
expected_extent_count = btrfs_free_space_extent_count(leaf, info);
439439
btrfs_release_path(path);
440440

441-
nrbits = block_group->length >> block_group->fs_info->sectorsize_bits;
441+
nrbits = block_group->length >> fs_info->sectorsize_bits;
442442
start_bit = find_next_bit_le(bitmap, nrbits, 0);
443443

444444
while (start_bit < nrbits) {
445445
end_bit = find_next_zero_bit_le(bitmap, nrbits, start_bit);
446446
ASSERT(start_bit < end_bit);
447447

448-
key.objectid = start + start_bit * block_group->fs_info->sectorsize;
448+
key.objectid = start + start_bit * fs_info->sectorsize;
449449
key.type = BTRFS_FREE_SPACE_EXTENT_KEY;
450-
key.offset = (end_bit - start_bit) * block_group->fs_info->sectorsize;
450+
key.offset = (end_bit - start_bit) * fs_info->sectorsize;
451451

452452
ret = btrfs_insert_empty_item(trans, root, path, &key, 0);
453453
if (ret) {

0 commit comments

Comments
 (0)