Commit 647c7db1 authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Alasdair G Kergon

dm crypt: support flush

Flush support for dm-crypt target.
Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent 374bf7e7
...@@ -1132,6 +1132,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) ...@@ -1132,6 +1132,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
goto bad_crypt_queue; goto bad_crypt_queue;
} }
ti->num_flush_requests = 1;
ti->private = cc; ti->private = cc;
return 0; return 0;
...@@ -1189,6 +1190,13 @@ static int crypt_map(struct dm_target *ti, struct bio *bio, ...@@ -1189,6 +1190,13 @@ static int crypt_map(struct dm_target *ti, struct bio *bio,
union map_info *map_context) union map_info *map_context)
{ {
struct dm_crypt_io *io; struct dm_crypt_io *io;
struct crypt_config *cc;
if (unlikely(bio_empty_barrier(bio))) {
cc = ti->private;
bio->bi_bdev = cc->dev->bdev;
return DM_MAPIO_REMAPPED;
}
io = crypt_io_alloc(ti, bio, bio->bi_sector - ti->begin); io = crypt_io_alloc(ti, bio, bio->bi_sector - ti->begin);
......
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