From patchwork Fri Aug 3 09:48:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 1270141 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 2EA263FCFC for ; Fri, 3 Aug 2012 09:51:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752853Ab2HCJve (ORCPT ); Fri, 3 Aug 2012 05:51:34 -0400 Received: from rcsinet15.oracle.com ([148.87.113.117]:46605 "EHLO rcsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752532Ab2HCJvd (ORCPT ); Fri, 3 Aug 2012 05:51:33 -0400 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q739pRSb026298 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 3 Aug 2012 09:51:28 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q739pRs8007619 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 3 Aug 2012 09:51:27 GMT Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q739pR90018639; Fri, 3 Aug 2012 04:51:27 -0500 Received: from localhost.localdomain (/10.186.101.18) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 03 Aug 2012 02:51:26 -0700 From: Anand jain To: linux-btrfs@vger.kernel.org Cc: Liu Bo Subject: [PATCH 2/9] Btrfs-progs: search subvolumes with proper objectid Date: Fri, 3 Aug 2012 17:48:51 +0800 Message-Id: <1343987338-10612-4-git-send-email-Anand.Jain@oracle.com> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1343987338-10612-1-git-send-email-Anand.Jain@oracle.com> References: <1343822481-26707-1-git-send-email-Anand.Jain@oracle.com> <1343987338-10612-1-git-send-email-Anand.Jain@oracle.com> 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 From: Liu Bo Btrfs's subvolume/snapshot is limited to [BTRFS_FIRST_FREE_OBJECTID, BTRFS_LAST_FREE_OBJECTID], so just apply the range. Signed-off-by: Liu Bo --- btrfs-list.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/btrfs-list.c b/btrfs-list.c index 35e6139..680dd03 100644 --- a/btrfs-list.c +++ b/btrfs-list.c @@ -585,11 +585,13 @@ static int __list_subvol_search(int fd, struct root_lookup *root_lookup) sk->max_type = BTRFS_ROOT_BACKREF_KEY; sk->min_type = BTRFS_ROOT_BACKREF_KEY; + sk->min_objectid = BTRFS_FIRST_FREE_OBJECTID; + /* * set all the other params to the max, we'll take any objectid * and any trans */ - sk->max_objectid = (u64)-1; + sk->max_objectid = BTRFS_LAST_FREE_OBJECTID; sk->max_offset = (u64)-1; sk->max_transid = (u64)-1; @@ -641,7 +643,7 @@ static int __list_subvol_search(int fd, struct root_lookup *root_lookup) if (sk->min_type < BTRFS_ROOT_BACKREF_KEY) { sk->min_type = BTRFS_ROOT_BACKREF_KEY; sk->min_offset = 0; - } else if (sk->min_objectid < (u64)-1) { + } else if (sk->min_objectid < BTRFS_LAST_FREE_OBJECTID) { sk->min_objectid++; sk->min_type = BTRFS_ROOT_BACKREF_KEY; sk->min_offset = 0;