Skip to content

Commit

Permalink
dm flakey: use dm_target_offset and support discards
Browse files Browse the repository at this point in the history
Use dm_target_offset() and support discards.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
  • Loading branch information
Mike Snitzer authored and Alasdair G Kergon committed Aug 2, 2011
1 parent 498f010 commit 30e4171
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/md/dm-flakey.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ static int flakey_ctr(struct dm_target *ti, unsigned int argc, char **argv)
}

ti->num_flush_requests = 1;
ti->num_discard_requests = 1;
ti->private = fc;
return 0;

Expand All @@ -99,7 +100,7 @@ static sector_t flakey_map_sector(struct dm_target *ti, sector_t bi_sector)
{
struct flakey_c *fc = ti->private;

return fc->start + (bi_sector - ti->begin);
return fc->start + dm_target_offset(ti, bi_sector);
}

static void flakey_map_bio(struct dm_target *ti, struct bio *bio)
Expand Down

0 comments on commit 30e4171

Please sign in to comment.