From de34a33a8204af9e675e5247c88eb727955beae1 Mon Sep 17 00:00:00 2001 From: Nikolay Borisov Date: Tue, 27 Mar 2018 10:45:43 +0300 Subject: [PATCH] btrfs-progs: Remove btrfs-debug-tree command There is already a replacement in the face of btrfs inspect-internal dump-tree. And this command is just a simple wrapper around it. Just remove it and adjust the show-blocks script to call the main btrfs binary to achieve the same effect. Informally deprecated since 4.4. Issue: #97 Signed-off-by: Nikolay Borisov Signed-off-by: David Sterba --- .gitignore | 1 - Documentation/Makefile.in | 1 - Documentation/btrfs.asciidoc | 3 ++- Makefile | 4 +--- btrfs-debug-tree.c | 41 ------------------------------------ show-blocks | 2 +- 6 files changed, 4 insertions(+), 48 deletions(-) delete mode 100644 btrfs-debug-tree.c diff --git a/.gitignore b/.gitignore index 4ec04cb6..237a4518 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,6 @@ Documentation/*.gz Documentation/*.html btrfs btrfs.static -btrfs-debug-tree btrfs-map-logical btrfs-fragments btrfsck diff --git a/Documentation/Makefile.in b/Documentation/Makefile.in index 64947afb..0a90f803 100644 --- a/Documentation/Makefile.in +++ b/Documentation/Makefile.in @@ -103,7 +103,6 @@ install-man: man $(INSTALL) -m 644 $(GZ_MAN8) $(DESTDIR)$(man8dir) $(LN_S) -f btrfs-check.8.gz $(DESTDIR)$(man8dir)/btrfsck.8.gz $(LN_S) -f btrfs-rescue.8.gz $(DESTDIR)$(man8dir)/btrfs-zero-log.8.gz - $(LN_S) -f btrfs-inspect-internal.8.gz $(DESTDIR)$(man8dir)/btrfs-debug-tree.8.gz $(LN_S) -f btrfs-inspect-internal.8.gz $(DESTDIR)$(man8dir)/btrfs-show-super.8.gz uninstall: diff --git a/Documentation/btrfs.asciidoc b/Documentation/btrfs.asciidoc index 82530234..b9d277c4 100644 --- a/Documentation/btrfs.asciidoc +++ b/Documentation/btrfs.asciidoc @@ -120,7 +120,8 @@ Tools that are still in active use without an equivalent in *btrfs*: Deprecated and obsolete tools: -*btrfs-debug-tree*:: moved to *btrfs inspect-internal dump-tree* +*btrfs-debug-tree*:: moved to *btrfs inspect-internal dump-tree*. Removed from +source distribution. *btrfs-show-super*:: moved to *btrfs inspect-internal dump-super* *btrfs-zero-log*:: moved to *btrfs rescue zero-log* diff --git a/Makefile b/Makefile index 5ba76d2e..c5d1d51a 100644 --- a/Makefile +++ b/Makefile @@ -210,8 +210,7 @@ MAKEOPTS = --no-print-directory Q=$(Q) progs = $(progs_install) btrfsck btrfs-corrupt-block # install only selected -progs_install = btrfs mkfs.btrfs btrfs-debug-tree \ - btrfs-map-logical btrfs-image btrfs-zero-log \ +progs_install = btrfs mkfs.btrfs btrfs-map-logical btrfs-image btrfs-zero-log \ btrfs-find-root btrfstune \ btrfs-select-super @@ -229,7 +228,6 @@ endif btrfs_convert_cflags = -DBTRFSCONVERT_EXT2=$(BTRFSCONVERT_EXT2) btrfs_convert_cflags += -DBTRFSCONVERT_REISERFS=$(BTRFSCONVERT_REISERFS) btrfs_fragments_libs = -lgd -lpng -ljpeg -lfreetype -btrfs_debug_tree_objects = cmds-inspect-dump-tree.o btrfs_show_super_objects = cmds-inspect-dump-super.o btrfs_calc_size_objects = cmds-inspect-tree-stats.o cmds_restore_cflags = -DBTRFSRESTORE_ZSTD=$(BTRFSRESTORE_ZSTD) diff --git a/btrfs-debug-tree.c b/btrfs-debug-tree.c deleted file mode 100644 index 7bee018f..00000000 --- a/btrfs-debug-tree.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2007 Oracle. 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. - */ - -#include "disk-io.h" -#include "volumes.h" -#include "utils.h" -#include "commands.h" -#include "help.h" - -int main(int argc, char **argv) -{ - int ret; - - set_argv0(argv); - - if (argc > 1 && !strcmp(argv[1], "--help")) - usage(cmd_inspect_dump_tree_usage); - - radix_tree_init(); - - ret = cmd_inspect_dump_tree(argc, argv); - - btrfs_close_all_devices(); - - return ret; -} diff --git a/show-blocks b/show-blocks index 49e1770e..3876b2ac 100755 --- a/show-blocks +++ b/show-blocks @@ -108,7 +108,7 @@ def loaddata(fh,delimiter=None, converters=None): return X def run_debug_tree(device): - p = os.popen('btrfs-debug-tree -e ' + device) + p = os.popen('btrfs inspect-internal dump-tree -e ' + device) data = loaddata(p) return data