aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/elevator.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-02-08 03:19:38 -0500
committerJens Axboe <axboe@kernel.dk>2012-02-08 03:19:38 -0500
commit050c8ea80e3e90019d9e981c6a117ef614e882ed (patch)
treee1c53f17a93ba48b9aedb0c1560dfb022733845f /include/linux/elevator.h
parent4e8670e26135d8fbfd5e084fddc1a8ed9f8eb4cb (diff)
block: separate out blk_rq_merge_ok() and blk_try_merge() from elevator functions
blk_rq_merge_ok() is the elevator-neutral part of merge eligibility test. blk_try_merge() determines merge direction and expects the caller to have tested elv_rq_merge_ok() previously. elv_rq_merge_ok() now wraps blk_rq_merge_ok() and then calls elv_iosched_allow_merge(). elv_try_merge() is removed and the two callers are updated to call elv_rq_merge_ok() explicitly followed by blk_try_merge(). While at it, make rq_merge_ok() functions return bool. This is to prepare for plug merge update and doesn't introduce any behavior change. This is based on Jens' patch to skip elevator_allow_merge_fn() from plug merge. Signed-off-by: Tejun Heo <tj@kernel.org> LKML-Reference: <4F16F3CA.90904@kernel.dk> Original-patch-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/elevator.h')
-rw-r--r--include/linux/elevator.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index c24f3d7fbf1e..d6dfb65c8885 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -122,7 +122,6 @@ extern void elv_dispatch_add_tail(struct request_queue *, struct request *);
122extern void elv_add_request(struct request_queue *, struct request *, int); 122extern void elv_add_request(struct request_queue *, struct request *, int);
123extern void __elv_add_request(struct request_queue *, struct request *, int); 123extern void __elv_add_request(struct request_queue *, struct request *, int);
124extern int elv_merge(struct request_queue *, struct request **, struct bio *); 124extern int elv_merge(struct request_queue *, struct request **, struct bio *);
125extern int elv_try_merge(struct request *, struct bio *);
126extern void elv_merge_requests(struct request_queue *, struct request *, 125extern void elv_merge_requests(struct request_queue *, struct request *,
127 struct request *); 126 struct request *);
128extern void elv_merged_request(struct request_queue *, struct request *, int); 127extern void elv_merged_request(struct request_queue *, struct request *, int);
@@ -155,7 +154,7 @@ extern ssize_t elv_iosched_store(struct request_queue *, const char *, size_t);
155extern int elevator_init(struct request_queue *, char *); 154extern int elevator_init(struct request_queue *, char *);
156extern void elevator_exit(struct elevator_queue *); 155extern void elevator_exit(struct elevator_queue *);
157extern int elevator_change(struct request_queue *, const char *); 156extern int elevator_change(struct request_queue *, const char *);
158extern int elv_rq_merge_ok(struct request *, struct bio *); 157extern bool elv_rq_merge_ok(struct request *, struct bio *);
159 158
160/* 159/*
161 * Helper functions. 160 * Helper functions.