aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk.h
diff options
context:
space:
mode:
Diffstat (limited to 'block/blk.h')
-rw-r--r--block/blk.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/block/blk.h b/block/blk.h
index 79c85f7c9ff5..9b2c324e4407 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -43,6 +43,43 @@ static inline void blk_clear_rq_complete(struct request *rq)
43 clear_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags); 43 clear_bit(REQ_ATOM_COMPLETE, &rq->atomic_flags);
44} 44}
45 45
46/*
47 * Internal elevator interface
48 */
49#define ELV_ON_HASH(rq) (!hlist_unhashed(&(rq)->hash))
50
51static inline struct request *__elv_next_request(struct request_queue *q)
52{
53 struct request *rq;
54
55 while (1) {
56 while (!list_empty(&q->queue_head)) {
57 rq = list_entry_rq(q->queue_head.next);
58 if (blk_do_ordered(q, &rq))
59 return rq;
60 }
61
62 if (!q->elevator->ops->elevator_dispatch_fn(q, 0))
63 return NULL;
64 }
65}
66
67static inline void elv_activate_rq(struct request_queue *q, struct request *rq)
68{
69 struct elevator_queue *e = q->elevator;
70
71 if (e->ops->elevator_activate_req_fn)
72 e->ops->elevator_activate_req_fn(q, rq);
73}
74
75static inline void elv_deactivate_rq(struct request_queue *q, struct request *rq)
76{
77 struct elevator_queue *e = q->elevator;
78
79 if (e->ops->elevator_deactivate_req_fn)
80 e->ops->elevator_deactivate_req_fn(q, rq);
81}
82
46#ifdef CONFIG_FAIL_IO_TIMEOUT 83#ifdef CONFIG_FAIL_IO_TIMEOUT
47int blk_should_fake_timeout(struct request_queue *); 84int blk_should_fake_timeout(struct request_queue *);
48ssize_t part_timeout_show(struct device *, struct device_attribute *, char *); 85ssize_t part_timeout_show(struct device *, struct device_attribute *, char *);