Skip to content

Commit 6845de7

Browse files
johnpgarryMikulas Patocka
authored andcommitted
dm-mirror: Support atomic writes
Support atomic writes by setting DM_TARGET_ATOMIC_WRITES for the target type, and also unmasking REQ_ATOMIC from the submitted bio op flags. Signed-off-by: John Garry <[email protected]> Reviewed-by: Mike Snitzer <[email protected]> Signed-off-by: Mikulas Patocka <[email protected]>
1 parent c6a657d commit 6845de7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/md/dm-raid1.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ static void do_write(struct mirror_set *ms, struct bio *bio)
656656
unsigned int i;
657657
struct dm_io_region io[MAX_NR_MIRRORS], *dest = io;
658658
struct mirror *m;
659-
blk_opf_t op_flags = bio->bi_opf & (REQ_FUA | REQ_PREFLUSH);
659+
blk_opf_t op_flags = bio->bi_opf & (REQ_FUA | REQ_PREFLUSH | REQ_ATOMIC);
660660
struct dm_io_request io_req = {
661661
.bi_opf = REQ_OP_WRITE | op_flags,
662662
.mem.type = DM_IO_BIO,
@@ -1483,8 +1483,9 @@ static int mirror_iterate_devices(struct dm_target *ti,
14831483

14841484
static struct target_type mirror_target = {
14851485
.name = "mirror",
1486-
.version = {1, 14, 0},
1486+
.version = {1, 15, 0},
14871487
.module = THIS_MODULE,
1488+
.features = DM_TARGET_ATOMIC_WRITES,
14881489
.ctr = mirror_ctr,
14891490
.dtr = mirror_dtr,
14901491
.map = mirror_map,

0 commit comments

Comments
 (0)