提交 30e4171b 编写于 作者: M Mike Snitzer 提交者: Alasdair G Kergon

dm flakey: use dm_target_offset and support discards

Use dm_target_offset() and support discards.
Signed-off-by: NMike Snitzer <snitzer@redhat.com>
Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
上级 498f0103
...@@ -79,6 +79,7 @@ static int flakey_ctr(struct dm_target *ti, unsigned int argc, char **argv) ...@@ -79,6 +79,7 @@ static int flakey_ctr(struct dm_target *ti, unsigned int argc, char **argv)
} }
ti->num_flush_requests = 1; ti->num_flush_requests = 1;
ti->num_discard_requests = 1;
ti->private = fc; ti->private = fc;
return 0; return 0;
...@@ -99,7 +100,7 @@ static sector_t flakey_map_sector(struct dm_target *ti, sector_t bi_sector) ...@@ -99,7 +100,7 @@ static sector_t flakey_map_sector(struct dm_target *ti, sector_t bi_sector)
{ {
struct flakey_c *fc = ti->private; 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) static void flakey_map_bio(struct dm_target *ti, struct bio *bio)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册