ceph: use rbtree for pg pools; decode new osdmap format

Since we can now create and destroy pg pools, the pool ids will be sparse,
and an array no longer makes sense for looking up by pool id.  Use an
rbtree instead.

The OSDMap encoding also no longer has a max pool count (previously used to
allocate the array).  There is a new pool_max, that is the largest pool id
we've ever used, although we don't actually need it in the client.

Signed-off-by: Sage Weil <sage@newdream.net>
diff --git a/fs/ceph/osdmap.h b/fs/ceph/osdmap.h
index c4af841..1fb55af 100644
--- a/fs/ceph/osdmap.h
+++ b/fs/ceph/osdmap.h
@@ -19,6 +19,8 @@
  * the change between two successive epochs, or as a fully encoded map.
  */
 struct ceph_pg_pool_info {
+	struct rb_node node;
+	int id;
 	struct ceph_pg_pool v;
 	int pg_num_mask, pgp_num_mask, lpg_num_mask, lpgp_num_mask;
 };
@@ -44,9 +46,8 @@
 	struct ceph_entity_addr *osd_addr;
 
 	struct rb_root pg_temp;
-
-	u32 num_pools;
-	struct ceph_pg_pool_info *pg_pool;
+	struct rb_root pg_pools;
+	u32 pool_max;
 
 	/* the CRUSH map specifies the mapping of placement groups to
 	 * the list of osds that store+replicate them. */