xfs: fix access to upper inodes without inode64
[safe/jmp/linux-2.6] / fs / ceph / debugfs.c
index cd5dd80..f7048da 100644 (file)
@@ -1,6 +1,7 @@
 #include "ceph_debug.h"
 
 #include <linux/device.h>
+#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/ctype.h>
 #include <linux/debugfs.h>
@@ -78,6 +79,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 +89,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++) {
@@ -112,9 +114,8 @@ static int monc_show(struct seq_file *s, void *p)
 {
        struct ceph_client *client = s->private;
        struct ceph_mon_statfs_request *req;
-       u64 nexttid = 0;
-       int got;
        struct ceph_mon_client *monc = &client->monc;
+       struct rb_node *rp;
 
        mutex_lock(&monc->mutex);
 
@@ -125,17 +126,12 @@ static int monc_show(struct seq_file *s, void *p)
        if (monc->want_next_osdmap)
                seq_printf(s, "want next osdmap\n");
 
-       while (nexttid < monc->last_tid) {
-               got = radix_tree_gang_lookup(&monc->statfs_request_tree,
-                                            (void **)&req, nexttid, 1);
-               if (got == 0)
-                       break;
-               nexttid = req->tid + 1;
-
+       for (rp = rb_first(&monc->statfs_request_tree); rp; rp = rb_next(rp)) {
+               req = rb_entry(rp, struct ceph_mon_statfs_request, node);
                seq_printf(s, "%lld statfs\n", req->tid);
        }
-       mutex_unlock(&monc->mutex);
 
+       mutex_unlock(&monc->mutex);
        return 0;
 }
 
@@ -261,14 +257,15 @@ static int osdc_show(struct seq_file *s, void *pp)
 static int caps_show(struct seq_file *s, void *p)
 {
        struct ceph_client *client = p;
-       int total, avail, used, reserved;
+       int total, avail, used, reserved, min;
 
-       ceph_reservation_status(client, &total, &avail, &used, &reserved);
+       ceph_reservation_status(client, &total, &avail, &used, &reserved, &min);
        seq_printf(s, "total\t\t%d\n"
-                     "avail\t\t%d\n"
-                     "used\t\t%d\n"
-                     "reserved\t%d\n",
-                  total, avail, used, reserved);
+                  "avail\t\t%d\n"
+                  "used\t\t%d\n"
+                  "reserved\t%d\n"
+                  "min\t%d\n",
+                  total, avail, used, reserved, min);
        return 0;
 }