aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-delay.c
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2010-08-11 23:14:11 -0400
committerAlasdair G Kergon <agk@redhat.com>2010-08-11 23:14:11 -0400
commitb441a262e7d1c56fbe21794c91d7a9c83809113f (patch)
treecc9acb2c3f7045ff513739fd81bba8a789d713b6 /drivers/md/dm-delay.c
parent56a67df766039666f61fb15b079f713e44a735ae (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-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,
281 bio->bi_bdev = dc->dev_write->bdev; 281 bio->bi_bdev = dc->dev_write->bdev;
282 if (bio_sectors(bio)) 282 if (bio_sectors(bio))
283 bio->bi_sector = dc->start_write + 283 bio->bi_sector = dc->start_write +
284 (bio->bi_sector - ti->begin); 284 dm_target_offset(ti, bio->bi_sector);
285 285
286 return delay_bio(dc, dc->write_delay, bio); 286 return delay_bio(dc, dc->write_delay, bio);
287 } 287 }
288 288
289 bio->bi_bdev = dc->dev_read->bdev; 289 bio->bi_bdev = dc->dev_read->bdev;
290 bio->bi_sector = dc->start_read + 290 bio->bi_sector = dc->start_read + dm_target_offset(ti, bio->bi_sector);
291 (bio->bi_sector - ti->begin);
292 291
293 return delay_bio(dc, dc->read_delay, bio); 292 return delay_bio(dc, dc->read_delay, bio);
294} 293}