Merge branch 'fix_filename_overrun' of https://github.com/sitsofe/fio
[fio.git] / io_u.h
diff --git a/io_u.h b/io_u.h
index b228e2e84d7dffc1aef4baceef3f7fa6fc404d5b..d4c5be4303b3dc4bb7ed9a3cb905b86852231401 100644 (file)
--- a/io_u.h
+++ b/io_u.h
@@ -3,7 +3,6 @@
 
 #include "compiler/compiler.h"
 #include "os/os.h"
-#include "log.h"
 #include "io_ddir.h"
 #include "debug.h"
 #include "file.h"
@@ -12,9 +11,6 @@
 #ifdef CONFIG_LIBAIO
 #include <libaio.h>
 #endif
-#ifdef CONFIG_GUASI
-#include <guasi.h>
-#endif
 
 enum {
        IO_U_F_FREE             = 1 << 0,
@@ -25,6 +21,7 @@ enum {
        IO_U_F_TRIMMED          = 1 << 5,
        IO_U_F_BARRIER          = 1 << 6,
        IO_U_F_VER_LIST         = 1 << 7,
+       IO_U_F_PRIORITY         = 1 << 8,
 };
 
 /*
@@ -52,8 +49,9 @@ struct io_u {
        /*
         * Allocated/set buffer and length
         */
-       unsigned long buflen;
-       unsigned long long offset;
+       unsigned long long buflen;
+       unsigned long long offset;      /* is really ->xfer_offset... */
+       unsigned long long verify_offset;       /* is really ->offset */
        void *buf;
 
        /*
@@ -66,17 +64,17 @@ struct io_u {
         * partial transfers / residual data counts
         */
        void *xfer_buf;
-       unsigned long xfer_buflen;
+       unsigned long long xfer_buflen;
 
        /*
         * Parameter related to pre-filled buffers and
         * their size to handle variable block sizes.
         */
-       unsigned long buf_filled_len;
+       unsigned long long buf_filled_len;
 
        struct io_piece *ipo;
 
-       unsigned int resid;
+       unsigned long long resid;
        unsigned int error;
 
        /*
@@ -93,6 +91,22 @@ struct io_u {
                struct workqueue_work work;
        };
 
+       /*
+        * ZBD mode zbd_queue_io callback: called after engine->queue operation
+        * to advance a zone write pointer and eventually unlock the I/O zone.
+        * @q indicates the I/O queue status (busy, queued or completed).
+        * @success == true means that the I/O operation has been queued or
+        * completed successfully.
+        */
+       void (*zbd_queue_io)(struct thread_data *td, struct io_u *, int q,
+                            bool success);
+
+       /*
+        * ZBD mode zbd_put_io callback: called in after completion of an I/O
+        * or commit of an async I/O to unlock the I/O target zone.
+        */
+       void (*zbd_put_io)(struct thread_data *td, const struct io_u *);
+
        /*
         * Callback for io completion
         */
@@ -108,15 +122,9 @@ struct io_u {
 #ifdef FIO_HAVE_SGIO
                struct sg_io_hdr hdr;
 #endif
-#ifdef CONFIG_GUASI
-               guasi_req_t greq;
-#endif
 #ifdef CONFIG_SOLARISAIO
                aio_result_t resultp;
 #endif
-#ifdef FIO_HAVE_BINJECT
-               struct b_user_cmd buc;
-#endif
 #ifdef CONFIG_RDMA
                struct ibv_mr *mr;
 #endif
@@ -138,8 +146,8 @@ extern void io_u_queued(struct thread_data *, struct io_u *);
 extern int io_u_quiesce(struct thread_data *);
 extern void io_u_log_error(struct thread_data *, struct io_u *);
 extern void io_u_mark_depth(struct thread_data *, unsigned int);
-extern void fill_io_buffer(struct thread_data *, void *, unsigned int, unsigned int);
-extern void io_u_fill_buffer(struct thread_data *td, struct io_u *, unsigned int, unsigned int);
+extern void fill_io_buffer(struct thread_data *, void *, unsigned long long, unsigned long long);
+extern void io_u_fill_buffer(struct thread_data *td, struct io_u *, unsigned long long, unsigned long long);
 void io_u_mark_complete(struct thread_data *, unsigned int);
 void io_u_mark_submit(struct thread_data *, unsigned int);
 bool queue_full(const struct thread_data *);
@@ -152,12 +160,17 @@ static inline void dprint_io_u(struct io_u *io_u, const char *p)
 {
        struct fio_file *f = io_u->file;
 
-       dprint(FD_IO, "%s: io_u %p: off=%llu/len=%lu/ddir=%d", p, io_u,
-                                       (unsigned long long) io_u->offset,
-                                       io_u->buflen, io_u->ddir);
        if (f)
-               dprint(FD_IO, "/%s", f->file_name);
-       dprint(FD_IO, "\n");
+               dprint(FD_IO, "%s: io_u %p: off=0x%llx,len=0x%llx,ddir=%d,file=%s\n",
+                               p, io_u,
+                               (unsigned long long) io_u->offset,
+                               io_u->buflen, io_u->ddir,
+                               f->file_name);
+       else
+               dprint(FD_IO, "%s: io_u %p: off=0x%llx,len=0x%llx,ddir=%d\n",
+                               p, io_u,
+                               (unsigned long long) io_u->offset,
+                               io_u->buflen, io_u->ddir);
 }
 #else
 #define dprint_io_u(io_u, p)
@@ -175,5 +188,7 @@ static inline enum fio_ddir acct_ddir(struct io_u *io_u)
        td_flags_clear((td), &(io_u->flags), (val))
 #define io_u_set(td, io_u, val)                \
        td_flags_set((td), &(io_u)->flags, (val))
+#define io_u_is_prio(io_u)     \
+       (io_u->flags & (unsigned int) IO_U_F_PRIORITY) != 0
 
 #endif