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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/block/blk-merge.c b/block/blk-merge.c
index 23d2a6fe34a3..bf62a87a9da2 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -259,7 +259,7 @@ int ll_back_merge_fn(struct request_queue *q, struct request *req,
259 else 259 else
260 max_sectors = q->max_sectors; 260 max_sectors = q->max_sectors;
261 261
262 if (req->nr_sectors + bio_sectors(bio) > max_sectors) { 262 if (blk_rq_sectors(req) + bio_sectors(bio) > max_sectors) {
263 req->cmd_flags |= REQ_NOMERGE; 263 req->cmd_flags |= REQ_NOMERGE;
264 if (req == q->last_merge) 264 if (req == q->last_merge)
265 q->last_merge = NULL; 265 q->last_merge = NULL;
@@ -284,7 +284,7 @@ int ll_front_merge_fn(struct request_queue *q, struct request *req,
284 max_sectors = q->max_sectors; 284 max_sectors = q->max_sectors;
285 285
286 286
287 if (req->nr_sectors + bio_sectors(bio) > max_sectors) { 287 if (blk_rq_sectors(req) + bio_sectors(bio) > max_sectors) {
288 req->cmd_flags |= REQ_NOMERGE; 288 req->cmd_flags |= REQ_NOMERGE;
289 if (req == q->last_merge) 289 if (req == q->last_merge)
290 q->last_merge = NULL; 290 q->last_merge = NULL;
@@ -315,7 +315,7 @@ static int ll_merge_requests_fn(struct request_queue *q, struct request *req,
315 /* 315 /*
316 * Will it become too large? 316 * Will it become too large?
317 */ 317 */
318 if ((req->nr_sectors + next->nr_sectors) > q->max_sectors) 318 if ((blk_rq_sectors(req) + blk_rq_sectors(next)) > q->max_sectors)
319 return 0; 319 return 0;
320 320
321 total_phys_segments = req->nr_phys_segments + next->nr_phys_segments; 321 total_phys_segments = req->nr_phys_segments + next->nr_phys_segments;
@@ -345,7 +345,7 @@ static void blk_account_io_merge(struct request *req)
345 int cpu; 345 int cpu;
346 346
347 cpu = part_stat_lock(); 347 cpu = part_stat_lock();
348 part = disk_map_sector_rcu(req->rq_disk, req->sector); 348 part = disk_map_sector_rcu(req->rq_disk, blk_rq_pos(req));
349 349
350 part_round_stats(cpu, part); 350 part_round_stats(cpu, part);
351 part_dec_in_flight(part); 351 part_dec_in_flight(part);
@@ -366,7 +366,7 @@ static int attempt_merge(struct request_queue *q, struct request *req,
366 /* 366 /*
367 * not contiguous 367 * not contiguous
368 */ 368 */
369 if (req->sector + req->nr_sectors != next->sector) 369 if (blk_rq_pos(req) + blk_rq_sectors(req) != blk_rq_pos(next))
370 return 0; 370 return 0;
371 371
372 if (rq_data_dir(req) != rq_data_dir(next) 372 if (rq_data_dir(req) != rq_data_dir(next)