Skip to content

Commit 2c123db

Browse files
fdmananakdave
authored andcommitted
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>
1 parent 6803bff commit 2c123db

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

fs/btrfs/tree-log.c

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,11 @@ struct walk_control {
330330
*/
331331
bool ignore_cur_inode;
332332

333-
/* the root we are currently replaying */
334-
struct btrfs_root *replay_dest;
333+
/*
334+
* The root we are currently replaying to. This is NULL for the replay
335+
* stage LOG_WALK_PIN_ONLY.
336+
*/
337+
struct btrfs_root *root;
335338

336339
/* the trans handle for the current replay */
337340
struct btrfs_trans_handle *trans;
@@ -2575,7 +2578,7 @@ static int replay_one_buffer(struct btrfs_root *log, struct extent_buffer *eb,
25752578
.level = level
25762579
};
25772580
struct btrfs_path *path;
2578-
struct btrfs_root *root = wc->replay_dest;
2581+
struct btrfs_root *root = wc->root;
25792582
struct btrfs_trans_handle *trans = wc->trans;
25802583
struct btrfs_key key;
25812584
int i;
@@ -7479,11 +7482,10 @@ int btrfs_recover_log_trees(struct btrfs_root *log_root_tree)
74797482
goto error;
74807483
}
74817484

7482-
wc.replay_dest = btrfs_get_fs_root(fs_info, found_key.offset,
7483-
true);
7484-
if (IS_ERR(wc.replay_dest)) {
7485-
ret = PTR_ERR(wc.replay_dest);
7486-
wc.replay_dest = NULL;
7485+
wc.root = btrfs_get_fs_root(fs_info, found_key.offset, true);
7486+
if (IS_ERR(wc.root)) {
7487+
ret = PTR_ERR(wc.root);
7488+
wc.root = NULL;
74877489
if (ret != -ENOENT) {
74887490
btrfs_put_root(log);
74897491
btrfs_abort_transaction(trans, ret);
@@ -7510,8 +7512,8 @@ int btrfs_recover_log_trees(struct btrfs_root *log_root_tree)
75107512
goto next;
75117513
}
75127514

7513-
wc.replay_dest->log_root = log;
7514-
ret = btrfs_record_root_in_trans(trans, wc.replay_dest);
7515+
wc.root->log_root = log;
7516+
ret = btrfs_record_root_in_trans(trans, wc.root);
75157517
if (ret) {
75167518
btrfs_abort_transaction(trans, ret);
75177519
goto next;
@@ -7524,9 +7526,9 @@ int btrfs_recover_log_trees(struct btrfs_root *log_root_tree)
75247526
}
75257527

75267528
if (wc.stage == LOG_WALK_REPLAY_ALL) {
7527-
struct btrfs_root *root = wc.replay_dest;
7529+
struct btrfs_root *root = wc.root;
75287530

7529-
ret = fixup_inode_link_counts(trans, wc.replay_dest, path);
7531+
ret = fixup_inode_link_counts(trans, root, path);
75307532
if (ret) {
75317533
btrfs_abort_transaction(trans, ret);
75327534
goto next;
@@ -7546,9 +7548,9 @@ int btrfs_recover_log_trees(struct btrfs_root *log_root_tree)
75467548
}
75477549
}
75487550
next:
7549-
if (wc.replay_dest) {
7550-
wc.replay_dest->log_root = NULL;
7551-
btrfs_put_root(wc.replay_dest);
7551+
if (wc.root) {
7552+
wc.root->log_root = NULL;
7553+
btrfs_put_root(wc.root);
75527554
}
75537555
btrfs_put_root(log);
75547556

0 commit comments

Comments
 (0)