[7/9] Btrfs: qgroup: make the btree for qgroup increase from left to right.
diff mbox

Message ID 1423563803-8996-10-git-send-email-yangds.fnst@cn.fujitsu.com
State New, archived
Headers show

Commit Message

Yang Dongsheng Feb. 10, 2015, 10:23 a.m. UTC
It's not a big deal, but I would rather make the btree follow the
convention to increase from left to right.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
---
 fs/btrfs/qgroup.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Patch
diff mbox

diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 34717ed..d3c261b 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -117,9 +117,9 @@  static struct btrfs_qgroup *find_qgroup_rb(struct btrfs_fs_info *fs_info,
 	while (n) {
 		qgroup = rb_entry(n, struct btrfs_qgroup, node);
 		if (qgroup->qgroupid < qgroupid)
-			n = n->rb_left;
-		else if (qgroup->qgroupid > qgroupid)
 			n = n->rb_right;
+		else if (qgroup->qgroupid > qgroupid)
+			n = n->rb_left;
 		else
 			return qgroup;
 	}
@@ -139,9 +139,9 @@  static struct btrfs_qgroup *add_qgroup_rb(struct btrfs_fs_info *fs_info,
 		qgroup = rb_entry(parent, struct btrfs_qgroup, node);
 
 		if (qgroup->qgroupid < qgroupid)
-			p = &(*p)->rb_left;
-		else if (qgroup->qgroupid > qgroupid)
 			p = &(*p)->rb_right;
+		else if (qgroup->qgroupid > qgroupid)
+			p = &(*p)->rb_left;
 		else
 			return qgroup;
 	}