The following changes since commit 15bc8b7ce155e42f044f3fe7a4286c67e811ae3b: Fio 1.44-rc1 (2010-09-24 20:31:34 +0200) are available in the git repository at: git://git.kernel.dk/fio.git master Jens Axboe (2): binject: correctly retrieve block size of device Use log_err() in the io engines engines/binject.c | 32 ++++++++++++++++++++++++++------ engines/guasi.c | 2 +- engines/libaio.c | 2 +- engines/posixaio.c | 2 +- engines/sg.c | 2 +- engines/solarisaio.c | 2 +- engines/splice.c | 2 +- engines/syslet-rw.c | 2 +- 8 files changed, 33 insertions(+), 13 deletions(-) --- Diff of recent changes: diff --git a/engines/binject.c b/engines/binject.c index a1b0181..68b6353 100644 --- a/engines/binject.c +++ b/engines/binject.c @@ -22,7 +22,6 @@ struct binject_data { struct io_u **events; struct pollfd *pfds; int *fd_flags; - unsigned int bs; }; static void binject_buc_init(struct binject_data *bd, struct io_u *io_u) @@ -161,11 +160,10 @@ static int fio_binject_doio(struct thread_data *td, struct io_u *io_u) static int fio_binject_prep(struct thread_data *td, struct io_u *io_u) { struct binject_data *bd = td->io_ops->data; + unsigned int bs = io_u->file->file_data; struct b_user_cmd *buc = &io_u->buc; - bd->bs = 512; - - if (io_u->xfer_buflen & (bd->bs - 1)) { + if (io_u->xfer_buflen & (bs - 1)) { log_err("read/write not sector aligned\n"); return EINVAL; } @@ -212,6 +210,28 @@ static struct io_u *fio_binject_event(struct thread_data *td, int event) return bd->events[event]; } +static int fio_binject_open_file(struct thread_data *td, struct fio_file *f) +{ + unsigned int bs; + int ret; + + ret = generic_open_file(td, f); + if (ret) + return 1; + + if (f->filetype != FIO_TYPE_BD) { + log_err("fio: binject only works with block devices\n"); + return 1; + } + if (ioctl(f->fd, BLKSSZGET, &bs) < 0) { + td_verror(td, errno, "BLKSSZGET"); + return 1; + } + + f->file_data = bs; + return 0; +} + static void fio_binject_cleanup(struct thread_data *td) { struct binject_data *bd = td->io_ops->data; @@ -257,7 +277,7 @@ static struct ioengine_ops ioengine = { .getevents = fio_binject_getevents, .event = fio_binject_event, .cleanup = fio_binject_cleanup, - .open_file = generic_open_file, + .open_file = fio_binject_open_file, .close_file = generic_close_file, .get_file_size = generic_get_file_size, .flags = FIO_RAWIO, @@ -272,7 +292,7 @@ static struct ioengine_ops ioengine = { */ static int fio_binject_init(struct thread_data fio_unused *td) { - fprintf(stderr, "fio: ioengine binject not available\n"); + log_err("fio: ioengine binject not available\n"); return 1; } diff --git a/engines/guasi.c b/engines/guasi.c index 15d4801..4839019 100644 --- a/engines/guasi.c +++ b/engines/guasi.c @@ -273,7 +273,7 @@ static struct ioengine_ops ioengine = { */ static int fio_guasi_init(struct thread_data fio_unused *td) { - fprintf(stderr, "fio: guasi not available\n"); + log_err("fio: guasi not available\n"); return 1; } diff --git a/engines/libaio.c b/engines/libaio.c index 44a7613..439cd24 100644 --- a/engines/libaio.c +++ b/engines/libaio.c @@ -240,7 +240,7 @@ static struct ioengine_ops ioengine = { */ static int fio_libaio_init(struct thread_data fio_unused *td) { - fprintf(stderr, "fio: libaio not available\n"); + log_err("fio: libaio not available\n"); return 1; } diff --git a/engines/posixaio.c b/engines/posixaio.c index b454aa0..f27ad8c 100644 --- a/engines/posixaio.c +++ b/engines/posixaio.c @@ -239,7 +239,7 @@ static struct ioengine_ops ioengine = { */ static int fio_posixaio_init(struct thread_data fio_unused *td) { - fprintf(stderr, "fio: posixaio not available\n"); + log_err("fio: posixaio not available\n"); return 1; } diff --git a/engines/sg.c b/engines/sg.c index bc82b09..ac1d999 100644 --- a/engines/sg.c +++ b/engines/sg.c @@ -416,7 +416,7 @@ static struct ioengine_ops ioengine = { */ static int fio_sgio_init(struct thread_data fio_unused *td) { - fprintf(stderr, "fio: ioengine sg not available\n"); + log_err("fio: ioengine sg not available\n"); return 1; } diff --git a/engines/solarisaio.c b/engines/solarisaio.c index 069cda5..906a154 100644 --- a/engines/solarisaio.c +++ b/engines/solarisaio.c @@ -234,7 +234,7 @@ static struct ioengine_ops ioengine = { */ static int fio_solarisaio_init(struct thread_data fio_unused *td) { - fprintf(stderr, "fio: solarisaio not available\n"); + log_err("fio: solarisaio not available\n"); return 1; } diff --git a/engines/splice.c b/engines/splice.c index 427b4e5..be16cbb 100644 --- a/engines/splice.c +++ b/engines/splice.c @@ -311,7 +311,7 @@ static struct ioengine_ops ioengine = { */ static int fio_spliceio_init(struct thread_data fio_unused *td) { - fprintf(stderr, "fio: splice not available\n"); + log_err("fio: splice not available\n"); return 1; } diff --git a/engines/syslet-rw.c b/engines/syslet-rw.c index c11e4f2..15e4c25 100644 --- a/engines/syslet-rw.c +++ b/engines/syslet-rw.c @@ -304,7 +304,7 @@ static struct ioengine_ops ioengine = { */ static int fio_syslet_init(struct thread_data fio_unused *td) { - fprintf(stderr, "fio: syslet not available\n"); + log_err("fio: syslet not available\n"); return 1; } -- To unsubscribe from this list: send the line "unsubscribe fio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html