diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:18:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:18:03 -0400 |
commit | bd5d435a96837c3495e62eef37cbe4cb728b79ae (patch) | |
tree | 82aacaf5a1d220910c4b0a1088d7d2482c0d9ee0 /block/elevator.c | |
parent | fee4b19fb3f28d17c0b9f9ea0668db5275697178 (diff) | |
parent | ac9fafa1243640349aa481adf473db283a695766 (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
block: Skip I/O merges when disabled
block: add large command support
block: replace sizeof(rq->cmd) with BLK_MAX_CDB
ide: use blk_rq_init() to initialize the request
block: use blk_rq_init() to initialize the request
block: rename and export rq_init()
block: no need to initialize rq->cmd with blk_get_request
block: no need to initialize rq->cmd in prepare_flush_fn hook
block/blk-barrier.c:blk_ordered_cur_seq() mustn't be inline
block/elevator.c:elv_rq_merge_ok() mustn't be inline
block: make queue flags non-atomic
block: add dma alignment and padding support to blk_rq_map_kern
unexport blk_max_pfn
ps3disk: Remove superfluous cast
block: make rq_init() do a full memset()
relay: fix splice problem
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 | ||