From 9603da15cb95c4635de6eac6f2ec7dd36a6972f3 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 21 Jun 2015 20:14:32 -0400 Subject: [PATCH] Revert "debugfs: add the hexdump_block command" This reverts commit 58b0356a251a6bc7703a482bea5d1fe6766a65c5. We already have the block_dump (bd) command, but I had completely forgotten about it. Oops! Signed-off-by: Theodore Ts'o --- debugfs/debug_cmds.ct | 3 --- debugfs/debugfs.8.in | 5 ----- debugfs/debugfs.h | 1 - debugfs/logdump.c | 35 ----------------------------------- 4 files changed, 44 deletions(-) diff --git a/debugfs/debug_cmds.ct b/debugfs/debug_cmds.ct index 3564a63..34dad9e 100644 --- a/debugfs/debug_cmds.ct +++ b/debugfs/debug_cmds.ct @@ -145,9 +145,6 @@ request do_set_block_group_descriptor, "Set block group descriptor field", request do_logdump, "Dump the contents of the journal", logdump; -request do_hexdump_block, "Dump the contents of a block", - hexdump_block, hexdump; - request do_htree_dump, "Dump a hash-indexed directory", htree_dump, htree; diff --git a/debugfs/debugfs.8.in b/debugfs/debugfs.8.in index aa9070d..a463c73 100644 --- a/debugfs/debugfs.8.in +++ b/debugfs/debugfs.8.in @@ -392,11 +392,6 @@ is specified, also clear num-1 inodes after the specified inode. Print a list of commands understood by .BR debugfs . .TP -.BI hexdump_block " block" -Dump the contents of -.I block -in hex and ASCII. -.TP .BI htree_dump " filespec" Dump the hash-indexed directory .IR filespec , diff --git a/debugfs/debugfs.h b/debugfs/debugfs.h index 7c39754..76bb22c 100644 --- a/debugfs/debugfs.h +++ b/debugfs/debugfs.h @@ -103,7 +103,6 @@ extern void do_dirsearch(int argc, char **argv); /* logdump.c */ extern void do_logdump(int argc, char **argv); -extern void do_hexdump_block(int argc, char **argv); /* lsdel.c */ extern void do_lsdel(int argc, char **argv); diff --git a/debugfs/logdump.c b/debugfs/logdump.c index 1dc7869..70a7c36 100644 --- a/debugfs/logdump.c +++ b/debugfs/logdump.c @@ -714,38 +714,3 @@ static void do_hexdump (FILE *out_file, char *buf, int blocksize) } } -void do_hexdump_block(int argc, char **argv) -{ - blk64_t block; - char *buf; - errcode_t errcode; - FILE *out; - - if (common_args_process(argc, argv, 2, 2, argv[0], - "", 0)) - return; - - if (strtoblk(argv[0], argv[1], "block number", &block)) - return; - - buf = malloc(current_fs->blocksize); - if (!buf) { - fprintf(stderr, "Couldn't allocate block buffer.\n"); - return; - } - out = open_pager(); - - errcode = io_channel_read_blk64(current_fs->io, block, 1, buf); - if (errcode) { - com_err("hexdump_block", errcode, - "while reading block %llu\n", block); - goto errout; - } - - do_hexdump(out, buf, current_fs->blocksize); - -errout: - free(buf); - close_pager(out); -} - -- 1.8.3.1