io_u: re-invalidate cache when looping around without file open/close
[fio.git] / filesetup.c
index 0dd3809baf5fbe648cd55e5599eab2543a8d47f8..5d7ea5c02e17b10357aea99a998bd885901f7bad 100644 (file)
@@ -869,12 +869,10 @@ uint64_t get_start_offset(struct thread_data *td, struct fio_file *f)
 
        if (o->start_offset_percent > 0) {
                /*
-                * if blockalign is provided, find the min across read, write,
-                * and trim
+                * if offset_align is provided, set initial offset
                 */
-               if (fio_option_is_set(o, ba)) {
-                       align_bs = (unsigned long long) min(o->ba[DDIR_READ], o->ba[DDIR_WRITE]);
-                       align_bs = min((unsigned long long) o->ba[DDIR_TRIM], align_bs);
+               if (fio_option_is_set(o, start_offset_align)) {
+                       align_bs = o->start_offset_align;
                } else {
                        /* else take the minimum block size */
                        align_bs = td_min_bs(td);
@@ -1543,7 +1541,11 @@ static int create_work_dirs(struct thread_data *td, const char *fname)
                        break;
                *end = '\0';
                errno = 0;
+#ifdef CONFIG_HAVE_MKDIR_TWO
                if (mkdir(path, 0600) && errno != EEXIST) {
+#else
+               if (mkdir(path) && errno != EEXIST) {
+#endif
                        log_err("fio: failed to create dir (%s): %d\n",
                                start, errno);
                        return 1;