+static struct workqueue_ops log_compress_wq_ops = {
+ .fn = gz_work_async,
+ .init_worker_fn = gz_init_worker,
+ .nice = 1,
+};
+
+int iolog_compress_init(struct thread_data *td, struct sk_out *sk_out)
+{
+ if (!(td->flags & TD_F_COMPRESS_LOG))
+ return 0;
+
+ workqueue_init(td, &td->log_compress_wq, &log_compress_wq_ops, 1, sk_out);
+ return 0;
+}
+
+void iolog_compress_exit(struct thread_data *td)
+{
+ if (!(td->flags & TD_F_COMPRESS_LOG))
+ return;
+
+ workqueue_exit(&td->log_compress_wq);
+}
+
+/*
+ * Queue work item to compress the existing log entries. We reset the
+ * current log to a small size, and reference the existing log in the
+ * data that we queue for compression. Once compression has been done,
+ * this old log is freed. If called with wait == 1, will not return until
+ * the log compression has completed.
+ */