提交 1fbfdfcd 编写于 作者: J Jens Axboe 提交者: Jens Axboe

[PATCH] elevator: introduce a way to reuse rq for internal FIFO handling

The io schedulers can use this instead of having to allocate space for
it themselves.
Signed-off-by: NJens Axboe <axboe@suse.de>
上级 b8aca35a
......@@ -166,4 +166,16 @@ enum {
#define rq_end_sector(rq) ((rq)->sector + (rq)->nr_sectors)
#define rb_entry_rq(node) rb_entry((node), struct request, rb_node)
/*
* Hack to reuse the donelist list_head as the fifo time holder while
* the request is in the io scheduler. Saves an unsigned long in rq.
*/
#define rq_fifo_time(rq) ((unsigned long) (rq)->donelist.next)
#define rq_set_fifo_time(rq,exp) ((rq)->donelist.next = (void *) (exp))
#define rq_entry_fifo(ptr) list_entry((ptr), struct request, queuelist)
#define rq_fifo_clear(rq) do { \
list_del_init(&(rq)->queuelist); \
INIT_LIST_HEAD(&(rq)->donelist); \
} while (0)
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册