From patchwork Mon Oct 7 10:21:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 2995461 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5FD109F1C4 for ; Mon, 7 Oct 2013 10:14:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 46145201CB for ; Mon, 7 Oct 2013 10:14:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0AB9C201C8 for ; Mon, 7 Oct 2013 10:14:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755459Ab3JGKOR (ORCPT ); Mon, 7 Oct 2013 06:14:17 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:39264 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755285Ab3JGKOG (ORCPT ); Mon, 7 Oct 2013 06:14:06 -0400 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r97AE0xp010210 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 7 Oct 2013 10:14:01 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r97ADwcu015833 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 7 Oct 2013 10:13:58 GMT Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r97ADwTn021354; Mon, 7 Oct 2013 10:13:58 GMT Received: from wish.sg.oracle.com (/10.186.101.18) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 07 Oct 2013 03:13:57 -0700 Message-ID: <52528B1A.5030402@oracle.com> Date: Mon, 07 Oct 2013 18:21:14 +0800 From: Anand Jain User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: dsterba@suse.cz, Wang Shilong , linux-btrfs@vger.kernel.org Subject: Re: [PATCH] btrfs-progs: create helper function to use lblkid to scan for btrfs disks References: <1380296700-7232-1-git-send-email-anand.jain@oracle.com> <5245ADFC.2090706@oracle.com> <3CB50CC0-506D-4B7B-B66B-D01FC021BF63@gmail.com> <20131001120352.GB18291@twin.jikos.cz> In-Reply-To: <20131001120352.GB18291@twin.jikos.cz> X-Source-IP: acsinet21.oracle.com [141.146.126.237] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP >>> 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. --- # 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 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) { ------