Add support for Fusion-io atomic write engine
[fio.git] / engines / syslet-rw.c
index 4b3e5ef4ab18c2ca5b0610bbe125f497b7a7ba82..15e4c2578fe9ee978af4f4a1847ecf571871718e 100644 (file)
@@ -14,7 +14,7 @@
 #include <asm/unistd.h>
 
 #include "../fio.h"
-#include "../fls.h"
+#include "../lib/fls.h"
 
 #ifdef FIO_HAVE_SYSLET
 
@@ -131,6 +131,12 @@ static void fio_syslet_prep_sync(struct fio_file *f,
        FILL_IN(*regs, __NR_fsync, (long) f->fd);
 }
 
+static void fio_syslet_prep_datasync(struct fio_file *f,
+                                    struct indirect_registers *regs)
+{
+       FILL_IN(*regs, __NR_fdatasync, (long) f->fd);
+}
+
 static void fio_syslet_prep_rw(struct io_u *io_u, struct fio_file *f,
                               struct indirect_registers *regs)
 {
@@ -154,6 +160,8 @@ static void fio_syslet_prep(struct io_u *io_u, struct indirect_registers *regs)
 
        if (io_u->ddir == DDIR_SYNC)
                fio_syslet_prep_sync(f, regs);
+       else if (io_u->ddir == DDIR_DATASYNC)
+               fio_syslet_prep_datasync(f, regs);
        else
                fio_syslet_prep_rw(io_u, f, regs);
 }
@@ -284,6 +292,7 @@ static struct ioengine_ops ioengine = {
        .cleanup        = fio_syslet_cleanup,
        .open_file      = generic_open_file,
        .close_file     = generic_close_file,
+       .get_file_size  = generic_get_file_size,
 };
 
 #else /* FIO_HAVE_SYSLET */
@@ -295,7 +304,7 @@ static struct ioengine_ops ioengine = {
  */
 static int fio_syslet_init(struct thread_data fio_unused *td)
 {
-       fprintf(stderr, "fio: syslet not available\n");
+       log_err("fio: syslet not available\n");
        return 1;
 }