diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-22 22:11:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-22 22:11:06 -0400 |
commit | 69450bb5eb8e9df28281c62f98e971c9969dc4ff (patch) | |
tree | 85991e6e8b74cb08b5013fd7e419c3df67d23e35 /drivers/md/dm-crypt.c | |
parent | e38f981758118d829cd40cfe9c09e3fa81e422aa (diff) | |
parent | d6ec084200c37683278c821338f74ddf21ab80f5 (diff) |
Merge branch 'sg' of git://git.kernel.dk/linux-2.6-block
* 'sg' of git://git.kernel.dk/linux-2.6-block:
Add CONFIG_DEBUG_SG sg validation
Change table chaining layout
Update arch/ to use sg helpers
Update swiotlb to use sg helpers
Update net/ to use sg helpers
Update fs/ to use sg helpers
[SG] Update drivers to use sg helpers
[SG] Update crypto/ to sg helpers
[SG] Update block layer to use sg helpers
[SG] Add helpers for manipulating SG entries
Diffstat (limited to 'drivers/md/dm-crypt.c')
-rw-r--r-- | drivers/md/dm-crypt.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 0eb5416798bd..ac54f697c508 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c | |||
@@ -348,16 +348,17 @@ static int crypt_convert(struct crypt_config *cc, | |||
348 | ctx->idx_out < ctx->bio_out->bi_vcnt) { | 348 | ctx->idx_out < ctx->bio_out->bi_vcnt) { |
349 | struct bio_vec *bv_in = bio_iovec_idx(ctx->bio_in, ctx->idx_in); | 349 | struct bio_vec *bv_in = bio_iovec_idx(ctx->bio_in, ctx->idx_in); |
350 | struct bio_vec *bv_out = bio_iovec_idx(ctx->bio_out, ctx->idx_out); | 350 | struct bio_vec *bv_out = bio_iovec_idx(ctx->bio_out, ctx->idx_out); |
351 | struct scatterlist sg_in = { | 351 | struct scatterlist sg_in, sg_out; |
352 | .page = bv_in->bv_page, | 352 | |
353 | .offset = bv_in->bv_offset + ctx->offset_in, | 353 | sg_init_table(&sg_in, 1); |
354 | .length = 1 << SECTOR_SHIFT | 354 | sg_set_page(&sg_in, bv_in->bv_page); |
355 | }; | 355 | sg_in.offset = bv_in->bv_offset + ctx->offset_in; |
356 | struct scatterlist sg_out = { | 356 | sg_in.length = 1 << SECTOR_SHIFT; |
357 | .page = bv_out->bv_page, | 357 | |
358 | .offset = bv_out->bv_offset + ctx->offset_out, | 358 | sg_init_table(&sg_out, 1); |
359 | .length = 1 << SECTOR_SHIFT | 359 | sg_set_page(&sg_out, bv_out->bv_page); |
360 | }; | 360 | sg_out.offset = bv_out->bv_offset + ctx->offset_out; |
361 | sg_out.length = 1 << SECTOR_SHIFT; | ||
361 | 362 | ||
362 | ctx->offset_in += sg_in.length; | 363 | ctx->offset_in += sg_in.length; |
363 | if (ctx->offset_in >= bv_in->bv_len) { | 364 | if (ctx->offset_in >= bv_in->bv_len) { |