aboutsummaryrefslogtreecommitdiffstats
path: root/block/elevator.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/elevator.c')
-rw-r--r--block/elevator.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/block/elevator.c b/block/elevator.c
index a847046c6e53..76e3702d5381 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -154,10 +154,7 @@ static struct elevator_type *elevator_get(const char *name)
154 154
155 spin_unlock(&elv_list_lock); 155 spin_unlock(&elv_list_lock);
156 156
157 if (!strcmp(name, "anticipatory")) 157 snprintf(elv, sizeof(elv), "%s-iosched", name);
158 sprintf(elv, "as-iosched");
159 else
160 sprintf(elv, "%s-iosched", name);
161 158
162 request_module("%s", elv); 159 request_module("%s", elv);
163 spin_lock(&elv_list_lock); 160 spin_lock(&elv_list_lock);
@@ -193,10 +190,7 @@ static int __init elevator_setup(char *str)
193 * Be backwards-compatible with previous kernels, so users 190 * Be backwards-compatible with previous kernels, so users
194 * won't get the wrong elevator. 191 * won't get the wrong elevator.
195 */ 192 */
196 if (!strcmp(str, "as")) 193 strncpy(chosen_elevator, str, sizeof(chosen_elevator) - 1);
197 strcpy(chosen_elevator, "anticipatory");
198 else
199 strncpy(chosen_elevator, str, sizeof(chosen_elevator) - 1);
200 return 1; 194 return 1;
201} 195}
202 196
@@ -480,6 +474,15 @@ int elv_merge(struct request_queue *q, struct request **req, struct bio *bio)
480 int ret; 474 int ret;
481 475
482 /* 476 /*
477 * Levels of merges:
478 * nomerges: No merges at all attempted
479 * noxmerges: Only simple one-hit cache try
480 * merges: All merge tries attempted
481 */
482 if (blk_queue_nomerges(q))
483 return ELEVATOR_NO_MERGE;
484
485 /*
483 * First try one-hit cache. 486 * First try one-hit cache.
484 */ 487 */
485 if (q->last_merge) { 488 if (q->last_merge) {
@@ -490,7 +493,7 @@ int elv_merge(struct request_queue *q, struct request **req, struct bio *bio)
490 } 493 }
491 } 494 }
492 495
493 if (blk_queue_nomerges(q)) 496 if (blk_queue_noxmerges(q))
494 return ELEVATOR_NO_MERGE; 497 return ELEVATOR_NO_MERGE;
495 498
496 /* 499 /*
@@ -889,7 +892,7 @@ elv_attr_store(struct kobject *kobj, struct attribute *attr,
889 return error; 892 return error;
890} 893}
891 894
892static struct sysfs_ops elv_sysfs_ops = { 895static const struct sysfs_ops elv_sysfs_ops = {
893 .show = elv_attr_show, 896 .show = elv_attr_show,
894 .store = elv_attr_store, 897 .store = elv_attr_store,
895}; 898};