]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
btrfs: use str_yes_no() helper function in btrfs_dump_free_space()
authorThorsten Blum <thorsten.blum@linux.dev>
Mon, 21 Oct 2024 21:40:22 +0000 (23:40 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 11 Nov 2024 13:34:18 +0000 (14:34 +0100)
Remove hard-coded strings by using the str_yes_no() and str_no_yes()
helper functions.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/free-space-cache.c

index 0d2db205b9f629b0b2dfa4ad75da300becf2eab1..b50b621c6afce5d0a5c2d87a5bc1486bfc8e0545 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/ratelimit.h>
 #include <linux/error-injection.h>
 #include <linux/sched/mm.h>
+#include <linux/string_choices.h>
 #include "ctree.h"
 #include "fs.h"
 #include "messages.h"
@@ -2935,12 +2936,11 @@ void btrfs_dump_free_space(struct btrfs_block_group *block_group,
                if (info->bytes >= bytes && !block_group->ro)
                        count++;
                btrfs_crit(fs_info, "entry offset %llu, bytes %llu, bitmap %s",
-                          info->offset, info->bytes,
-                      (info->bitmap) ? "yes" : "no");
+                          info->offset, info->bytes, str_yes_no(info->bitmap));
        }
        spin_unlock(&ctl->tree_lock);
        btrfs_info(fs_info, "block group has cluster?: %s",
-              list_empty(&block_group->cluster_list) ? "no" : "yes");
+              str_no_yes(list_empty(&block_group->cluster_list)));
        btrfs_info(fs_info,
                   "%d free space entries at or bigger than %llu bytes",
                   count, bytes);