summaryrefslogtreecommitdiffstats
path: root/fs/ceph/debugfs.c
diff options
context:
space:
mode:
authorSage Weil2010-02-17 00:55:03 +0100
committerSage Weil2010-02-17 19:02:49 +0100
commit4fc51be8fa7043ff9a1e34fef0e99214373332ac (patch)
treebeba3bc83b5a07a16bb63c6e80713cb2b42bf4fb /fs/ceph/debugfs.c
parentceph: fix memory leak when destroying osdmap with pg_temp mappings (diff)
downloadkernel-qcow2-linux-4fc51be8fa7043ff9a1e34fef0e99214373332ac.tar.gz
kernel-qcow2-linux-4fc51be8fa7043ff9a1e34fef0e99214373332ac.tar.xz
kernel-qcow2-linux-4fc51be8fa7043ff9a1e34fef0e99214373332ac.zip
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>
Diffstat (limited to 'fs/ceph/debugfs.c')
-rw-r--r--fs/ceph/debugfs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c
index 1a47b5c25b5f..e159f1415110 100644
--- a/fs/ceph/debugfs.c
+++ b/fs/ceph/debugfs.c
@@ -78,6 +78,7 @@ static int osdmap_show(struct seq_file *s, void *p)
{
int i;
struct ceph_client *client = s->private;
+ struct rb_node *n;
if (client->osdc.osdmap == NULL)
return 0;
@@ -87,11 +88,11 @@ static int osdmap_show(struct seq_file *s, void *p)
" NEARFULL" : "",
(client->osdc.osdmap->flags & CEPH_OSDMAP_FULL) ?
" FULL" : "");
- for (i = 0; i < client->osdc.osdmap->num_pools; i++) {
+ for (n = rb_first(&client->osdc.osdmap->pg_pools); n; n = rb_next(n)) {
struct ceph_pg_pool_info *pool =
- &client->osdc.osdmap->pg_pool[i];
+ rb_entry(n, struct ceph_pg_pool_info, node);
seq_printf(s, "pg_pool %d pg_num %d / %d, lpg_num %d / %d\n",
- i, pool->v.pg_num, pool->pg_num_mask,
+ pool->id, pool->v.pg_num, pool->pg_num_mask,
pool->v.lpg_num, pool->lpg_num_mask);
}
for (i = 0; i < client->osdc.osdmap->max_osd; i++) {