aboutsummaryrefslogtreecommitdiffstats
path: root/block/deadline-iosched.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2006-04-21 08:15:17 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2006-04-21 08:15:17 -0400
commit3db3a445308b3cee9bbbd8baa6d05081c9532da0 (patch)
tree768e3a190df58b0f5f5d4a5c5ade925649e757dd /block/deadline-iosched.c
parent7fe1e133bf45b0fe70491ed3d4c5b491feff7aa8 (diff)
[RBTREE] Change rbtree off-tree marking in I/O schedulers.
They were abusing the rb_color field to mark nodes which weren't currently on the tree. Fix that to use the same method as eventpoll did -- setting the parent pointer to point back to itself. And use the appropriate accessor macros for setting and reading the parent. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'block/deadline-iosched.c')
-rw-r--r--block/deadline-iosched.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/block/deadline-iosched.c b/block/deadline-iosched.c
index 399fa1e60e1f..06962d8402a3 100644
--- a/block/deadline-iosched.c
+++ b/block/deadline-iosched.c
@@ -165,10 +165,9 @@ deadline_find_drq_hash(struct deadline_data *dd, sector_t offset)
165/* 165/*
166 * rb tree support functions 166 * rb tree support functions
167 */ 167 */
168#define RB_NONE (2)
169#define RB_EMPTY(root) ((root)->rb_node == NULL) 168#define RB_EMPTY(root) ((root)->rb_node == NULL)
170#define ON_RB(node) ((node)->rb_color != RB_NONE) 169#define ON_RB(node) (rb_parent(node) != node)
171#define RB_CLEAR(node) ((node)->rb_color = RB_NONE) 170#define RB_CLEAR(node) (rb_set_parent(node, node))
172#define rb_entry_drq(node) rb_entry((node), struct deadline_rq, rb_node) 171#define rb_entry_drq(node) rb_entry((node), struct deadline_rq, rb_node)
173#define DRQ_RB_ROOT(dd, drq) (&(dd)->sort_list[rq_data_dir((drq)->request)]) 172#define DRQ_RB_ROOT(dd, drq) (&(dd)->sort_list[rq_data_dir((drq)->request)])
174#define rq_rb_key(rq) (rq)->sector 173#define rq_rb_key(rq) (rq)->sector