From a67efe43629e68039591c361fe4abd4656e0a71a Mon Sep 17 00:00:00 2001 From: David Sterba Date: Thu, 24 Aug 2017 18:32:18 +0200 Subject: [PATCH] btrfs-progs: move command definitions to commands.h There are some trivial helpers, we can group the command declarations in one place. Signed-off-by: David Sterba --- btrfs-debug-tree.c | 1 - cmds-fi-du.h | 23 ----------------------- cmds-fi-usage.h | 3 --- cmds-filesystem.c | 1 - cmds-inspect-dump-super.c | 1 - cmds-inspect-dump-super.h | 26 -------------------------- cmds-inspect-dump-tree.c | 1 - cmds-inspect-dump-tree.h | 24 ------------------------ cmds-inspect-tree-stats.c | 1 - cmds-inspect-tree-stats.h | 26 -------------------------- cmds-inspect.c | 3 --- commands.h | 10 ++++++++++ 12 files changed, 10 insertions(+), 110 deletions(-) delete mode 100644 cmds-fi-du.h delete mode 100644 cmds-inspect-dump-super.h delete mode 100644 cmds-inspect-dump-tree.h delete mode 100644 cmds-inspect-tree-stats.h diff --git a/btrfs-debug-tree.c b/btrfs-debug-tree.c index 5caae60..7bee018 100644 --- a/btrfs-debug-tree.c +++ b/btrfs-debug-tree.c @@ -20,7 +20,6 @@ #include "volumes.h" #include "utils.h" #include "commands.h" -#include "cmds-inspect-dump-tree.h" #include "help.h" int main(int argc, char **argv) diff --git a/cmds-fi-du.h b/cmds-fi-du.h deleted file mode 100644 index 86e8f24..0000000 --- a/cmds-fi-du.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License v2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 021110-1307, USA. - */ - -#ifndef __CMDS_FILESYSTEM_DU_H__ -#define __CMDS_FILESYSTEM_DU_H__ - -extern const char * const cmd_filesystem_du_usage[]; -int cmd_filesystem_du(int argc, char **argv); - -#endif /* __CMDS_FILESYSTEM_DU_H__ */ diff --git a/cmds-fi-usage.h b/cmds-fi-usage.h index f967ba8..a399517 100644 --- a/cmds-fi-usage.h +++ b/cmds-fi-usage.h @@ -22,9 +22,6 @@ #include "kerncompat.h" #include "ioctl.h" -extern const char * const cmd_filesystem_usage_usage[]; -int cmd_filesystem_usage(int argc, char **argv); - struct device_info { u64 devid; char path[BTRFS_DEVICE_PATH_NAME_MAX]; diff --git a/cmds-filesystem.c b/cmds-filesystem.c index e2e41e9..018857c 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -37,7 +37,6 @@ #include "cmds-fi-usage.h" #include "list_sort.h" #include "disk-io.h" -#include "cmds-fi-du.h" #include "help.h" /* diff --git a/cmds-inspect-dump-super.c b/cmds-inspect-dump-super.c index 98e0270..c4a2565 100644 --- a/cmds-inspect-dump-super.c +++ b/cmds-inspect-dump-super.c @@ -33,7 +33,6 @@ #include "utils.h" #include "commands.h" #include "crc32c.h" -#include "cmds-inspect-dump-super.h" #include "help.h" static int check_csum_sblock(void *sb, int csum_size) diff --git a/cmds-inspect-dump-super.h b/cmds-inspect-dump-super.h deleted file mode 100644 index ffab81d..0000000 --- a/cmds-inspect-dump-super.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2012 STRATO AG. All rights reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License v2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 021110-1307, USA. - */ - -#ifndef __CMDS_INSPECT_DUMP_SUPER_H__ -#define __CMDS_INSPECT_DUMP_SUPER_H__ - -int cmd_inspect_dump_super(int argc, char **argv); - -extern const char * const cmd_inspect_dump_super_usage[]; - -#endif diff --git a/cmds-inspect-dump-tree.c b/cmds-inspect-dump-tree.c index 876ddcb..8ff638f 100644 --- a/cmds-inspect-dump-tree.c +++ b/cmds-inspect-dump-tree.c @@ -31,7 +31,6 @@ #include "volumes.h" #include "commands.h" #include "utils.h" -#include "cmds-inspect-dump-tree.h" #include "help.h" static void print_extents(struct btrfs_root *root, struct extent_buffer *eb) diff --git a/cmds-inspect-dump-tree.h b/cmds-inspect-dump-tree.h deleted file mode 100644 index 755fb4b..0000000 --- a/cmds-inspect-dump-tree.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License v2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 021110-1307, USA. - */ - -#ifndef __CMDS_INSPECT_DUMP_TREE_H__ -#define __CMDS_INSPECT_DUMP_TREE_H__ - -int cmd_inspect_dump_tree(int argc, char **argv); - -extern const char * const cmd_inspect_dump_tree_usage[]; - -#endif diff --git a/cmds-inspect-tree-stats.c b/cmds-inspect-tree-stats.c index 05f4f61..bcba7fb 100644 --- a/cmds-inspect-tree-stats.c +++ b/cmds-inspect-tree-stats.c @@ -35,7 +35,6 @@ #include "volumes.h" #include "utils.h" #include "commands.h" -#include "cmds-inspect-tree-stats.h" #include "help.h" static int verbose = 0; diff --git a/cmds-inspect-tree-stats.h b/cmds-inspect-tree-stats.h deleted file mode 100644 index eb401da..0000000 --- a/cmds-inspect-tree-stats.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2011 Red Hat. All rights reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License v2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 021110-1307, USA. - */ - -#ifndef __CMDS_INSPECT_TREE_STATS_H__ -#define __CMDS_INSPECT_TREE_STATS_H__ - -int cmd_inspect_tree_stats(int argc, char **argv); - -extern const char * const cmd_inspect_tree_stats_usage[]; - -#endif diff --git a/cmds-inspect.c b/cmds-inspect.c index 58b5956..d1a3a0e 100644 --- a/cmds-inspect.c +++ b/cmds-inspect.c @@ -31,9 +31,6 @@ #include "disk-io.h" #include "commands.h" #include "btrfs-list.h" -#include "cmds-inspect-dump-tree.h" -#include "cmds-inspect-dump-super.h" -#include "cmds-inspect-tree-stats.h" #include "help.h" static const char * const inspect_cmd_group_usage[] = { diff --git a/commands.h b/commands.h index 01bf387..76991f2 100644 --- a/commands.h +++ b/commands.h @@ -89,9 +89,16 @@ extern const char * const cmd_chunk_recover_usage[]; extern const char * const cmd_super_recover_usage[]; extern const char * const cmd_restore_usage[]; extern const char * const cmd_rescue_usage[]; +extern const char * const cmd_inspect_dump_super_usage[]; +extern const char * const cmd_inspect_dump_tree_usage[]; +extern const char * const cmd_inspect_tree_stats_usage[]; +extern const char * const cmd_filesystem_du_usage[]; +extern const char * const cmd_filesystem_usage_usage[]; int cmd_subvolume(int argc, char **argv); int cmd_filesystem(int argc, char **argv); +int cmd_filesystem_du(int argc, char **argv); +int cmd_filesystem_usage(int argc, char **argv); int cmd_balance(int argc, char **argv); int cmd_device(int argc, char **argv); int cmd_scrub(int argc, char **argv); @@ -99,6 +106,9 @@ int cmd_check(int argc, char **argv); int cmd_chunk_recover(int argc, char **argv); int cmd_super_recover(int argc, char **argv); int cmd_inspect(int argc, char **argv); +int cmd_inspect_dump_super(int argc, char **argv); +int cmd_inspect_dump_tree(int argc, char **argv); +int cmd_inspect_tree_stats(int argc, char **argv); int cmd_property(int argc, char **argv); int cmd_send(int argc, char **argv); int cmd_receive(int argc, char **argv); -- 2.7.4