From: Liu Bo <liubo2009@cn.fujitsu.com>
To: <linux-btrfs@vger.kernel.org>
Subject: [PATCH 1/2] Btrfs-progs: search subvolumes with proper objectid
Date: Tue, 24 Jul 2012 18:39:23 +0800 [thread overview]
Message-ID: <1343126364-27919-1-git-send-email-liubo2009@cn.fujitsu.com> (raw)
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
next reply other threads:[~2012-07-24 10:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-24 10:39 Liu Bo [this message]
2012-07-24 10:39 ` [PATCH 2/2] Btrfs-progs: show generation in command btrfs subvol list Liu Bo
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=1343126364-27919-1-git-send-email-liubo2009@cn.fujitsu.com \
--to=liubo2009@cn.fujitsu.com \
--cc=linux-btrfs@vger.kernel.org \
/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).