summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-12-10 08:12:56 -0700
committerJens Axboe <axboe@fb.com>2014-12-10 08:12:56 -0700
commit656955ebe92b443148f8d8925737651330814825 (patch)
tree46af71708d7cc89ca2d7dda963e629e51cc6cb1b
parent3b577774803435109e070cc8f4313fc485c9160f (diff)
downloadfio-656955ebe92b443148f8d8925737651330814825.tar.gz
fio-656955ebe92b443148f8d8925737651330814825.tar.bz2
gluster: wire up sync/datasync opcodes
Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--engines/glusterfs_async.c2
-rw-r--r--engines/glusterfs_sync.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/engines/glusterfs_async.c b/engines/glusterfs_async.c
index 95ca84ef..8283f8be 100644
--- a/engines/glusterfs_async.c
+++ b/engines/glusterfs_async.c
@@ -117,6 +117,8 @@ static int fio_gf_async_queue(struct thread_data fio_unused * td,
r = glfs_discard_async(g->fd, io_u->offset, io_u->xfer_buflen,
gf_async_cb, io_u);
#endif
+ else if (io_u->ddir == DDIR_DATASYNC)
+ r = glfs_fdatasync_async(g->fd, gf_async_cb, io_u);
else if (io_u->ddir == DDIR_SYNC)
r = glfs_fsync_async(g->fd, gf_async_cb, io_u);
else
diff --git a/engines/glusterfs_sync.c b/engines/glusterfs_sync.c
index 235d74f6..6de4ee29 100644
--- a/engines/glusterfs_sync.c
+++ b/engines/glusterfs_sync.c
@@ -41,6 +41,10 @@ static int fio_gf_queue(struct thread_data *td, struct io_u *io_u)
ret = glfs_read(g->fd, io_u->xfer_buf, io_u->xfer_buflen, 0);
else if (io_u->ddir == DDIR_WRITE)
ret = glfs_write(g->fd, io_u->xfer_buf, io_u->xfer_buflen, 0);
+ else if (io_u->ddir == DDIR_SYNC)
+ ret = glfs_fsync(g->fd);
+ else if (io_u->ddir == DDIR_DATASYNC)
+ ret = glfs_fdatasync(g->fd);
else {
log_err("unsupported operation.\n");
return -EINVAL;