Merge branch 'jf_readme_typo' of https://github.com/jfpanisset/fio
[fio.git] / engines / cmdprio.h
index 33a8f5b96c336cbb09eba78cc3f27442d4a4a406..0c7bd6cf4b92222189ff3bc897c4446f895f9847 100644 (file)
@@ -8,20 +8,35 @@
 
 #include "../fio.h"
 
+/* read and writes only, no trim */
+#define CMDPRIO_RWDIR_CNT 2
+
+enum {
+       CMDPRIO_MODE_NONE,
+       CMDPRIO_MODE_PERC,
+       CMDPRIO_MODE_BSSPLIT,
+};
+
+struct cmdprio_options {
+       unsigned int percentage[CMDPRIO_RWDIR_CNT];
+       unsigned int class[CMDPRIO_RWDIR_CNT];
+       unsigned int level[CMDPRIO_RWDIR_CNT];
+       char *bssplit_str;
+};
+
 struct cmdprio {
-       unsigned int percentage[DDIR_RWDIR_CNT];
-       unsigned int class[DDIR_RWDIR_CNT];
-       unsigned int level[DDIR_RWDIR_CNT];
-       unsigned int bssplit_nr[DDIR_RWDIR_CNT];
-       struct bssplit *bssplit[DDIR_RWDIR_CNT];
+       struct cmdprio_options *options;
+       unsigned int bssplit_nr[CMDPRIO_RWDIR_CNT];
+       struct bssplit *bssplit[CMDPRIO_RWDIR_CNT];
+       unsigned int mode;
 };
 
-int fio_cmdprio_bssplit_parse(struct thread_data *td, const char *input,
-                             struct cmdprio *cmdprio);
+bool fio_cmdprio_set_ioprio(struct thread_data *td, struct cmdprio *cmdprio,
+                           struct io_u *io_u);
 
-int fio_cmdprio_percentage(struct cmdprio *cmdprio, struct io_u *io_u);
+void fio_cmdprio_cleanup(struct cmdprio *cmdprio);
 
 int fio_cmdprio_init(struct thread_data *td, struct cmdprio *cmdprio,
-                    bool *has_cmdprio);
+                    struct cmdprio_options *options);
 
 #endif