From: Alan Adamson Date: Mon, 16 Sep 2024 16:53:41 +0000 (+0000) Subject: pvsync2: Support RWF_ATOMIC X-Git-Tag: fio-3.38~16^2~6 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=80226c53d994e8a9206ed7acf4a4dc75a8691792;p=fio.git pvsync2: Support RWF_ATOMIC Set RWF_ATOMIC for writes and atomic==1. Signed-off-by: Alan Adamson jpg: Set FIO_ATOMICWRITES for pvsync2 Signed-off-by: John Garry Link: https://lore.kernel.org/r/20240916165347.2226763-4-john.g.garry@oracle.com Signed-off-by: Jens Axboe --- diff --git a/engines/sync.c b/engines/sync.c index b8be4eb3..729d8a71 100644 --- a/engines/sync.c +++ b/engines/sync.c @@ -175,9 +175,11 @@ static enum fio_q_status fio_pvsyncio2_queue(struct thread_data *td, if (io_u->ddir == DDIR_READ) ret = preadv2(f->fd, iov, 1, io_u->offset, flags); - else if (io_u->ddir == DDIR_WRITE) + else if (io_u->ddir == DDIR_WRITE) { + if (td->o.oatomic) + flags |= RWF_ATOMIC; ret = pwritev2(f->fd, iov, 1, io_u->offset, flags); - else if (io_u->ddir == DDIR_TRIM) { + } else if (io_u->ddir == DDIR_TRIM) { do_io_u_trim(td, io_u); return FIO_Q_COMPLETED; } else @@ -476,7 +478,8 @@ static struct ioengine_ops ioengine_pvrw2 = { .open_file = generic_open_file, .close_file = generic_close_file, .get_file_size = generic_get_file_size, - .flags = FIO_SYNCIO, + .flags = FIO_SYNCIO | + FIO_ATOMICWRITES, .options = options, .option_struct_size = sizeof(struct psyncv2_options), };