|
@@ -53,13 +53,13 @@ static LIST_HEAD(elv_list);
|
|
* Query io scheduler to see if the current process issuing bio may be
|
|
* Query io scheduler to see if the current process issuing bio may be
|
|
* merged with rq.
|
|
* merged with rq.
|
|
*/
|
|
*/
|
|
-static int elv_iosched_allow_merge(struct request *rq, struct bio *bio)
|
|
|
|
|
|
+static int elv_iosched_allow_bio_merge(struct request *rq, struct bio *bio)
|
|
{
|
|
{
|
|
struct request_queue *q = rq->q;
|
|
struct request_queue *q = rq->q;
|
|
struct elevator_queue *e = q->elevator;
|
|
struct elevator_queue *e = q->elevator;
|
|
|
|
|
|
- if (e->type->ops.elevator_allow_merge_fn)
|
|
|
|
- return e->type->ops.elevator_allow_merge_fn(q, rq, bio);
|
|
|
|
|
|
+ if (e->type->ops.elevator_allow_bio_merge_fn)
|
|
|
|
+ return e->type->ops.elevator_allow_bio_merge_fn(q, rq, bio);
|
|
|
|
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|
|
@@ -67,17 +67,17 @@ static int elv_iosched_allow_merge(struct request *rq, struct bio *bio)
|
|
/*
|
|
/*
|
|
* can we safely merge with this request?
|
|
* can we safely merge with this request?
|
|
*/
|
|
*/
|
|
-bool elv_rq_merge_ok(struct request *rq, struct bio *bio)
|
|
|
|
|
|
+bool elv_bio_merge_ok(struct request *rq, struct bio *bio)
|
|
{
|
|
{
|
|
if (!blk_rq_merge_ok(rq, bio))
|
|
if (!blk_rq_merge_ok(rq, bio))
|
|
- return 0;
|
|
|
|
|
|
+ return false;
|
|
|
|
|
|
- if (!elv_iosched_allow_merge(rq, bio))
|
|
|
|
- return 0;
|
|
|
|
|
|
+ if (!elv_iosched_allow_bio_merge(rq, bio))
|
|
|
|
+ return false;
|
|
|
|
|
|
- return 1;
|
|
|
|
|
|
+ return true;
|
|
}
|
|
}
|
|
-EXPORT_SYMBOL(elv_rq_merge_ok);
|
|
|
|
|
|
+EXPORT_SYMBOL(elv_bio_merge_ok);
|
|
|
|
|
|
static struct elevator_type *elevator_find(const char *name)
|
|
static struct elevator_type *elevator_find(const char *name)
|
|
{
|
|
{
|
|
@@ -425,7 +425,7 @@ int elv_merge(struct request_queue *q, struct request **req, struct bio *bio)
|
|
/*
|
|
/*
|
|
* First try one-hit cache.
|
|
* First try one-hit cache.
|
|
*/
|
|
*/
|
|
- if (q->last_merge && elv_rq_merge_ok(q->last_merge, bio)) {
|
|
|
|
|
|
+ if (q->last_merge && elv_bio_merge_ok(q->last_merge, bio)) {
|
|
ret = blk_try_merge(q->last_merge, bio);
|
|
ret = blk_try_merge(q->last_merge, bio);
|
|
if (ret != ELEVATOR_NO_MERGE) {
|
|
if (ret != ELEVATOR_NO_MERGE) {
|
|
*req = q->last_merge;
|
|
*req = q->last_merge;
|
|
@@ -440,7 +440,7 @@ int elv_merge(struct request_queue *q, struct request **req, struct bio *bio)
|
|
* See if our hash lookup can find a potential backmerge.
|
|
* See if our hash lookup can find a potential backmerge.
|
|
*/
|
|
*/
|
|
__rq = elv_rqhash_find(q, bio->bi_iter.bi_sector);
|
|
__rq = elv_rqhash_find(q, bio->bi_iter.bi_sector);
|
|
- if (__rq && elv_rq_merge_ok(__rq, bio)) {
|
|
|
|
|
|
+ if (__rq && elv_bio_merge_ok(__rq, bio)) {
|
|
*req = __rq;
|
|
*req = __rq;
|
|
return ELEVATOR_BACK_MERGE;
|
|
return ELEVATOR_BACK_MERGE;
|
|
}
|
|
}
|