[PATCH] Pass O_DIRECT/O_SYNC to glfs_open if requested.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux