]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
btrfs: send: only use boolean variables at process_recorded_refs()
authorFilipe Manana <fdmanana@suse.com>
Tue, 19 Aug 2025 02:40:15 +0000 (22:40 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:28:41 +0000 (16:28 +0200)
[ Upstream commit 9453fe329789073d9a971de01da5902c32c1a01a ]

We have several local variables at process_recorded_refs() that are used
as booleans, with some of them having a 'bool' type while two of them
having an 'int' type. Change this to make them all use the 'bool' type
which is more clear and to make everything more consistent.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Stable-dep-of: 005b0a0c24e1 ("btrfs: send: use fallocate for hole punching with send stream v2")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/send.c

index bb24c1a00f6e729816fe3fe2c04846dd18237f5c..07738b3686083c94921efa5cdb46168498c482e2 100644 (file)
@@ -4180,9 +4180,9 @@ static int process_recorded_refs(struct send_ctx *sctx, int *pending_move)
        u64 ow_inode = 0;
        u64 ow_gen;
        u64 ow_mode;
-       int did_overwrite = 0;
-       int is_orphan = 0;
        u64 last_dir_ino_rm = 0;
+       bool did_overwrite = false;
+       bool is_orphan = false;
        bool can_rename = true;
        bool orphanized_dir = false;
        bool orphanized_ancestor = false;
@@ -4224,14 +4224,14 @@ static int process_recorded_refs(struct send_ctx *sctx, int *pending_move)
                if (ret < 0)
                        goto out;
                if (ret)
-                       did_overwrite = 1;
+                       did_overwrite = true;
        }
        if (sctx->cur_inode_new || did_overwrite) {
                ret = gen_unique_name(sctx, sctx->cur_ino,
                                sctx->cur_inode_gen, valid_path);
                if (ret < 0)
                        goto out;
-               is_orphan = 1;
+               is_orphan = true;
        } else {
                ret = get_cur_path(sctx, sctx->cur_ino, sctx->cur_inode_gen,
                                valid_path);
@@ -4454,7 +4454,7 @@ static int process_recorded_refs(struct send_ctx *sctx, int *pending_move)
                        ret = send_rename(sctx, valid_path, cur->full_path);
                        if (ret < 0)
                                goto out;
-                       is_orphan = 0;
+                       is_orphan = false;
                        ret = fs_path_copy(valid_path, cur->full_path);
                        if (ret < 0)
                                goto out;
@@ -4515,7 +4515,7 @@ static int process_recorded_refs(struct send_ctx *sctx, int *pending_move)
                                        sctx->cur_inode_gen, valid_path);
                        if (ret < 0)
                                goto out;
-                       is_orphan = 1;
+                       is_orphan = true;
                }
 
                list_for_each_entry(cur, &sctx->deleted_refs, list) {