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>
This commit is contained in:
Alasdair G Kergon
2010-08-12 04:14:11 +01:00
parent 56a67df766
commit b441a262e7
5 changed files with 7 additions and 8 deletions

View File

@@ -222,7 +222,7 @@ static int stripe_map(struct dm_target *ti, struct bio *bio,
return DM_MAPIO_REMAPPED;
}
offset = bio->bi_sector - ti->begin;
offset = dm_target_offset(ti, bio->bi_sector);
chunk = offset >> sc->chunk_shift;
stripe = sector_div(chunk, sc->stripes);