Add file locking hooks
[fio.git] / filesetup.c
index c0403d2a801e863df927ed87a2a935161c7cb394..188b0ce88c476633b0a42931ef901dc9000b171c 100644 (file)
@@ -585,12 +585,14 @@ int add_file(struct thread_data *td, const char *fname)
 
        dprint(FD_FILE, "add file %s\n", fname);
 
-       td->files = realloc(td->files, (cur_files + 1) * sizeof(*f));
-
-       f = &td->files[cur_files];
+       f = malloc(sizeof(*f));
        memset(f, 0, sizeof(*f));
        f->fd = -1;
 
+       td->files = realloc(td->files, (cur_files + 1) * sizeof(f));
+
+       td->files[cur_files] = f;
+
        /*
         * init function, io engine may not be loaded yet
         */
@@ -643,6 +645,14 @@ int put_file(struct thread_data *td, struct fio_file *f)
        return ret;
 }
 
+void lock_file(struct thread_data *td, struct fio_file *f)
+{
+}
+
+void unlock_file(struct fio_file *f)
+{
+}
+
 static int recurse_dir(struct thread_data *td, const char *dirname)
 {
        struct dirent *dir;