All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anand Jain <Anand.Jain@oracle.com>
To: dsterba@suse.cz, Wang Shilong <wangshilong1991@gmail.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs-progs: create helper function to use lblkid to scan for btrfs disks
Date: Mon, 07 Oct 2013 18:21:14 +0800	[thread overview]
Message-ID: <52528B1A.5030402@oracle.com> (raw)
In-Reply-To: <20131001120352.GB18291@twin.jikos.cz>



>>> Following this patch the idea is to use lblkid to scan
>>> for the btrfs disks by default which means we don't
>>> use BTRFS_SCAN_PROC any more.
>>
>> Firstly, i would like to know if we will get any different results between scanning
>> /proc/partions and using lbkid.
>
> I take blkid as a more authoritative source, /proc/partitions was a
> workaround to avoid scanning the whole /dev directory.
>
>> If not, why we can use liblkid totally,since this is more simple.
>
> Agreed, blkid by default and --all-devices as a last resort fallback.


compiled using BTRFS_SCAN_LBLKID as default.
---
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -402,7 +402,8 @@ static int cmd_show(int argc, char **argv)
         struct list_head *cur_uuid;
         char *search = NULL;
         int ret;
-       int where = BTRFS_SCAN_PROC;
+       int where = BTRFS_SCAN_LBLKID;
         int type = 0;

         while (1) {
------

# btrfs fi show
Label: none  uuid: c114c6ce-58a1-4e2c-839e-b53c5ba5ba75
	Total devices 1 FS bytes used 756.00KiB
	devid    1 size 1.10GiB used 324.00MiB path /dev/mapper/mpathg
---

recompiled to use BTRFS_SCAN_PROC as in original.
---
# btrfs fi show
Label: none  uuid: c114c6ce-58a1-4e2c-839e-b53c5ba5ba75
	Total devices 1 FS bytes used 36.00KiB
	devid    1 size 1.10GiB used 148.62MiB path /dev/dm-2
---


 > The proc workaround can go away.

  The other choice is to use both, 'BTRFS_SCAN_PROC | BTRFS_SCAN_DEV'
  for --all-devices option. in that way proc-way will still be in there.

Thanks, Anand


      reply	other threads:[~2013-10-07 10:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-27 15:45 [PATCH] btrfs-progs: create helper function to use lblkid to scan for btrfs disks Anand Jain
2013-09-27 16:10 ` Anand Jain
2013-09-27 16:21   ` Wang Shilong
2013-10-01 12:03     ` David Sterba
2013-10-07 10:21       ` Anand Jain [this message]

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=52528B1A.5030402@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wangshilong1991@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.