Merge branch 'master' of https://github.com/donny372/fio into master
[fio.git] / engines / rbd.c
index 8e7bd87c64d6bc251856ef9ec162f3c1097dbb73..268b6ebdffad2b71e4da565ed90867e76f90947a 100644 (file)
@@ -9,9 +9,6 @@
 
 #include "../fio.h"
 #include "../optgroup.h"
-#ifdef CONFIG_RBD_BLKIN
-#include <zipkin_c.h>
-#endif
 
 #ifdef CONFIG_RBD_POLL
 /* add for poll */
@@ -24,9 +21,6 @@ struct fio_rbd_iou {
        rbd_completion_t completion;
        int io_seen;
        int io_complete;
-#ifdef CONFIG_RBD_BLKIN
-       struct blkin_trace_info info;
-#endif
 };
 
 struct rbd_data {
@@ -206,6 +200,14 @@ static int _fio_rbd_connect(struct thread_data *td)
                log_err("rados_create failed.\n");
                goto failed_early;
        }
+       if (o->pool_name == NULL) {
+               log_err("rbd pool name must be provided.\n");
+               goto failed_early;
+       }
+       if (!o->rbd_name) {
+               log_err("rbdname must be provided.\n");
+               goto failed_early;
+       }
 
        r = rados_conf_read_file(rbd->cluster, NULL);
        if (r < 0) {
@@ -322,12 +324,14 @@ static inline int fri_check_complete(struct rbd_data *rbd, struct io_u *io_u,
        return 0;
 }
 
+#ifndef CONFIG_RBD_POLL
 static inline int rbd_io_u_seen(struct io_u *io_u)
 {
        struct fio_rbd_iou *fri = io_u->engine_data;
 
        return fri->io_seen;
 }
+#endif
 
 static void rbd_io_u_wait_complete(struct io_u *io_u)
 {
@@ -468,7 +472,8 @@ static int fio_rbd_getevents(struct thread_data *td, unsigned int min,
        return events;
 }
 
-static int fio_rbd_queue(struct thread_data *td, struct io_u *io_u)
+static enum fio_q_status fio_rbd_queue(struct thread_data *td,
+                                      struct io_u *io_u)
 {
        struct rbd_data *rbd = td->io_ops_data;
        struct fio_rbd_iou *fri = io_u->engine_data;
@@ -487,28 +492,16 @@ static int fio_rbd_queue(struct thread_data *td, struct io_u *io_u)
        }
 
        if (io_u->ddir == DDIR_WRITE) {
-#ifdef CONFIG_RBD_BLKIN
-               blkin_init_trace_info(&fri->info);
-               r = rbd_aio_write_traced(rbd->image, io_u->offset, io_u->xfer_buflen,
-                                        io_u->xfer_buf, fri->completion, &fri->info);
-#else
                r = rbd_aio_write(rbd->image, io_u->offset, io_u->xfer_buflen,
                                         io_u->xfer_buf, fri->completion);
-#endif
                if (r < 0) {
                        log_err("rbd_aio_write failed.\n");
                        goto failed_comp;
                }
 
        } else if (io_u->ddir == DDIR_READ) {
-#ifdef CONFIG_RBD_BLKIN
-               blkin_init_trace_info(&fri->info);
-               r = rbd_aio_read_traced(rbd->image, io_u->offset, io_u->xfer_buflen,
-                                       io_u->xfer_buf, fri->completion, &fri->info);
-#else
                r = rbd_aio_read(rbd->image, io_u->offset, io_u->xfer_buflen,
                                        io_u->xfer_buf, fri->completion);
-#endif
 
                if (r < 0) {
                        log_err("rbd_aio_read failed.\n");
@@ -675,7 +668,7 @@ static int fio_rbd_io_u_init(struct thread_data *td, struct io_u *io_u)
        return 0;
 }
 
-static struct ioengine_ops ioengine = {
+FIO_STATIC struct ioengine_ops ioengine = {
        .name                   = "rbd",
        .version                = FIO_IOOPS_VERSION,
        .setup                  = fio_rbd_setup,