linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3 RESEND] Btrfs-progs: search subvolumes with proper objectid
@ 2012-07-31  5:49 Liu Bo
  2012-07-31  5:49 ` [PATCH 2/3 RESEND] Btrfs-progs: show generation in command btrfs subvol list Liu Bo
  2012-07-31  5:49 ` [PATCH 3/3] Btrfs-progs: list snapshots by generation Liu Bo
  0 siblings, 2 replies; 6+ messages in thread
From: Liu Bo @ 2012-07-31  5:49 UTC (permalink / raw)
  To: linux-btrfs

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 c53d016..ac6507a 100644
--- a/btrfs-list.c
+++ b/btrfs-list.c
@@ -634,11 +634,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;
 
@@ -690,7 +692,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.6.5.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-08-02  9:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-31  5:49 [PATCH 1/3 RESEND] Btrfs-progs: search subvolumes with proper objectid Liu Bo
2012-07-31  5:49 ` [PATCH 2/3 RESEND] Btrfs-progs: show generation in command btrfs subvol list Liu Bo
2012-07-31  5:49 ` [PATCH 3/3] Btrfs-progs: list snapshots by generation Liu Bo
2012-07-31 21:16   ` Goffredo Baroncelli
2012-08-01 11:28     ` Liu Bo
2012-08-02  9:52   ` Anand Jain

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).