Fixup posix_fallocate() usage
authorJens Axboe <jens.axboe@oracle.com>
Fri, 30 May 2008 20:58:37 +0000 (22:58 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 30 May 2008 20:58:37 +0000 (22:58 +0200)
It returns the error directly, not through errno. Also make
it non-fatal, Solaris seems to complain about it.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
filesetup.c

index d57a3277563c3a45c13943dcc00da0d501e03a22..60eaeb057a7e0a144ee27fccd1b1f2da49fbe0ac 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)
+               td_verror(td, -r, "posix_fallocate");
 
        b = malloc(td->o.max_bs[DDIR_WRITE]);
        memset(b, 0, td->o.max_bs[DDIR_WRITE]);