[PATCH v3 5/8] engines: fallocate: add support for DDIR_SYNCFS

Damien Le Moal
2026-02-27T06:00:59Z

Flag the fallocate IO engine with FIO_SYNCFS to indicate that it
supports the syncfs operation. Also fix fio_fallocate_queue() to use
ddir_sync() to include all variants of the sync operation for driving
the call to do_io_u_sync(), instead of testing for DDIR_SYNC only, which
leads to ignoring other sync variants.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
---
engines/falloc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/engines/falloc.c b/engines/falloc.c
index 5bd5aa54cd20..7fc49e36a6f6 100644
--- a/engines/falloc.c
+++ b/engines/falloc.c
@@ -76,7 +76,7 @@ static enum fio_q_status fio_fallocate_queue(struct thread_data *td,

fio_ro_check(td, io_u);

- if (io_u->ddir != DDIR_SYNC) {
+ if (!ddir_sync(io_u->ddir)) {
if (io_u->ddir == DDIR_READ)
flags = FALLOC_FL_KEEP_SIZE;
else if (io_u->ddir == DDIR_WRITE)
@@ -102,7 +102,7 @@ static struct ioengine_ops ioengine = {
.open_file = open_file,
.close_file = generic_close_file,
.get_file_size = generic_get_file_size,
- .flags = FIO_SYNCIO
+ .flags = FIO_SYNCIO | FIO_SYNCFS,
};

static void fio_init fio_syncio_register(void)
--
2.53.0