[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250116170301.474130-9-john.g.garry@oracle.com>
Date: Thu, 16 Jan 2025 17:03:01 +0000
From: John Garry <john.g.garry@...cle.com>
To: axboe@...nel.dk, agk@...hat.com, mpatocka@...hat.com, hch@....de
Cc: song@...nel.org, yukuai3@...wei.com, kbusch@...nel.org, sagi@...mberg.me,
James.Bottomley@...senPartnership.com, martin.petersen@...cle.com,
linux-block@...r.kernel.org, dm-devel@...ts.linux.dev,
linux-kernel@...r.kernel.org, linux-raid@...r.kernel.org,
linux-nvme@...ts.infradead.org, linux-scsi@...r.kernel.org,
John Garry <john.g.garry@...cle.com>
Subject: [PATCH RFC v2 8/8] 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 <john.g.garry@...cle.com>
---
drivers/md/dm-raid1.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index 9511dae5b556..7a42bf648c52 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -656,7 +656,7 @@ static void do_write(struct mirror_set *ms, struct bio *bio)
unsigned int i;
struct dm_io_region io[MAX_NR_MIRRORS], *dest = io;
struct mirror *m;
- blk_opf_t op_flags = bio->bi_opf & (REQ_FUA | REQ_PREFLUSH);
+ blk_opf_t op_flags = bio->bi_opf & (REQ_FUA | REQ_PREFLUSH | REQ_ATOMIC);
struct dm_io_request io_req = {
.bi_opf = REQ_OP_WRITE | op_flags,
.mem.type = DM_IO_BIO,
@@ -1485,6 +1485,7 @@ static struct target_type mirror_target = {
.name = "mirror",
.version = {1, 14, 0},
.module = THIS_MODULE,
+ .features = DM_TARGET_ATOMIC_WRITES,
.ctr = mirror_ctr,
.dtr = mirror_dtr,
.map = mirror_map,
--
2.31.1
Powered by blists - more mailing lists