From 8de6816b4729a6bb1c5733138d664a1c8737d1df Mon Sep 17 00:00:00 2001 From: David Sterba Date: Mon, 19 Oct 2020 20:40:26 +0200 Subject: [PATCH] btrfs-progs: sb-mod: add dev_item prefix for sb::device members For parity with output of 'btrfs inspect dump-super', add the "dev_item." prefix to the devid member. This allows adding more members without conflicts (like it would be for device total_bytes). Reviewed-by: Anand Jain Signed-off-by: David Sterba --- btrfs-sb-mod.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/btrfs-sb-mod.c b/btrfs-sb-mod.c index e46b3320..69a204e9 100644 --- a/btrfs-sb-mod.c +++ b/btrfs-sb-mod.c @@ -139,7 +139,8 @@ struct sb_field { { .name = "log_root_level", .type = TYPE_U8 }, { .name = "cache_generation", .type = TYPE_U64 }, { .name = "uuid_tree_generation", .type = TYPE_U64 }, - { .name = "devid", .type = TYPE_U64 }, + /* Device item members */ + { .name = "dev_item.devid", .type = TYPE_U64 }, }; #define MOD_FIELD_XX(fname, set, val, bits, f_dec, f_hex, f_type) \ @@ -156,14 +157,14 @@ struct sb_field { } #define MOD_DEV_FIELD_XX(fname, set, val, bits, f_dec, f_hex, f_type) \ - else if (strcmp(name, #fname) == 0) { \ + else if (strcmp(name, "dev_item." #fname) == 0) { \ if (set) { \ - printf("SET: "#fname" "f_dec" (0x"f_hex")\n", \ + printf("SET: dev_item."#fname" "f_dec" (0x"f_hex")\n", \ (f_type)*val, (f_type)*val); \ sb->dev_item.fname = cpu_to_le##bits(*val); \ } else { \ *val = le##bits##_to_cpu(sb->dev_item.fname); \ - printf("GET: "#fname" "f_dec" (0x"f_hex")\n", \ + printf("GET: dev_item."#fname" "f_dec" (0x"f_hex")\n", \ (f_type)*val, (f_type)*val); \ } \ }