All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Pass O_DIRECT/O_SYNC to glfs_open if requested.
@ 2014-07-03 14:48 Tiziano Müller
  2014-07-03 15:14 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Tiziano Müller @ 2014-07-03 14:48 UTC (permalink / raw)
  To: fio; +Cc: Tiziano Müller

GlusterFS supports O_DIRECT and O_SYNC.
---
 engines/glusterfs.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/engines/glusterfs.c b/engines/glusterfs.c
index b233b20..94daab5 100644
--- a/engines/glusterfs.c
+++ b/engines/glusterfs.c
@@ -150,8 +150,14 @@ int fio_gf_open_file(struct thread_data *td, struct fio_file *f)
 		else
 			flags = O_RDONLY;
 	}
+
+	if (td->o.odirect)
+		flags |= OS_O_DIRECT;
+	if (td->o.sync_io)
+		flags |= O_SYNC;
+
 	dprint(FD_FILE, "fio file %s open mode %s td rw %s\n", f->file_name,
-	       flags == O_RDONLY ? "ro" : "rw", td_read(td) ? "read" : "write");
+	       flags & O_RDONLY ? "ro" : "rw", td_read(td) ? "read" : "write");
 	g->fd = glfs_creat(g->fs, f->file_name, flags, 0644);
 	if (!g->fd) {
 		log_err("glfs_creat failed.\n");
-- 
2.0.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Pass O_DIRECT/O_SYNC to glfs_open if requested.
  2014-07-03 14:48 [PATCH] Pass O_DIRECT/O_SYNC to glfs_open if requested Tiziano Müller
@ 2014-07-03 15:14 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2014-07-03 15:14 UTC (permalink / raw)
  To: Tiziano Müller, fio

On 07/03/2014 08:48 AM, Tiziano M�ller wrote:
> GlusterFS supports O_DIRECT and O_SYNC.

Applied, thanks.

-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-03 15:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-03 14:48 [PATCH] Pass O_DIRECT/O_SYNC to glfs_open if requested Tiziano Müller
2014-07-03 15:14 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.