summaryrefslogtreecommitdiff
path: root/drivers/md/dm-delay.c
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2010-08-12 07:14:11 +0400
committerAlasdair G Kergon <agk@redhat.com>2010-08-12 07:14:11 +0400
commitb441a262e7d1c56fbe21794c91d7a9c83809113f (patch)
treecc9acb2c3f7045ff513739fd81bba8a789d713b6 /drivers/md/dm-delay.c
parent56a67df766039666f61fb15b079f713e44a735ae (diff)
downloadlinux-b441a262e7d1c56fbe21794c91d7a9c83809113f.tar.xz
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-delay.c')
-rw-r--r--drivers/md/dm-delay.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/md/dm-delay.c b/drivers/md/dm-delay.c
index 852052880d7a..a91049e05219 100644
--- a/drivers/md/dm-delay.c
+++ b/drivers/md/dm-delay.c
@@ -281,14 +281,13 @@ static int delay_map(struct dm_target *ti, struct bio *bio,
bio->bi_bdev = dc->dev_write->bdev;
if (bio_sectors(bio))
bio->bi_sector = dc->start_write +
- (bio->bi_sector - ti->begin);
+ dm_target_offset(ti, bio->bi_sector);
return delay_bio(dc, dc->write_delay, bio);
}
bio->bi_bdev = dc->dev_read->bdev;
- bio->bi_sector = dc->start_read +
- (bio->bi_sector - ti->begin);
+ bio->bi_sector = dc->start_read + dm_target_offset(ti, bio->bi_sector);
return delay_bio(dc, dc->read_delay, bio);
}