diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-28 11:53:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-28 11:53:49 -0400 |
commit | 28d721e24c88496ff8e9c4a0959bdc1415c0658e (patch) | |
tree | 0652161bbbcbfddf47c7ddb25d2db8ecd4cbec89 /include/linux/blkdev.h | |
parent | 0ee40c6628434f0535da31deeacc28b61e80d810 (diff) | |
parent | cb19833dccb32f97cacbfff834b53523915f13f6 (diff) |
Merge branch 'generic-dispatch' of git://brick.kernel.dk/data/git/linux-2.6-block
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r-- | include/linux/blkdev.h | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 1afbdb2d752c..fffe163316aa 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -203,6 +203,7 @@ struct request { | |||
203 | enum rq_flag_bits { | 203 | enum rq_flag_bits { |
204 | __REQ_RW, /* not set, read. set, write */ | 204 | __REQ_RW, /* not set, read. set, write */ |
205 | __REQ_FAILFAST, /* no low level driver retries */ | 205 | __REQ_FAILFAST, /* no low level driver retries */ |
206 | __REQ_SORTED, /* elevator knows about this request */ | ||
206 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ | 207 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ |
207 | __REQ_HARDBARRIER, /* may not be passed by drive either */ | 208 | __REQ_HARDBARRIER, /* may not be passed by drive either */ |
208 | __REQ_CMD, /* is a regular fs rw request */ | 209 | __REQ_CMD, /* is a regular fs rw request */ |
@@ -235,6 +236,7 @@ enum rq_flag_bits { | |||
235 | 236 | ||
236 | #define REQ_RW (1 << __REQ_RW) | 237 | #define REQ_RW (1 << __REQ_RW) |
237 | #define REQ_FAILFAST (1 << __REQ_FAILFAST) | 238 | #define REQ_FAILFAST (1 << __REQ_FAILFAST) |
239 | #define REQ_SORTED (1 << __REQ_SORTED) | ||
238 | #define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) | 240 | #define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) |
239 | #define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) | 241 | #define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) |
240 | #define REQ_CMD (1 << __REQ_CMD) | 242 | #define REQ_CMD (1 << __REQ_CMD) |
@@ -333,6 +335,12 @@ struct request_queue | |||
333 | end_flush_fn *end_flush_fn; | 335 | end_flush_fn *end_flush_fn; |
334 | 336 | ||
335 | /* | 337 | /* |
338 | * Dispatch queue sorting | ||
339 | */ | ||
340 | sector_t end_sector; | ||
341 | struct request *boundary_rq; | ||
342 | |||
343 | /* | ||
336 | * Auto-unplugging state | 344 | * Auto-unplugging state |
337 | */ | 345 | */ |
338 | struct timer_list unplug_timer; | 346 | struct timer_list unplug_timer; |
@@ -454,6 +462,7 @@ enum { | |||
454 | #define blk_pm_request(rq) \ | 462 | #define blk_pm_request(rq) \ |
455 | ((rq)->flags & (REQ_PM_SUSPEND | REQ_PM_RESUME)) | 463 | ((rq)->flags & (REQ_PM_SUSPEND | REQ_PM_RESUME)) |
456 | 464 | ||
465 | #define blk_sorted_rq(rq) ((rq)->flags & REQ_SORTED) | ||
457 | #define blk_barrier_rq(rq) ((rq)->flags & REQ_HARDBARRIER) | 466 | #define blk_barrier_rq(rq) ((rq)->flags & REQ_HARDBARRIER) |
458 | #define blk_barrier_preflush(rq) ((rq)->flags & REQ_BAR_PREFLUSH) | 467 | #define blk_barrier_preflush(rq) ((rq)->flags & REQ_BAR_PREFLUSH) |
459 | #define blk_barrier_postflush(rq) ((rq)->flags & REQ_BAR_POSTFLUSH) | 468 | #define blk_barrier_postflush(rq) ((rq)->flags & REQ_BAR_POSTFLUSH) |
@@ -611,12 +620,21 @@ extern void end_request(struct request *req, int uptodate); | |||
611 | 620 | ||
612 | static inline void blkdev_dequeue_request(struct request *req) | 621 | static inline void blkdev_dequeue_request(struct request *req) |
613 | { | 622 | { |
614 | BUG_ON(list_empty(&req->queuelist)); | 623 | elv_dequeue_request(req->q, req); |
624 | } | ||
615 | 625 | ||
616 | list_del_init(&req->queuelist); | 626 | /* |
627 | * This should be in elevator.h, but that requires pulling in rq and q | ||
628 | */ | ||
629 | static inline void elv_dispatch_add_tail(struct request_queue *q, | ||
630 | struct request *rq) | ||
631 | { | ||
632 | if (q->last_merge == rq) | ||
633 | q->last_merge = NULL; | ||
617 | 634 | ||
618 | if (req->rl) | 635 | q->end_sector = rq_end_sector(rq); |
619 | elv_remove_request(req->q, req); | 636 | q->boundary_rq = rq; |
637 | list_add_tail(&rq->queuelist, &q->queue_head); | ||
620 | } | 638 | } |
621 | 639 | ||
622 | /* | 640 | /* |