Skip to content

Commit b7ff7b0

Browse files
fdmananakdave
authored andcommitted
btrfs: simplify inline extent end calculation at replay_one_extent()
There is no need to store the extent's ram_bytes in two variables, further more one of them, named 'size', is used only for the extent's end offset calculation. So remove the 'size' variable and use 'nbytes' only. Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent a35b3dd commit b7ff7b0

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

fs/btrfs/tree-log.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,6 @@ static noinline int replay_one_extent(struct walk_control *wc)
732732
struct btrfs_key ins;
733733
struct btrfs_file_extent_item *item;
734734
struct btrfs_inode *inode = NULL;
735-
unsigned long size;
736735
int ret = 0;
737736

738737
item = btrfs_item_ptr(wc->log_leaf, wc->log_slot, struct btrfs_file_extent_item);
@@ -745,10 +744,8 @@ static noinline int replay_one_extent(struct walk_control *wc)
745744
if (btrfs_file_extent_disk_bytenr(wc->log_leaf, item) != 0)
746745
nbytes = btrfs_file_extent_num_bytes(wc->log_leaf, item);
747746
} else if (found_type == BTRFS_FILE_EXTENT_INLINE) {
748-
size = btrfs_file_extent_ram_bytes(wc->log_leaf, item);
749747
nbytes = btrfs_file_extent_ram_bytes(wc->log_leaf, item);
750-
extent_end = ALIGN(start + size,
751-
fs_info->sectorsize);
748+
extent_end = ALIGN(start + nbytes, fs_info->sectorsize);
752749
} else {
753750
btrfs_abort_log_replay(wc, -EUCLEAN,
754751
"unexpected extent type=%d root=%llu inode=%llu offset=%llu",

0 commit comments

Comments
 (0)