aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/debugfs.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-02-15 15:08:46 -0500
committerSage Weil <sage@newdream.net>2010-02-17 01:01:08 -0500
commit44ca18f2682eb1cfbed153849adedb79e3e19790 (patch)
tree063dd8382179e65717ec10dc1ffc135950050abd /fs/ceph/debugfs.c
parent91e45ce38946a8efa21fefbc65d023ca3c0b434f (diff)
ceph: use rbtree for mds requests
The rbtree is a more appropriate data structure than a radix_tree. It avoids extra memory usage and simplifies the code. It also fixes a bug where the debugfs 'mdsc' file wasn't including the most recent mds request. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/debugfs.c')
-rw-r--r--fs/ceph/debugfs.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c
index fba44b2a6086..cd5dd805e4be 100644
--- a/fs/ceph/debugfs.c
+++ b/fs/ceph/debugfs.c
@@ -142,21 +142,16 @@ static int monc_show(struct seq_file *s, void *p)
142static int mdsc_show(struct seq_file *s, void *p) 142static int mdsc_show(struct seq_file *s, void *p)
143{ 143{
144 struct ceph_client *client = s->private; 144 struct ceph_client *client = s->private;
145 struct ceph_mds_request *req;
146 u64 nexttid = 0;
147 int got;
148 struct ceph_mds_client *mdsc = &client->mdsc; 145 struct ceph_mds_client *mdsc = &client->mdsc;
146 struct ceph_mds_request *req;
147 struct rb_node *rp;
149 int pathlen; 148 int pathlen;
150 u64 pathbase; 149 u64 pathbase;
151 char *path; 150 char *path;
152 151
153 mutex_lock(&mdsc->mutex); 152 mutex_lock(&mdsc->mutex);
154 while (nexttid < mdsc->last_tid) { 153 for (rp = rb_first(&mdsc->request_tree); rp; rp = rb_next(rp)) {
155 got = radix_tree_gang_lookup(&mdsc->request_tree, 154 req = rb_entry(rp, struct ceph_mds_request, r_node);
156 (void **)&req, nexttid, 1);
157 if (got == 0)
158 break;
159 nexttid = req->r_tid + 1;
160 155
161 if (req->r_request) 156 if (req->r_request)
162 seq_printf(s, "%lld\tmds%d\t", req->r_tid, req->r_mds); 157 seq_printf(s, "%lld\tmds%d\t", req->r_tid, req->r_mds);