Skip to content

Commit 6fd4241

Browse files
committed
btrfs-progs: inspect: add build conditionals around list-chunk
In default build there's a warning (reported by CI) that the experimental list-chunk command and related functions are not used, so add the condition there as well. In file included from cmds/inspect.c:45: ./cmds/commands.h:67:26: warning: 'cmd_struct_inspect_list_chunks' defined but not used [-Wunused-const-variable=] #define __CMD_NAME(name) cmd_struct_ ##name ^~~~~~~~~~~ ./cmds/commands.h:73:26: note: in expansion of macro '__CMD_NAME' const struct cmd_struct __CMD_NAME(name) = \ ^~~~~~~~~~ ./cmds/commands.h:88:2: note: in expansion of macro 'DEFINE_COMMAND' DEFINE_COMMAND(name, token, cmd_ ##name, \ ^~~~~~~~~~~~~~ cmds/inspect.c:1115:8: note: in expansion of macro 'DEFINE_SIMPLE_COMMAND' static DEFINE_SIMPLE_COMMAND(inspect_list_chunks, "list-chunks"); ^~~~~~~~~~~~~~~~~~~~~ Signed-off-by: David Sterba <dsterba@suse.com>
1 parent d6fc49d commit 6fd4241

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmds/inspect.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,8 @@ static int cmd_inspect_min_dev_size(const struct cmd_struct *cmd,
692692
}
693693
static DEFINE_SIMPLE_COMMAND(inspect_min_dev_size, "min-dev-size");
694694

695+
#if EXPERIMENTAL
696+
695697
static const char * const cmd_inspect_list_chunks_usage[] = {
696698
"btrfs inspect-internal list-chunks [options] <path>",
697699
"Show chunks (block groups) layout",
@@ -1114,6 +1116,8 @@ static int cmd_inspect_list_chunks(const struct cmd_struct *cmd,
11141116
}
11151117
static DEFINE_SIMPLE_COMMAND(inspect_list_chunks, "list-chunks");
11161118

1119+
#endif
1120+
11171121
static const char * const cmd_inspect_map_swapfile_usage[] = {
11181122
"btrfs inspect-internal map-swapfile <file>",
11191123
"Print physical offset of first block and resume offset if file is suitable as swapfile",

0 commit comments

Comments
 (0)