diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 14:56:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 14:56:06 -0400 |
commit | c56ec7639288f3e5d6371b0c48d37da93642fc93 (patch) | |
tree | d0b21507cd863a91528a556d8e1ea8f8679a8e90 | |
parent | fb9fc395174138983a49f2da982ed14caabbe741 (diff) | |
parent | ba951841ceb7fa5b06ad48caa5270cc2ae17941e (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block:
[BLOCK] blk_rq_map_sg() next_sg fixup
Revert "[SCSI] Remove full sg table memset()"
-rw-r--r-- | block/ll_rw_blk.c | 10 | ||||
-rw-r--r-- | drivers/scsi/scsi_lib.c | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 9e3f3cc85d0d..3935469e3662 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
@@ -1322,8 +1322,8 @@ int blk_rq_map_sg(struct request_queue *q, struct request *rq, | |||
1322 | struct scatterlist *sglist) | 1322 | struct scatterlist *sglist) |
1323 | { | 1323 | { |
1324 | struct bio_vec *bvec, *bvprv; | 1324 | struct bio_vec *bvec, *bvprv; |
1325 | struct scatterlist *next_sg, *sg; | ||
1326 | struct req_iterator iter; | 1325 | struct req_iterator iter; |
1326 | struct scatterlist *sg; | ||
1327 | int nsegs, cluster; | 1327 | int nsegs, cluster; |
1328 | 1328 | ||
1329 | nsegs = 0; | 1329 | nsegs = 0; |
@@ -1333,7 +1333,7 @@ int blk_rq_map_sg(struct request_queue *q, struct request *rq, | |||
1333 | * for each bio in rq | 1333 | * for each bio in rq |
1334 | */ | 1334 | */ |
1335 | bvprv = NULL; | 1335 | bvprv = NULL; |
1336 | sg = next_sg = &sglist[0]; | 1336 | sg = NULL; |
1337 | rq_for_each_segment(bvec, rq, iter) { | 1337 | rq_for_each_segment(bvec, rq, iter) { |
1338 | int nbytes = bvec->bv_len; | 1338 | int nbytes = bvec->bv_len; |
1339 | 1339 | ||
@@ -1349,8 +1349,10 @@ int blk_rq_map_sg(struct request_queue *q, struct request *rq, | |||
1349 | sg->length += nbytes; | 1349 | sg->length += nbytes; |
1350 | } else { | 1350 | } else { |
1351 | new_segment: | 1351 | new_segment: |
1352 | sg = next_sg; | 1352 | if (!sg) |
1353 | next_sg = sg_next(sg); | 1353 | sg = sglist; |
1354 | else | ||
1355 | sg = sg_next(sg); | ||
1354 | 1356 | ||
1355 | memset(sg, 0, sizeof(*sg)); | 1357 | memset(sg, 0, sizeof(*sg)); |
1356 | sg->page = bvec->bv_page; | 1358 | sg->page = bvec->bv_page; |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 0c86be71bb33..aac8a02cbe80 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -764,6 +764,8 @@ struct scatterlist *scsi_alloc_sgtable(struct scsi_cmnd *cmd, gfp_t gfp_mask) | |||
764 | if (unlikely(!sgl)) | 764 | if (unlikely(!sgl)) |
765 | goto enomem; | 765 | goto enomem; |
766 | 766 | ||
767 | memset(sgl, 0, sizeof(*sgl) * sgp->size); | ||
768 | |||
767 | /* | 769 | /* |
768 | * first loop through, set initial index and return value | 770 | * first loop through, set initial index and return value |
769 | */ | 771 | */ |