diff options
author | Filipe Manana <fdmanana@suse.com> | 2025-09-18 13:29:16 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2025-09-23 08:49:24 +0200 |
commit | b7ff7b0d76e5478c319ab2066b287e156968231f (patch) | |
tree | 97a9283a6b240ec0bd18c2b76ab494413d5b0fd2 | |
parent | a35b3dd59bf6fe2bf3c2777bdde623d722caa68c (diff) |
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 <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>
-rw-r--r-- | fs/btrfs/tree-log.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 96492080fed8..ac7805d40ab2 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -732,7 +732,6 @@ static noinline int replay_one_extent(struct walk_control *wc) struct btrfs_key ins; struct btrfs_file_extent_item *item; struct btrfs_inode *inode = NULL; - unsigned long size; int ret = 0; 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) if (btrfs_file_extent_disk_bytenr(wc->log_leaf, item) != 0) nbytes = btrfs_file_extent_num_bytes(wc->log_leaf, item); } else if (found_type == BTRFS_FILE_EXTENT_INLINE) { - size = btrfs_file_extent_ram_bytes(wc->log_leaf, item); nbytes = btrfs_file_extent_ram_bytes(wc->log_leaf, item); - extent_end = ALIGN(start + size, - fs_info->sectorsize); + extent_end = ALIGN(start + nbytes, fs_info->sectorsize); } else { btrfs_abort_log_replay(wc, -EUCLEAN, "unexpected extent type=%d root=%llu inode=%llu offset=%llu", |