fio: fix aio trim completion latencies
[fio.git] / verify-state.h
index f1dc069ec68f4c928f5aca9a0dad9d9c3519cc4e..6da1585b24657a60d7357d4f04f6f445f01544f3 100644 (file)
@@ -2,6 +2,9 @@
 #define FIO_VERIFY_STATE_H
 
 #include <stdint.h>
 #define FIO_VERIFY_STATE_H
 
 #include <stdint.h>
+#include <string.h>
+#include <limits.h>
+#include "lib/nowarn_snprintf.h"
 
 struct thread_rand32_state {
        uint32_t s[4];
 
 struct thread_rand32_state {
        uint32_t s[4];
@@ -75,14 +78,31 @@ static inline size_t thread_io_list_sz(struct thread_io_list *s)
 
 static inline struct thread_io_list *io_list_next(struct thread_io_list *s)
 {
 
 static inline struct thread_io_list *io_list_next(struct thread_io_list *s)
 {
-       return (void *) s + thread_io_list_sz(s);
+       return (struct thread_io_list *)((char *) s + thread_io_list_sz(s));
 }
 
 static inline void verify_state_gen_name(char *out, size_t size,
                                         const char *name, const char *prefix,
                                         int num)
 {
 }
 
 static inline void verify_state_gen_name(char *out, size_t size,
                                         const char *name, const char *prefix,
                                         int num)
 {
-       snprintf(out, size, "%s-%s-%d-verify.state", prefix, name, num);
+       char ename[PATH_MAX];
+       char *ptr;
+
+       /*
+        * Escape '/', just turn them into '.'
+        */
+       ptr = ename;
+       do {
+               *ptr = *name;
+               if (*ptr == '\0')
+                       break;
+               else if (*ptr == '/')
+                       *ptr = '.';
+               ptr++;
+               name++;
+       } while (1);
+
+       nowarn_snprintf(out, size, "%s-%s-%d-verify.state", prefix, ename, num);
        out[size - 1] = '\0';
 }
 
        out[size - 1] = '\0';
 }