diff options
Diffstat (limited to 'block/elevator.c')
-rw-r--r-- | block/elevator.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/block/elevator.c b/block/elevator.c index 88318c383608..ac5310ef8270 100644 --- a/block/elevator.c +++ b/block/elevator.c | |||
@@ -69,7 +69,7 @@ static int elv_iosched_allow_merge(struct request *rq, struct bio *bio) | |||
69 | /* | 69 | /* |
70 | * can we safely merge with this request? | 70 | * can we safely merge with this request? |
71 | */ | 71 | */ |
72 | inline int elv_rq_merge_ok(struct request *rq, struct bio *bio) | 72 | int elv_rq_merge_ok(struct request *rq, struct bio *bio) |
73 | { | 73 | { |
74 | if (!rq_mergeable(rq)) | 74 | if (!rq_mergeable(rq)) |
75 | return 0; | 75 | return 0; |
@@ -488,6 +488,9 @@ int elv_merge(struct request_queue *q, struct request **req, struct bio *bio) | |||
488 | } | 488 | } |
489 | } | 489 | } |
490 | 490 | ||
491 | if (blk_queue_nomerges(q)) | ||
492 | return ELEVATOR_NO_MERGE; | ||
493 | |||
491 | /* | 494 | /* |
492 | * See if our hash lookup can find a potential backmerge. | 495 | * See if our hash lookup can find a potential backmerge. |
493 | */ | 496 | */ |
@@ -1070,7 +1073,7 @@ static int elevator_switch(struct request_queue *q, struct elevator_type *new_e) | |||
1070 | */ | 1073 | */ |
1071 | spin_lock_irq(q->queue_lock); | 1074 | spin_lock_irq(q->queue_lock); |
1072 | 1075 | ||
1073 | set_bit(QUEUE_FLAG_ELVSWITCH, &q->queue_flags); | 1076 | queue_flag_set(QUEUE_FLAG_ELVSWITCH, q); |
1074 | 1077 | ||
1075 | elv_drain_elevator(q); | 1078 | elv_drain_elevator(q); |
1076 | 1079 | ||
@@ -1104,7 +1107,10 @@ static int elevator_switch(struct request_queue *q, struct elevator_type *new_e) | |||
1104 | * finally exit old elevator and turn off BYPASS. | 1107 | * finally exit old elevator and turn off BYPASS. |
1105 | */ | 1108 | */ |
1106 | elevator_exit(old_elevator); | 1109 | elevator_exit(old_elevator); |
1107 | clear_bit(QUEUE_FLAG_ELVSWITCH, &q->queue_flags); | 1110 | spin_lock_irq(q->queue_lock); |
1111 | queue_flag_clear(QUEUE_FLAG_ELVSWITCH, q); | ||
1112 | spin_unlock_irq(q->queue_lock); | ||
1113 | |||
1108 | return 1; | 1114 | return 1; |
1109 | 1115 | ||
1110 | fail_register: | 1116 | fail_register: |
@@ -1115,7 +1121,11 @@ fail_register: | |||
1115 | elevator_exit(e); | 1121 | elevator_exit(e); |
1116 | q->elevator = old_elevator; | 1122 | q->elevator = old_elevator; |
1117 | elv_register_queue(q); | 1123 | elv_register_queue(q); |
1118 | clear_bit(QUEUE_FLAG_ELVSWITCH, &q->queue_flags); | 1124 | |
1125 | spin_lock_irq(q->queue_lock); | ||
1126 | queue_flag_clear(QUEUE_FLAG_ELVSWITCH, q); | ||
1127 | spin_unlock_irq(q->queue_lock); | ||
1128 | |||
1119 | return 0; | 1129 | return 0; |
1120 | } | 1130 | } |
1121 | 1131 | ||