X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=engines%2Ffalloc.c;h=17a901ad93f54e08802d88260d0c48a6bde9070f;hp=4977d9e2bcd178b30c08e467a31102390322b903;hb=334d5177e087b9864540691f3a34d4ceacc55416;hpb=cb3eb86ee2f2f9c69fb7549b7443c40469e44701 diff --git a/engines/falloc.c b/engines/falloc.c index 4977d9e2..17a901ad 100644 --- a/engines/falloc.c +++ b/engines/falloc.c @@ -4,7 +4,7 @@ * IO engine that does regular fallocate to simulate data transfer * as fio ioengine. * DDIR_READ does fallocate(,mode = FALLOC_FL_KEEP_SIZE,) - * DDIR_WRITE does fallocate(,mode = 0) : fallocate with size extention + * DDIR_WRITE does fallocate(,mode = 0) : fallocate with size extension * DDIR_TRIM does fallocate(,mode = FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE) * */ @@ -43,9 +43,10 @@ open_again: if (f->fd == -1) { char buf[FIO_VERROR_SIZE]; - int __e = errno; - snprintf(buf, sizeof(buf) - 1, "open(%s)", f->file_name); - td_verror(td, __e, buf); + int e = errno; + + snprintf(buf, sizeof(buf), "open(%s)", f->file_name); + td_verror(td, e, buf); } if (!from_hash && f->fd != -1) { @@ -86,14 +87,8 @@ static int fio_fallocate_queue(struct thread_data *td, struct io_u *io_u) ret = fallocate(f->fd, flags, io_u->offset, io_u->xfer_buflen); - if (ret) { + if (ret) io_u->error = errno; - if (io_u->error) - td_verror(td, io_u->error, "xfer"); - } - - if (io_u->file && ret == 0 && ddir_rw(io_u->ddir)) - io_u->file->file_pos = io_u->offset + ret; return FIO_Q_COMPLETED; }