]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/ceph/debugfs.c
ceph: use rbtree for mds requests
[karo-tx-linux.git] / fs / ceph / debugfs.c
index fba44b2a608681dd4f7f828338dd037593132cf6..cd5dd805e4be03048f79c06cdbe6ac0ffc453e78 100644 (file)
@@ -142,21 +142,16 @@ static int monc_show(struct seq_file *s, void *p)
 static int mdsc_show(struct seq_file *s, void *p)
 {
        struct ceph_client *client = s->private;
-       struct ceph_mds_request *req;
-       u64 nexttid = 0;
-       int got;
        struct ceph_mds_client *mdsc = &client->mdsc;
+       struct ceph_mds_request *req;
+       struct rb_node *rp;
        int pathlen;
        u64 pathbase;
        char *path;
 
        mutex_lock(&mdsc->mutex);
-       while (nexttid < mdsc->last_tid) {
-               got = radix_tree_gang_lookup(&mdsc->request_tree,
-                                            (void **)&req, nexttid, 1);
-               if (got == 0)
-                       break;
-               nexttid = req->r_tid + 1;
+       for (rp = rb_first(&mdsc->request_tree); rp; rp = rb_next(rp)) {
+               req = rb_entry(rp, struct ceph_mds_request, r_node);
 
                if (req->r_request)
                        seq_printf(s, "%lld\tmds%d\t", req->r_tid, req->r_mds);