Fio 1.21-rc6
[fio.git] / filesetup.c
index 60eaeb057a7e0a144ee27fccd1b1f2da49fbe0ac..0b297641b11da6277b2b2c753c8d8cd6ccf11468 100644 (file)
@@ -68,11 +68,13 @@ static int extend_file(struct thread_data *td, struct fio_file *f)
                goto err;
        }
 
+#ifdef FIO_HAVE_FALLOCATE
        dprint(FD_FILE, "fallocate file %s, size %llu\n", f->file_name,
                                                        f->real_file_size);
        r = posix_fallocate(f->fd, 0, f->real_file_size);
        if (r < 0)
-               td_verror(td, -r, "posix_fallocate");
+               log_err("fio: posix_fallocate fails: %s\n", strerror(-r));
+#endif
 
        b = malloc(td->o.max_bs[DDIR_WRITE]);
        memset(b, 0, td->o.max_bs[DDIR_WRITE]);
@@ -601,7 +603,7 @@ int init_random_map(struct thread_data *td)
                                (unsigned long long) td->o.rw_min_bs;
                num_maps = (blocks + BLOCKS_PER_MAP - 1) /
                                (unsigned long long) BLOCKS_PER_MAP;
-               f->file_map = smalloc(num_maps * sizeof(long));
+               f->file_map = smalloc(num_maps * sizeof(int));
                if (f->file_map) {
                        f->num_maps = num_maps;
                        continue;