mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-09 17:01:18 -04:00
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>
This commit is contained in:
committed by
David Sterba
parent
6803bff896
commit
2c123db1f0
@@ -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 @@ int btrfs_recover_log_trees(struct btrfs_root *log_root_tree)
|
||||
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 @@ int btrfs_recover_log_trees(struct btrfs_root *log_root_tree)
|
||||
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 @@ int btrfs_recover_log_trees(struct btrfs_root *log_root_tree)
|
||||
}
|
||||
|
||||
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 @@ int btrfs_recover_log_trees(struct btrfs_root *log_root_tree)
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user