Re: [PATCH] btrfs-progs: create helper function to use lblkid to scan for btrfs disks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





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

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux