aboutsummaryrefslogtreecommitdiffstats
path: root/block/as-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/as-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/as-iosched.c')
-rw-r--r--block/as-iosched.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/block/as-iosched.c b/block/as-iosched.c
index e25a5d79ab27..ed336ab453ba 100644
--- a/block/as-iosched.c
+++ b/block/as-iosched.c
@@ -353,10 +353,9 @@ static struct request *as_find_arq_hash(struct as_data *ad, sector_t offset)
353/* 353/*
354 * rb tree support functions 354 * rb tree support functions
355 */ 355 */
356#define RB_NONE (2)
357#define RB_EMPTY(root) ((root)->rb_node == NULL) 356#define RB_EMPTY(root) ((root)->rb_node == NULL)
358#define ON_RB(node) ((node)->rb_color != RB_NONE) 357#define ON_RB(node) (rb_parent(node) != node)
359#define RB_CLEAR(node) ((node)->rb_color = RB_NONE) 358#define RB_CLEAR(node) (rb_set_parent(node, node))
360#define rb_entry_arq(node) rb_entry((node), struct as_rq, rb_node) 359#define rb_entry_arq(node) rb_entry((node), struct as_rq, rb_node)
361#define ARQ_RB_ROOT(ad, arq) (&(ad)->sort_list[(arq)->is_sync]) 360#define ARQ_RB_ROOT(ad, arq) (&(ad)->sort_list[(arq)->is_sync])
362#define rq_rb_key(rq) (rq)->sector 361#define rq_rb_key(rq) (rq)->sector