summaryrefslogtreecommitdiff
path: root/cmds-check.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmds-check.c')
-rw-r--r--cmds-check.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/cmds-check.c b/cmds-check.c
index b2e69672..e2060cba 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -6545,6 +6545,7 @@ static struct option long_options[] = {
{ "init-extent-tree", 0, NULL, 0 },
{ "check-data-csum", 0, NULL, 0 },
{ "backup", 0, NULL, 0 },
+ { "subvol-extents", 1, NULL, 'E' },
{ "qgroup-report", 0, NULL, 'Q' },
{ NULL, 0, NULL, 0}
};
@@ -6560,6 +6561,7 @@ const char * const cmd_check_usage[] = {
"--init-extent-tree create a new extent tree",
"--check-data-csum verify checkums of data blocks",
"--qgroup-report print a report on qgroup consistency",
+ "--subvol-extents print subvolume extents and sharing state",
NULL
};
@@ -6569,6 +6571,7 @@ int cmd_check(int argc, char **argv)
struct btrfs_root *root;
struct btrfs_fs_info *info;
u64 bytenr = 0;
+ u64 subvolid = 0;
char uuidbuf[BTRFS_UUID_UNPARSED_SIZE];
int ret;
u64 num;
@@ -6604,6 +6607,9 @@ int cmd_check(int argc, char **argv)
case 'Q':
qgroup_report = 1;
break;
+ case 'E':
+ subvolid = arg_strtou64(optarg);
+ break;
case '?':
case 'h':
usage(cmd_check_usage);
@@ -6660,6 +6666,12 @@ int cmd_check(int argc, char **argv)
print_qgroup_report(1);
goto close_out;
}
+ if (subvolid) {
+ printf("Print extent state for subvolume %llu on %s\nUUID: %s\n",
+ subvolid, argv[optind], uuidbuf);
+ ret = print_extent_state(info, subvolid);
+ goto close_out;
+ }
printf("Checking filesystem on %s\nUUID: %s\n", argv[optind], uuidbuf);
if (!extent_buffer_uptodate(info->tree_root->node) ||