aboutsummaryrefslogtreecommitdiffstats
path: root/btrfs-find-root.c
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2015-01-16 19:32:54 +0800
committerDavid Sterba <dsterba@suse.cz>2015-02-11 18:34:06 +0100
commitd91d68294c40d63b7a8d0910e5ee0167f9a70228 (patch)
treea081668b2ec39f1b3f07b9bbe3ce18f6020b3cf7 /btrfs-find-root.c
parente08b2a5845e56fbd9441f7d734ca6b6143f7750d (diff)
downloadbtrfs-progs-d91d68294c40d63b7a8d0910e5ee0167f9a70228.tar.gz
btrfs-progs-d91d68294c40d63b7a8d0910e5ee0167f9a70228.tar.xz
btrfs-progs-d91d68294c40d63b7a8d0910e5ee0167f9a70228.zip
btrfs-progs: find-root, add option to search through all the metadata extents
Add option '-a' for btrfs-find-root to iterate all the metadata extents even the root is already found. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'btrfs-find-root.c')
-rw-r--r--btrfs-find-root.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/btrfs-find-root.c b/btrfs-find-root.c
index b748164..9e56c81 100644
--- a/btrfs-find-root.c
+++ b/btrfs-find-root.c
@@ -36,7 +36,7 @@
static void usage(void)
{
- fprintf(stderr, "Usage: find-roots [-o search_objectid] "
+ fprintf(stderr, "Usage: find-roots [-a] [-o search_objectid] "
"[ -g search_generation ] [ -l search_level ] <device>\n");
}
@@ -149,20 +149,23 @@ int main(int argc, char **argv)
filter.objectid = BTRFS_ROOT_TREE_OBJECTID;
filter.match_gen = (u64)-1;
filter.match_level = (u8)-1;
- while ((opt = getopt(argc, argv, "l:o:g:")) != -1) {
+ while ((opt = getopt(argc, argv, "al:o:g:")) != -1) {
switch(opt) {
- case 'o':
- filter.objectid = arg_strtou64(optarg);
- break;
- case 'g':
- filter.generation = arg_strtou64(optarg);
- break;
- case 'l':
- filter.level = arg_strtou64(optarg);
- break;
- default:
- usage();
- exit(1);
+ case 'a':
+ filter.search_all = 1;
+ break;
+ case 'o':
+ filter.objectid = arg_strtou64(optarg);
+ break;
+ case 'g':
+ filter.generation = arg_strtou64(optarg);
+ break;
+ case 'l':
+ filter.level = arg_strtou64(optarg);
+ break;
+ default:
+ usage();
+ exit(1);
}
}