v3: btrfs-progs: Introduce 'btrfs inspect-internal dump-csum' option
Subsystems (2)
PATCH 1/1 v3: btrfs-progs: Introduce 'btrfs inspect-internal dump-csum' option
Print csum for a given file on stdout.
Sample usage:
btrfs inspect-internal dump-csum /btrfs/50gbfile /dev/sda4
Signed-off-by Lakshmipathi.G <[email protected]>
--- Makefile | 2 +- cmds-inspect-dump-csum.c | 239 +++++++++++++++++++++++++++++++++++++++++++++++ cmds-inspect-dump-csum.h | 22 +++++ cmds-inspect.c | 3 + 4 files changed, 265 insertions(+), 1 deletion(-) create mode 100644 cmds-inspect-dump-csum.c create mode 100644 cmds-inspect-dump-csum.h
Makefile +1 -1
@@ -122,7 +122,7 @@ cmds_objects = cmds-subvolume.o cmds-filesystem.o cmds-device.o cmds-scrub.o \ cmds-quota.o cmds-qgroup.o cmds-replace.o check/main.o \ cmds-restore.o cmds-rescue.o chunk-recover.o super-recover.o \ cmds-property.o cmds-fi-usage.o cmds-inspect-dump-tree.o \ - cmds-inspect-dump-super.o cmds-inspect-tree-stats.o cmds-fi-du.o \ + cmds-inspect-dump-super.o cmds-inspect-tree-stats.o cmds-fi-du.o cmds-inspect-dump-csum.o \ mkfs/common.o check/mode-common.o check/mode-lowmem.o libbtrfs_objects = send-stream.o send-utils.o kernel-lib/rbtree.o btrfs-list.o \ kernel-lib/crc32c.o messages.o \
cmds-inspect-dump-csum.c new file +239 -0
239 lines not on this page · raw message
cmds-inspect-dump-csum.h new file +22 -0
@@ -0,0 +1,22 @@ +/* +* 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. +* +* Authors: Lakshmipathi.G <[email protected]> +*/ + + +int cmd_inspect_dump_csum (int argc,char **argv); + +extern const char *const cmd_inspect_dump_csum_usage[];
cmds-inspect.c +3 -0
@@ -32,6 +32,7 @@#include "commands.h" #include "btrfs-list.h" #include "help.h" +#include "cmds-inspect-dump-csum.h" static const char *const inspect_cmd_group_usage[] = {"btrfs inspect-internal <command> <args>" ,
@@ -647,6 +648,8 @@ const struct cmd_group inspect_cmd_group = { cmd_inspect_dump_super_usage, NULL, 0 }, {"tree-stats" , cmd_inspect_tree_stats, cmd_inspect_tree_stats_usage, NULL, 0 }, + { "dump-csum", cmd_inspect_dump_csum, + cmd_inspect_dump_csum_usage, NULL, 0 },NULL_CMD_STRUCT } };
Signature · 1 line
2.11.0