summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2025-09-03 12:10:01 +0100
committerDavid Sterba <dsterba@suse.com>2025-09-23 08:49:21 +0200
commite41c5e611a65799747709b8fed461dd07647c40d (patch)
tree61a6b805bb7c40ae3a7649280ecb85f35de3e532
parentbd9c063e6ff2657ae89de9838fd792c1157ec96c (diff)
btrfs: remove pointless inode lookup when processing extrefs during log replay
At unlink_extrefs_not_in_log() we do an inode lookup of the directory but we already have the directory inode accessible as a function argument, so the lookup is redudant. Remove it and use the directory inode passed in as an argument. 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.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 6186300923b7..86c595ef57f4 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -1165,10 +1165,8 @@ static int unlink_extrefs_not_in_log(struct walk_control *wc,
while (cur_offset < item_size) {
struct btrfs_trans_handle *trans = wc->trans;
- struct btrfs_root *root = wc->root;
struct btrfs_root *log_root = wc->log;
struct btrfs_inode_extref *extref;
- struct btrfs_inode *victim_parent;
struct fscrypt_str victim_name;
int ret;
@@ -1202,20 +1200,10 @@ next:
continue;
}
- victim_parent = btrfs_iget_logging(btrfs_ino(dir), root);
- if (IS_ERR(victim_parent)) {
- kfree(victim_name.name);
- ret = PTR_ERR(victim_parent);
- btrfs_abort_transaction(trans, ret);
- return ret;
- }
-
inc_nlink(&inode->vfs_inode);
btrfs_release_path(wc->subvol_path);
- ret = unlink_inode_for_log_replay(wc, victim_parent, inode,
- &victim_name);
- iput(&victim_parent->vfs_inode);
+ ret = unlink_inode_for_log_replay(wc, dir, inode, &victim_name);
kfree(victim_name.name);
if (ret)
return ret;