aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-crypt.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-10-24 05:20:47 -0400
committerJens Axboe <jens.axboe@oracle.com>2007-10-24 05:20:47 -0400
commit642f149031d70415d9318b919d50b71e4724adbd (patch)
treee792ad29dedffc6756d55e9d63e18ada35515b4b /drivers/md/dm-crypt.c
parentbd6dee6f30a0f6943df190b387b5f8fe98a848f3 (diff)
SG: Change sg_set_page() to take length and offset argument
Most drivers need to set length and offset as well, so may as well fold those three lines into one. Add sg_assign_page() for those two locations that only needed to set the page, where the offset/length is set outside of the function context. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/md/dm-crypt.c')
-rw-r--r--drivers/md/dm-crypt.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index ac54f697c508..1c159ac68c98 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -351,14 +351,10 @@ static int crypt_convert(struct crypt_config *cc,
351 struct scatterlist sg_in, sg_out; 351 struct scatterlist sg_in, sg_out;
352 352
353 sg_init_table(&sg_in, 1); 353 sg_init_table(&sg_in, 1);
354 sg_set_page(&sg_in, bv_in->bv_page); 354 sg_set_page(&sg_in, bv_in->bv_page, 1 << SECTOR_SHIFT, bv_in->bv_offset + ctx->offset_in);
355 sg_in.offset = bv_in->bv_offset + ctx->offset_in;
356 sg_in.length = 1 << SECTOR_SHIFT;
357 355
358 sg_init_table(&sg_out, 1); 356 sg_init_table(&sg_out, 1);
359 sg_set_page(&sg_out, bv_out->bv_page); 357 sg_set_page(&sg_out, bv_out->bv_page, 1 << SECTOR_SHIFT, bv_out->bv_offset + ctx->offset_out);
360 sg_out.offset = bv_out->bv_offset + ctx->offset_out;
361 sg_out.length = 1 << SECTOR_SHIFT;
362 358
363 ctx->offset_in += sg_in.length; 359 ctx->offset_in += sg_in.length;
364 if (ctx->offset_in >= bv_in->bv_len) { 360 if (ctx->offset_in >= bv_in->bv_len) {