aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-merge.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/blk-merge.c')
-rw-r--r--block/blk-merge.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/block/blk-merge.c b/block/blk-merge.c
index 5e7dc9973458..3b0cd4249671 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -12,7 +12,6 @@
12static unsigned int __blk_recalc_rq_segments(struct request_queue *q, 12static unsigned int __blk_recalc_rq_segments(struct request_queue *q,
13 struct bio *bio) 13 struct bio *bio)
14{ 14{
15 unsigned int phys_size;
16 struct bio_vec *bv, *bvprv = NULL; 15 struct bio_vec *bv, *bvprv = NULL;
17 int cluster, i, high, highprv = 1; 16 int cluster, i, high, highprv = 1;
18 unsigned int seg_size, nr_phys_segs; 17 unsigned int seg_size, nr_phys_segs;
@@ -24,7 +23,7 @@ static unsigned int __blk_recalc_rq_segments(struct request_queue *q,
24 fbio = bio; 23 fbio = bio;
25 cluster = test_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags); 24 cluster = test_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags);
26 seg_size = 0; 25 seg_size = 0;
27 phys_size = nr_phys_segs = 0; 26 nr_phys_segs = 0;
28 for_each_bio(bio) { 27 for_each_bio(bio) {
29 bio_for_each_segment(bv, bio, i) { 28 bio_for_each_segment(bv, bio, i) {
30 /* 29 /*
@@ -180,7 +179,7 @@ new_segment:
180 } 179 }
181 180
182 if (q->dma_drain_size && q->dma_drain_needed(rq)) { 181 if (q->dma_drain_size && q->dma_drain_needed(rq)) {
183 if (rq->cmd_flags & REQ_RW) 182 if (rq->cmd_flags & REQ_WRITE)
184 memset(q->dma_drain_buffer, 0, q->dma_drain_size); 183 memset(q->dma_drain_buffer, 0, q->dma_drain_size);
185 184
186 sg->page_link &= ~0x02; 185 sg->page_link &= ~0x02;
@@ -226,7 +225,7 @@ int ll_back_merge_fn(struct request_queue *q, struct request *req,
226{ 225{
227 unsigned short max_sectors; 226 unsigned short max_sectors;
228 227
229 if (unlikely(blk_pc_request(req))) 228 if (unlikely(req->cmd_type == REQ_TYPE_BLOCK_PC))
230 max_sectors = queue_max_hw_sectors(q); 229 max_sectors = queue_max_hw_sectors(q);
231 else 230 else
232 max_sectors = queue_max_sectors(q); 231 max_sectors = queue_max_sectors(q);
@@ -250,7 +249,7 @@ int ll_front_merge_fn(struct request_queue *q, struct request *req,
250{ 249{
251 unsigned short max_sectors; 250 unsigned short max_sectors;
252 251
253 if (unlikely(blk_pc_request(req))) 252 if (unlikely(req->cmd_type == REQ_TYPE_BLOCK_PC))
254 max_sectors = queue_max_hw_sectors(q); 253 max_sectors = queue_max_hw_sectors(q);
255 else 254 else
256 max_sectors = queue_max_sectors(q); 255 max_sectors = queue_max_sectors(q);