Commit 4e979b18 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] portability problem in dm-stripe.c

dm-stripe does do_div() on potentially 32bit data.  do_div()
implementation has every right to be Not Happy(tm) with that...

The fix is obvious - that's what sector_div() is for...
Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 9bf9a3f4
...@@ -174,7 +174,7 @@ static int stripe_map(struct dm_target *ti, struct bio *bio, ...@@ -174,7 +174,7 @@ static int stripe_map(struct dm_target *ti, struct bio *bio,
sector_t offset = bio->bi_sector - ti->begin; sector_t offset = bio->bi_sector - ti->begin;
sector_t chunk = offset >> sc->chunk_shift; sector_t chunk = offset >> sc->chunk_shift;
uint32_t stripe = do_div(chunk, sc->stripes); uint32_t stripe = sector_div(chunk, sc->stripes);
bio->bi_bdev = sc->stripe[stripe].dev->bdev; bio->bi_bdev = sc->stripe[stripe].dev->bdev;
bio->bi_sector = sc->stripe[stripe].physical_start + bio->bi_sector = sc->stripe[stripe].physical_start +
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment