summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2014-08-20 17:23:20 -0500
committerDavid Sterba <dsterba@suse.cz>2014-10-10 09:32:13 +0200
commit1c1ac30d93799529f06b713c223c9460482be7f9 (patch)
tree8c97973f34b18ff4a04b8b25e4165207dbce8ad7 /utils.c
parent4e85e481887abba8141ff43597c09b5f91d70ee4 (diff)
btrfs-progs: don't fall back to recursive /dev scan
If we didn't find what we are looking for in /proc/partitions, we're not going to find it by scanning every node under /dev, either. But that's just what btrfs_scan_for_fsid() does. Remove that fallback; at that point btrfs_scan_for_fsid() just calls scan_for_btrfs(), so remove the wrapper & call it directly. Side note: so, these paths always use /proc/partitions, not libblkid. Userspace-intiated scans default to libblkid. I presume this is part of the design, and intentional? Anyway, not changing it now! Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/utils.c b/utils.c
index c4f2a00c..cb9e514c 100644
--- a/utils.c
+++ b/utils.c
@@ -1148,7 +1148,7 @@ int check_mounted_where(int fd, const char *file, char *where, int size,
/* scan other devices */
if (is_btrfs && total_devs > 1) {
- if ((ret = btrfs_scan_for_fsid(!BTRFS_UPDATE_KERNEL)))
+ if ((ret = scan_for_btrfs(BTRFS_SCAN_PROC, !BTRFS_UPDATE_KERNEL)))
return ret;
}
@@ -1336,16 +1336,6 @@ fail:
return ret;
}
-int btrfs_scan_for_fsid(int run_ioctls)
-{
- int ret;
-
- ret = scan_for_btrfs(BTRFS_SCAN_PROC, run_ioctls);
- if (ret)
- ret = scan_for_btrfs(BTRFS_SCAN_DEV, run_ioctls);
- return ret;
-}
-
int btrfs_device_already_in_root(struct btrfs_root *root, int fd,
int super_offset)
{