summaryrefslogtreecommitdiffstats
path: root/include/linux/blkdev.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-10-28 08:53:49 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-28 08:53:49 -0700
commit28d721e24c88496ff8e9c4a0959bdc1415c0658e (patch)
tree0652161bbbcbfddf47c7ddb25d2db8ecd4cbec89 /include/linux/blkdev.h
parent0ee40c6628434f0535da31deeacc28b61e80d810 (diff)
parentcb19833dccb32f97cacbfff834b53523915f13f6 (diff)
downloadblackbird-op-linux-28d721e24c88496ff8e9c4a0959bdc1415c0658e.tar.gz
blackbird-op-linux-28d721e24c88496ff8e9c4a0959bdc1415c0658e.zip
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.h26
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 {
enum rq_flag_bits {
__REQ_RW, /* not set, read. set, write */
__REQ_FAILFAST, /* no low level driver retries */
+ __REQ_SORTED, /* elevator knows about this request */
__REQ_SOFTBARRIER, /* may not be passed by ioscheduler */
__REQ_HARDBARRIER, /* may not be passed by drive either */
__REQ_CMD, /* is a regular fs rw request */
@@ -235,6 +236,7 @@ enum rq_flag_bits {
#define REQ_RW (1 << __REQ_RW)
#define REQ_FAILFAST (1 << __REQ_FAILFAST)
+#define REQ_SORTED (1 << __REQ_SORTED)
#define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER)
#define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER)
#define REQ_CMD (1 << __REQ_CMD)
@@ -333,6 +335,12 @@ struct request_queue
end_flush_fn *end_flush_fn;
/*
+ * Dispatch queue sorting
+ */
+ sector_t end_sector;
+ struct request *boundary_rq;
+
+ /*
* Auto-unplugging state
*/
struct timer_list unplug_timer;
@@ -454,6 +462,7 @@ enum {
#define blk_pm_request(rq) \
((rq)->flags & (REQ_PM_SUSPEND | REQ_PM_RESUME))
+#define blk_sorted_rq(rq) ((rq)->flags & REQ_SORTED)
#define blk_barrier_rq(rq) ((rq)->flags & REQ_HARDBARRIER)
#define blk_barrier_preflush(rq) ((rq)->flags & REQ_BAR_PREFLUSH)
#define blk_barrier_postflush(rq) ((rq)->flags & REQ_BAR_POSTFLUSH)
@@ -611,12 +620,21 @@ extern void end_request(struct request *req, int uptodate);
static inline void blkdev_dequeue_request(struct request *req)
{
- BUG_ON(list_empty(&req->queuelist));
+ elv_dequeue_request(req->q, req);
+}
- list_del_init(&req->queuelist);
+/*
+ * This should be in elevator.h, but that requires pulling in rq and q
+ */
+static inline void elv_dispatch_add_tail(struct request_queue *q,
+ struct request *rq)
+{
+ if (q->last_merge == rq)
+ q->last_merge = NULL;
- if (req->rl)
- elv_remove_request(req->q, req);
+ q->end_sector = rq_end_sector(rq);
+ q->boundary_rq = rq;
+ list_add_tail(&rq->queuelist, &q->queue_head);
}
/*
OpenPOWER on IntegriCloud