diff options
author | Sage Weil <sage@newdream.net> | 2010-02-15 15:08:46 -0500 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-02-17 01:01:08 -0500 |
commit | 44ca18f2682eb1cfbed153849adedb79e3e19790 (patch) | |
tree | 063dd8382179e65717ec10dc1ffc135950050abd /fs/ceph/mds_client.h | |
parent | 91e45ce38946a8efa21fefbc65d023ca3c0b434f (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/mds_client.h')
-rw-r--r-- | fs/ceph/mds_client.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ceph/mds_client.h b/fs/ceph/mds_client.h index ee71495e27c4..98f09cd06006 100644 --- a/fs/ceph/mds_client.h +++ b/fs/ceph/mds_client.h | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/list.h> | 6 | #include <linux/list.h> |
7 | #include <linux/mutex.h> | 7 | #include <linux/mutex.h> |
8 | #include <linux/radix-tree.h> | 8 | #include <linux/radix-tree.h> |
9 | #include <linux/rbtree.h> | ||
9 | #include <linux/spinlock.h> | 10 | #include <linux/spinlock.h> |
10 | 11 | ||
11 | #include "types.h" | 12 | #include "types.h" |
@@ -150,6 +151,7 @@ typedef void (*ceph_mds_request_callback_t) (struct ceph_mds_client *mdsc, | |||
150 | */ | 151 | */ |
151 | struct ceph_mds_request { | 152 | struct ceph_mds_request { |
152 | u64 r_tid; /* transaction id */ | 153 | u64 r_tid; /* transaction id */ |
154 | struct rb_node r_node; | ||
153 | 155 | ||
154 | int r_op; /* mds op code */ | 156 | int r_op; /* mds op code */ |
155 | int r_mds; | 157 | int r_mds; |
@@ -249,7 +251,7 @@ struct ceph_mds_client { | |||
249 | spinlock_t snap_empty_lock; /* protect snap_empty */ | 251 | spinlock_t snap_empty_lock; /* protect snap_empty */ |
250 | 252 | ||
251 | u64 last_tid; /* most recent mds request */ | 253 | u64 last_tid; /* most recent mds request */ |
252 | struct radix_tree_root request_tree; /* pending mds requests */ | 254 | struct rb_root request_tree; /* pending mds requests */ |
253 | struct delayed_work delayed_work; /* delayed work */ | 255 | struct delayed_work delayed_work; /* delayed work */ |
254 | unsigned long last_renew_caps; /* last time we renewed our caps */ | 256 | unsigned long last_renew_caps; /* last time we renewed our caps */ |
255 | struct list_head cap_delay_list; /* caps with delayed release */ | 257 | struct list_head cap_delay_list; /* caps with delayed release */ |