From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 1/5] btrfs-progs: scan /proc/partitions not all of /dev with "-d"
Date: Sat, 13 Sep 2014 09:21:18 +0800 [thread overview]
Message-ID: <1410571282-3482-1-git-send-email-anand.jain@oracle.com> (raw)
From: Eric Sandeen <sandeen@redhat.com>
We can scan for btrfs devices in a few ways. By default
libblkid is used for "device scan" and "filesystem show";
with the -m option only mounted filesystems are scanned,
and with -d we physically read every system device.
But there's no reason for the complexity of a descent through
/dev; /proc/partitions has every device known to the kernel, so
just use that when -d is specified.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
---
cmds-device.c | 2 +-
cmds-filesystem.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/cmds-device.c b/cmds-device.c
index d7af090..ad0bd35 100644
--- a/cmds-device.c
+++ b/cmds-device.c
@@ -223,7 +223,7 @@ static int cmd_scan_dev(int argc, char **argv)
break;
switch (c) {
case 'd':
- where = BTRFS_SCAN_DEV;
+ where = BTRFS_SCAN_PROC;
all = 1;
break;
default:
diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index d8b6938..818e05f 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -563,7 +563,7 @@ static int cmd_show(int argc, char **argv)
break;
switch (c) {
case 'd':
- where = BTRFS_SCAN_DEV;
+ where = BTRFS_SCAN_PROC;
break;
case 'm':
where = BTRFS_SCAN_MOUNTED;
@@ -587,7 +587,7 @@ static int cmd_show(int argc, char **argv)
* right away
*/
if (type == BTRFS_ARG_BLKDEV) {
- if (where == BTRFS_SCAN_DEV) {
+ if (where == BTRFS_SCAN_PROC) {
/* we need to do this because
* legacy BTRFS_SCAN_DEV
* provides /dev/dm-x paths
@@ -618,7 +618,7 @@ static int cmd_show(int argc, char **argv)
}
}
- if (where == BTRFS_SCAN_DEV)
+ if (where == BTRFS_SCAN_PROC)
goto devs_only;
/* show mounted btrfs */
--
2.0.0.153.g79dcccc
next reply other threads:[~2014-09-13 9:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-13 1:21 Anand Jain [this message]
2014-09-13 1:21 ` [PATCH 2/5] btrfs-progs: don't fall back to recursive /dev scan Anand Jain
2014-09-13 1:21 ` [PATCH 3/5] btrfs-progs: remove BTRFS_SCAN_DEV and btrfs_scan_one_dir Anand Jain
2014-09-13 1:21 ` [PATCH 4/5] btrfs-progs: remove BTRFS_SCAN_PROC scan method Anand Jain
2014-10-07 0:08 ` [PATCH] btrfs-progs: btrfs_scan_block_devices is unused function delete it Anand Jain
2014-10-22 11:10 ` Anand Jain
2015-05-05 16:54 ` David Sterba
2014-09-13 1:21 ` [PATCH 5/5] btrfs-progs: remove scan_for_btrfs() Anand Jain
2014-09-23 17:00 ` [PATCH 1/5] btrfs-progs: scan /proc/partitions not all of /dev with "-d" David Sterba
2014-10-06 9:31 ` Anand Jain
2014-10-23 13:12 ` Anand Jain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1410571282-3482-1-git-send-email-anand.jain@oracle.com \
--to=anand.jain@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).