client: use temp buffer for single output flush for json/disk util
[fio.git] / workqueue.h
index f732b3089d0a47dac49bcaf35e266be70fa9dfa5..0a62b5f7d38d1868e63c47fa493c8324a30e042f 100644 (file)
@@ -1,7 +1,14 @@
 #ifndef FIO_RATE_H
 #define FIO_RATE_H
 
+#include <inttypes.h>
+#include <pthread.h>
+
 #include "flist.h"
+#include "lib/types.h"
+
+struct sk_out;
+struct thread_data;
 
 struct workqueue_work {
        struct flist_head list;
@@ -16,10 +23,11 @@ struct submit_worker {
        unsigned int index;
        uint64_t seq;
        struct workqueue *wq;
-       void *private;
+       void *priv;
+       struct sk_out *sk_out;
 };
 
-typedef void (workqueue_work_fn)(struct submit_worker *, struct workqueue_work *);
+typedef int (workqueue_work_fn)(struct submit_worker *, struct workqueue_work *);
 typedef bool (workqueue_pre_sleep_flush_fn)(struct submit_worker *);
 typedef void (workqueue_pre_sleep_fn)(struct submit_worker *);
 typedef int (workqueue_alloc_worker_fn)(struct submit_worker *);
@@ -60,10 +68,10 @@ struct workqueue {
        volatile int wake_idle;
 };
 
-int workqueue_init(struct thread_data *td, struct workqueue *wq, struct workqueue_ops *ops, unsigned int max_workers);
+int workqueue_init(struct thread_data *td, struct workqueue *wq, struct workqueue_ops *ops, unsigned int max_workers, struct sk_out *sk_out);
 void workqueue_exit(struct workqueue *wq);
 
-bool workqueue_enqueue(struct workqueue *wq, struct workqueue_work *work);
+void workqueue_enqueue(struct workqueue *wq, struct workqueue_work *work);
 void workqueue_flush(struct workqueue *wq);
 
 static inline bool workqueue_pre_sleep_check(struct submit_worker *sw)