linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand jain <Anand.Jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Cc: Liu Bo <liubo2009@cn.fujitsu.com>
Subject: [PATCH 2/9] Btrfs-progs: search subvolumes with proper objectid
Date: Fri,  3 Aug 2012 17:48:51 +0800	[thread overview]
Message-ID: <1343987338-10612-4-git-send-email-Anand.Jain@oracle.com> (raw)
In-Reply-To: <1343987338-10612-1-git-send-email-Anand.Jain@oracle.com>

From: Liu Bo <liubo2009@cn.fujitsu.com>

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 <liubo2009@cn.fujitsu.com>
---
 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;
-- 
1.7.1


  parent reply	other threads:[~2012-08-03  9:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-01 12:01 [PATCH] add crtime to the snapshot list Anand jain
2012-08-01 12:01 ` [PATCH] Btrfs-progs: show crtime in " Anand jain
2012-08-01 12:14 ` [PATCH] add crtime to " Alexander Block
2012-08-01 15:56   ` anand jain
2012-08-01 12:43 ` Liu Bo
2012-08-03  9:48 ` [PATCH 0/9 V2] Include otime in " Anand jain
2012-08-03  9:48   ` [PATCH] Btrfs: introduce subvol uuids and times Anand jain
2012-08-03  9:48   ` [PATCH 1/9] Update ctree.h and ioctl.h for the new uuid+times for subvolumes Anand jain
2012-08-03  9:48   ` Anand jain [this message]
2012-08-03  9:48   ` [PATCH 3/9] Btrfs-progs: refactor resolve_root() function a bit Anand jain
2012-08-03  9:48   ` [PATCH 4/9] Btrfs-progs: nuke redundant zeroing in __list_subvol_search() Anand jain
2012-08-03  9:48   ` [PATCH 5/9] Btrfs-progs: bring 'subvol get-default' back in Anand jain
2012-08-03  9:48   ` [PATCH 6/9] Btrfs-progs: show generation in command btrfs subvol list Anand jain
2012-08-03  9:48   ` [PATCH 7/9] Btrfs-progs: list snapshots by generation Anand jain
2012-08-03  9:48   ` [PATCH 8/9] Btrfs-progs: add otime to the snapshot list Anand jain
2012-08-03  9:48   ` [PATCH 9/9] Btrfs-progs: fix the btrfs subvol list path last char Anand jain
2012-08-14  6:04   ` [PATCH] get uuid of subvol and snapshot Anand jain
2012-08-14  6:04     ` [PATCH] add -u to show subvol uuid 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=1343987338-10612-4-git-send-email-Anand.Jain@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=liubo2009@cn.fujitsu.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 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).