summaryrefslogtreecommitdiff
path: root/cmds-filesystem.c
diff options
context:
space:
mode:
authorAnand Jain <anand.jain@oracle.com>2013-07-15 13:30:50 +0800
committerDavid Sterba <dsterba@suse.cz>2013-08-09 14:32:36 +0200
commit5333445574adf8415ce3b7e8b13cf8feeb39b836 (patch)
tree824ba45bb8bb56b341e8c40be7b9eb7f71cf497a /cmds-filesystem.c
parent8f7c5897e96607ef0b47ecbc2f0d3cb4df2b8c07 (diff)
btrfs-progs: congregate dev scan
the dev scan to find btrfs is performed at two locations all most the same way one at filesystem show and another at device scan. They both follow the same steps. This patch does not alter anything except that it brings these two same logic into the function scan_for_btrfs so that we can play tweaking it. the patch which recommends to use /dev/mapper will also need it Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'cmds-filesystem.c')
-rw-r--r--cmds-filesystem.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index 945ef2e1..982b9542 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -233,21 +233,18 @@ static int cmd_show(int argc, char **argv)
struct list_head *cur_uuid;
char *search = 0;
int ret;
- int checklist = 1;
+ int where = BTRFS_SCAN_PROC;
int searchstart = 1;
if( argc > 1 && !strcmp(argv[1],"--all-devices")){
- checklist = 0;
+ where = BTRFS_SCAN_DEV;
searchstart += 1;
}
if (check_argc_max(argc, searchstart + 1))
usage(cmd_show_usage);
- if(checklist)
- ret = btrfs_scan_block_devices(0);
- else
- ret = btrfs_scan_one_dir("/dev", 0);
+ ret = scan_for_btrfs(where, 0);
if (ret){
fprintf(stderr, "ERROR: error %d while scanning\n", ret);