aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/debugfs.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-02-15 17:47:28 -0500
committerSage Weil <sage@newdream.net>2010-02-17 01:01:10 -0500
commit85ff03f6bfef7d5b59ab3aefd4773f497ffad8a4 (patch)
treeef0a700d68f87b84ebb235c2ed7aae69c7414a8d /fs/ceph/debugfs.c
parenta105f00cf17d711e876b3dc67e15f9a89b7de5a3 (diff)
ceph: use rbtree for mon statfs requests
An rbtree is lighter weight, particularly given we will generally have very few in-flight statfs requests. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/debugfs.c')
-rw-r--r--fs/ceph/debugfs.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c
index cd5dd805e4be..b58bd9188692 100644
--- a/fs/ceph/debugfs.c
+++ b/fs/ceph/debugfs.c
@@ -112,9 +112,8 @@ static int monc_show(struct seq_file *s, void *p)
112{ 112{
113 struct ceph_client *client = s->private; 113 struct ceph_client *client = s->private;
114 struct ceph_mon_statfs_request *req; 114 struct ceph_mon_statfs_request *req;
115 u64 nexttid = 0;
116 int got;
117 struct ceph_mon_client *monc = &client->monc; 115 struct ceph_mon_client *monc = &client->monc;
116 struct rb_node *rp;
118 117
119 mutex_lock(&monc->mutex); 118 mutex_lock(&monc->mutex);
120 119
@@ -125,17 +124,12 @@ static int monc_show(struct seq_file *s, void *p)
125 if (monc->want_next_osdmap) 124 if (monc->want_next_osdmap)
126 seq_printf(s, "want next osdmap\n"); 125 seq_printf(s, "want next osdmap\n");
127 126
128 while (nexttid < monc->last_tid) { 127 for (rp = rb_first(&monc->statfs_request_tree); rp; rp = rb_next(rp)) {
129 got = radix_tree_gang_lookup(&monc->statfs_request_tree, 128 req = rb_entry(rp, struct ceph_mon_statfs_request, node);
130 (void **)&req, nexttid, 1);
131 if (got == 0)
132 break;
133 nexttid = req->tid + 1;
134
135 seq_printf(s, "%lld statfs\n", req->tid); 129 seq_printf(s, "%lld statfs\n", req->tid);
136 } 130 }
137 mutex_unlock(&monc->mutex);
138 131
132 mutex_unlock(&monc->mutex);
139 return 0; 133 return 0;
140} 134}
141 135