public inbox for fio@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: fio@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Vincent Fu <vincentfu@gmail.com>
Subject: [PATCH v4 7/8] engines: ftruncate: add support for DDIR_SYNCFS
Date: Fri, 27 Feb 2026 17:07:10 +0900	[thread overview]
Message-ID: <20260227080712.2422380-8-dlemoal@kernel.org> (raw)
In-Reply-To: <20260227080712.2422380-1-dlemoal@kernel.org>

Flag the ftruncate IO engine with FIO_SYNCFS to indicate that it
supports the syncfs operation. Also change fio_ftruncate_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 as
that leads to ignoring other sync variants.

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

diff --git a/engines/ftruncate.c b/engines/ftruncate.c
index 70211e0705f7..c1dcba7dc46f 100644
--- a/engines/ftruncate.c
+++ b/engines/ftruncate.c
@@ -21,7 +21,7 @@ static enum fio_q_status fio_ftruncate_queue(struct thread_data *td,
 
 	if (io_u->ddir == DDIR_WRITE)
 		ret = ftruncate(f->fd, io_u->offset);
-	else if (io_u->ddir == DDIR_SYNC)
+	else if (ddir_sync(io_u->ddir))
 		ret = do_io_u_sync(td, io_u);
 	else
 		io_u->error = EINVAL;
@@ -39,7 +39,7 @@ static struct ioengine_ops ioengine = {
 	.open_file	= generic_open_file,
 	.close_file	= generic_close_file,
 	.get_file_size	= generic_get_file_size,
-	.flags		= FIO_SYNCIO | FIO_FAKEIO
+	.flags		= FIO_SYNCIO | FIO_FAKEIO | FIO_SYNCFS,
 };
 
 static void fio_init fio_syncio_register(void)
-- 
2.53.0


  parent reply	other threads:[~2026-02-27  8:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-27  8:07 [PATCH v4 0/8] Introduce the end_syncfs option Damien Le Moal
2026-02-27  8:07 ` [PATCH v4 1/8] fio: introduce " Damien Le Moal
2026-02-27  8:07 ` [PATCH v4 2/8] engines: sync: add support for DDIR_SYNCFS Damien Le Moal
2026-02-27  8:07 ` [PATCH v4 3/8] engines: libaio: " Damien Le Moal
2026-02-27  8:07 ` [PATCH v4 4/8] engines: io_uring: " Damien Le Moal
2026-02-27  8:07 ` [PATCH v4 5/8] engines: fallocate: " Damien Le Moal
2026-02-27  8:07 ` [PATCH v4 6/8] engines: fileoperations: " Damien Le Moal
2026-02-27  8:07 ` Damien Le Moal [this message]
2026-02-27  8:07 ` [PATCH v4 8/8] engines: posixaio: " Damien Le Moal
2026-02-27  9:07 ` [PATCH v4 0/8] Introduce the end_syncfs option fiotestbot
2026-03-01 10:47 ` Sitsofe Wheeler
2026-03-02  2:18   ` Damien Le Moal
2026-03-02  6:25 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260227080712.2422380-8-dlemoal@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=fio@vger.kernel.org \
    --cc=vincentfu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox