diff mbox series

btrfs: always assign false literal to ref head processing field

Message ID 0a50236c4f79f588c48f44dfd80519423bbacb1c.1686298104.git.fdmanana@suse.com (mailing list archive)
State New, archived
Headers show
Series btrfs: always assign false literal to ref head processing field | expand

Commit Message

Filipe Manana June 9, 2023, 8:12 a.m. UTC
From: Filipe Manana <fdmanana@suse.com>

There's a couple places at extent-tree.c assigning a 0 to a ref head's
is_processing field, but that field was recently changed from an int
type to a bool type (patch "btrfs: use bool type for delayed ref head
fields that are used as booleans"). While this is not a problem in the
sense the end result is the same, as a 0 is equivalent to false, use a
literal false to make the code a bit more clear.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---

Note, this can be folded into patch:

  "btrfs: use bool type for delayed ref head fields that are used as booleans"

 fs/btrfs/extent-tree.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

David Sterba June 9, 2023, 8:38 a.m. UTC | #1
On Fri, Jun 09, 2023 at 09:12:21AM +0100, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> There's a couple places at extent-tree.c assigning a 0 to a ref head's
> is_processing field, but that field was recently changed from an int
> type to a bool type (patch "btrfs: use bool type for delayed ref head
> fields that are used as booleans"). While this is not a problem in the
> sense the end result is the same, as a 0 is equivalent to false, use a
> literal false to make the code a bit more clear.
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
> ---
> 
> Note, this can be folded into patch:
> 
>   "btrfs: use bool type for delayed ref head fields that are used as booleans"

Folded, thanks.
diff mbox series

Patch

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index effb01749a24..911908ea5f6f 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -1745,7 +1745,7 @@  static void unselect_delayed_ref_head(struct btrfs_delayed_ref_root *delayed_ref
 				      struct btrfs_delayed_ref_head *head)
 {
 	spin_lock(&delayed_refs->lock);
-	head->processing = 0;
+	head->processing = false;
 	delayed_refs->num_heads_ready++;
 	spin_unlock(&delayed_refs->lock);
 	btrfs_delayed_ref_unlock(head);
@@ -3211,7 +3211,7 @@  static noinline int check_ref_cleanup(struct btrfs_trans_handle *trans,
 		goto out;
 
 	btrfs_delete_ref_head(delayed_refs, head);
-	head->processing = 0;
+	head->processing = false;
 
 	spin_unlock(&head->lock);
 	spin_unlock(&delayed_refs->lock);