aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2025-08-26 16:27:46 +0100
committerDavid Sterba <dsterba@suse.com>2025-09-23 08:49:17 +0200
commit2c123db1f0e1fbba424263851973e2bb862c26fb (patch)
treedc288513437a0669e10c550ffb68cfda93729a63 /fs/btrfs/tree-log.c
parentbtrfs: use booleans in walk control structure for log replay (diff)
downloadlinux-rng-2c123db1f0e1fbba424263851973e2bb862c26fb.tar.xz
linux-rng-2c123db1f0e1fbba424263851973e2bb862c26fb.zip
btrfs: rename replay_dest member of struct walk_control to root
Everywhere else we refer to a subvolume root we are replaying to simply as 'root', so rename from 'replay_dest' to 'root' for consistency and having a more meaningful and shorter name. While at it also update the comment to be more detailed and comply to preferred style (first word in a sentence is capitalized and sentence ends with punctuation). Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index c5c5fc05eabb..c0cc94efbcaa 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -330,8 +330,11 @@ struct walk_control {
*/
bool ignore_cur_inode;
- /* the root we are currently replaying */
- struct btrfs_root *replay_dest;
+ /*
+ * The root we are currently replaying to. This is NULL for the replay
+ * stage LOG_WALK_PIN_ONLY.
+ */
+ struct btrfs_root *root;
/* the trans handle for the current replay */
struct btrfs_trans_handle *trans;
@@ -2575,7 +2578,7 @@ static int replay_one_buffer(struct btrfs_root *log, struct extent_buffer *eb,
.level = level
};
struct btrfs_path *path;
- struct btrfs_root *root = wc->replay_dest;
+ struct btrfs_root *root = wc->root;
struct btrfs_trans_handle *trans = wc->trans;
struct btrfs_key key;
int i;
@@ -7479,11 +7482,10 @@ again:
goto error;
}
- wc.replay_dest = btrfs_get_fs_root(fs_info, found_key.offset,
- true);
- if (IS_ERR(wc.replay_dest)) {
- ret = PTR_ERR(wc.replay_dest);
- wc.replay_dest = NULL;
+ wc.root = btrfs_get_fs_root(fs_info, found_key.offset, true);
+ if (IS_ERR(wc.root)) {
+ ret = PTR_ERR(wc.root);
+ wc.root = NULL;
if (ret != -ENOENT) {
btrfs_put_root(log);
btrfs_abort_transaction(trans, ret);
@@ -7510,8 +7512,8 @@ again:
goto next;
}
- wc.replay_dest->log_root = log;
- ret = btrfs_record_root_in_trans(trans, wc.replay_dest);
+ wc.root->log_root = log;
+ ret = btrfs_record_root_in_trans(trans, wc.root);
if (ret) {
btrfs_abort_transaction(trans, ret);
goto next;
@@ -7524,9 +7526,9 @@ again:
}
if (wc.stage == LOG_WALK_REPLAY_ALL) {
- struct btrfs_root *root = wc.replay_dest;
+ struct btrfs_root *root = wc.root;
- ret = fixup_inode_link_counts(trans, wc.replay_dest, path);
+ ret = fixup_inode_link_counts(trans, root, path);
if (ret) {
btrfs_abort_transaction(trans, ret);
goto next;
@@ -7546,9 +7548,9 @@ again:
}
}
next:
- if (wc.replay_dest) {
- wc.replay_dest->log_root = NULL;
- btrfs_put_root(wc.replay_dest);
+ if (wc.root) {
+ wc.root->log_root = NULL;
+ btrfs_put_root(wc.root);
}
btrfs_put_root(log);