Don't make posix_fallocate() set td->verror
[fio.git] / filesetup.c
index c98bf0c0ac934c0939529c2664c8c82844ce3896..746b3cda4da05b4717ad0a551c40f907e5323368 100644 (file)
@@ -70,10 +70,9 @@ static int extend_file(struct thread_data *td, struct fio_file *f)
 
        dprint(FD_FILE, "fallocate file %s, size %llu\n", f->file_name,
                                                        f->real_file_size);
-       if (posix_fallocate(f->fd, 0, f->real_file_size) < 0) {
-               td_verror(td, errno, "posix_fallocate");
-               goto err;
-       }
+       r = posix_fallocate(f->fd, 0, f->real_file_size);
+       if (r < 0)
+               log_err("fio: posix_fallocate fails: %s\n", strerror(-r));
 
        b = malloc(td->o.max_bs[DDIR_WRITE]);
        memset(b, 0, td->o.max_bs[DDIR_WRITE]);
@@ -307,7 +306,7 @@ int generic_open_file(struct thread_data *td, struct fio_file *f)
        if (td->o.sync_io)
                flags |= O_SYNC;
        if (f->filetype != FIO_TYPE_FILE)
-               flags |= O_NOATIME;
+               flags |= FIO_O_NOATIME;
 
 open_again:
        if (td_write(td)) {
@@ -337,8 +336,8 @@ open_again:
                char buf[FIO_VERROR_SIZE];
                int __e = errno;
 
-               if (errno == EPERM && (flags & O_NOATIME)) {
-                       flags &= ~O_NOATIME;
+               if (errno == EPERM && (flags & FIO_O_NOATIME)) {
+                       flags &= ~FIO_O_NOATIME;
                        goto open_again;
                }
 
@@ -602,7 +601,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;