X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=engines%2Ffalloc.c;h=4b05ed68fb467263ddbebabe7e79dd5231f92b63;hb=575686bb85fa36f326524c505e83c54abc0d2f2b;hp=17a901ad93f54e08802d88260d0c48a6bde9070f;hpb=0b783341927056e62ca2178c2ca74cca2c7b0100;p=fio.git diff --git a/engines/falloc.c b/engines/falloc.c index 17a901ad..4b05ed68 100644 --- a/engines/falloc.c +++ b/engines/falloc.c @@ -9,11 +9,7 @@ * */ #include -#include -#include -#include #include -#include #include #include "../fio.h" @@ -23,14 +19,14 @@ * 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; dprint(FD_FILE, "fd open %s\n", f->file_name); - if (f->filetype != FIO_TYPE_FILE) { - log_err("fio: only files are supported fallocate \n"); + if (f->filetype != FIO_TYPE_FILE && f->filetype != FIO_TYPE_BLOCK) { + log_err("fio: only files and blockdev are supported fallocate \n"); return 1; } if (!strcmp(f->file_name, "-")) { @@ -69,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;