diff options
Diffstat (limited to 'block/ll_rw_blk.c')
-rw-r--r-- | block/ll_rw_blk.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index e0608c4ecc23..c6b2a477d33e 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
@@ -1364,28 +1364,28 @@ int blk_rq_map_sg(struct request_queue *q, struct request *rq, | |||
1364 | */ | 1364 | */ |
1365 | bvprv = NULL; | 1365 | bvprv = NULL; |
1366 | rq_for_each_segment(bvec, rq, iter) { | 1366 | rq_for_each_segment(bvec, rq, iter) { |
1367 | int nbytes = bvec->bv_len; | 1367 | int nbytes = bvec->bv_len; |
1368 | 1368 | ||
1369 | if (bvprv && cluster) { | 1369 | if (bvprv && cluster) { |
1370 | if (sg[nsegs - 1].length + nbytes > q->max_segment_size) | 1370 | if (sg[nsegs - 1].length + nbytes > q->max_segment_size) |
1371 | goto new_segment; | 1371 | goto new_segment; |
1372 | 1372 | ||
1373 | if (!BIOVEC_PHYS_MERGEABLE(bvprv, bvec)) | 1373 | if (!BIOVEC_PHYS_MERGEABLE(bvprv, bvec)) |
1374 | goto new_segment; | 1374 | goto new_segment; |
1375 | if (!BIOVEC_SEG_BOUNDARY(q, bvprv, bvec)) | 1375 | if (!BIOVEC_SEG_BOUNDARY(q, bvprv, bvec)) |
1376 | goto new_segment; | 1376 | goto new_segment; |
1377 | 1377 | ||
1378 | sg[nsegs - 1].length += nbytes; | 1378 | sg[nsegs - 1].length += nbytes; |
1379 | } else { | 1379 | } else { |
1380 | new_segment: | 1380 | new_segment: |
1381 | memset(&sg[nsegs],0,sizeof(struct scatterlist)); | 1381 | memset(&sg[nsegs],0,sizeof(struct scatterlist)); |
1382 | sg[nsegs].page = bvec->bv_page; | 1382 | sg[nsegs].page = bvec->bv_page; |
1383 | sg[nsegs].length = nbytes; | 1383 | sg[nsegs].length = nbytes; |
1384 | sg[nsegs].offset = bvec->bv_offset; | 1384 | sg[nsegs].offset = bvec->bv_offset; |
1385 | 1385 | ||
1386 | nsegs++; | 1386 | nsegs++; |
1387 | } | 1387 | } |
1388 | bvprv = bvec; | 1388 | bvprv = bvec; |
1389 | } /* segments in rq */ | 1389 | } /* segments in rq */ |
1390 | 1390 | ||
1391 | return nsegs; | 1391 | return nsegs; |