diff options
author | Alasdair G Kergon <agk@redhat.com> | 2010-08-11 23:14:11 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2010-08-11 23:14:11 -0400 |
commit | b441a262e7d1c56fbe21794c91d7a9c83809113f (patch) | |
tree | cc9acb2c3f7045ff513739fd81bba8a789d713b6 /drivers/md/dm-crypt.c | |
parent | 56a67df766039666f61fb15b079f713e44a735ae (diff) |
dm: use dm_target_offset macro
Use new dm_target_offset() macro to avoid most references to ti->begin
in dm targets.
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-crypt.c')
-rw-r--r-- | drivers/md/dm-crypt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 6401bfa0adff..368e8e98f705 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c | |||
@@ -1284,7 +1284,7 @@ static int crypt_map(struct dm_target *ti, struct bio *bio, | |||
1284 | return DM_MAPIO_REMAPPED; | 1284 | return DM_MAPIO_REMAPPED; |
1285 | } | 1285 | } |
1286 | 1286 | ||
1287 | io = crypt_io_alloc(ti, bio, bio->bi_sector - ti->begin); | 1287 | io = crypt_io_alloc(ti, bio, dm_target_offset(ti, bio->bi_sector)); |
1288 | 1288 | ||
1289 | if (bio_data_dir(io->base_bio) == READ) | 1289 | if (bio_data_dir(io->base_bio) == READ) |
1290 | kcryptd_queue_io(io); | 1290 | kcryptd_queue_io(io); |
@@ -1406,7 +1406,7 @@ static int crypt_merge(struct dm_target *ti, struct bvec_merge_data *bvm, | |||
1406 | return max_size; | 1406 | return max_size; |
1407 | 1407 | ||
1408 | bvm->bi_bdev = cc->dev->bdev; | 1408 | bvm->bi_bdev = cc->dev->bdev; |
1409 | bvm->bi_sector = cc->start + bvm->bi_sector - ti->begin; | 1409 | bvm->bi_sector = cc->start + dm_target_offset(ti, bvm->bi_sector); |
1410 | 1410 | ||
1411 | return min(max_size, q->merge_bvec_fn(q, bvm, biovec)); | 1411 | return min(max_size, q->merge_bvec_fn(q, bvm, biovec)); |
1412 | } | 1412 | } |