]> www.infradead.org Git - users/hch/misc.git/commitdiff
btrfs: rename replay_dest member of struct walk_control to root
authorFilipe Manana <fdmanana@suse.com>
Tue, 26 Aug 2025 15:27:46 +0000 (16:27 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 23 Sep 2025 06:49:17 +0000 (08:49 +0200)
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>
fs/btrfs/tree-log.c

index c5c5fc05eabb4eaf77fa76ed3c450a0d45c9d0b1..c0cc94efbcaa220077e565fb3d342be90c4f6d9a 100644 (file)
@@ -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);