X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=engines%2Ffalloc.c;h=6382569b9a92c42c1ad5d76a75d9441808de6cc8;hp=4654fe817aaeccbd4e70b20c060990c1562dd33e;hb=fc220349e45144360917db48010b503a9874930d;hpb=95820b6e6c92025df8d89c0bf39b174e53137c41 diff --git a/engines/falloc.c b/engines/falloc.c index 4654fe81..6382569b 100644 --- a/engines/falloc.c +++ b/engines/falloc.c @@ -4,16 +4,12 @@ * 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) * */ #include -#include -#include -#include #include -#include #include #include "../fio.h" @@ -23,7 +19,7 @@ * generic_open_file is not appropriate because does not allow to perform * TRIM in to file */ -int open_file(struct thread_data *td, struct fio_file *f) +static int open_file(struct thread_data *td, struct fio_file *f) { int from_hash = 0; @@ -43,9 +39,10 @@ open_again: if (f->fd == -1) { char buf[FIO_VERROR_SIZE]; - int __e = errno; + int e = errno; + snprintf(buf, sizeof(buf), "open(%s)", f->file_name); - td_verror(td, __e, buf); + td_verror(td, e, buf); } if (!from_hash && f->fd != -1) { @@ -68,8 +65,10 @@ open_again: #endif #ifndef FALLOC_FL_PUNCH_HOLE #define FALLOC_FL_PUNCH_HOLE 0x02 /* de-allocates range */ -#endif -static int fio_fallocate_queue(struct thread_data *td, struct io_u *io_u) +#endif + +static enum fio_q_status fio_fallocate_queue(struct thread_data *td, + struct io_u *io_u) { struct fio_file *f = io_u->file; int ret;