similar to the way net ioengine documents filename option.
Also bring in a file type check from fio_sgio_type_check()
to avoid pointless read capacity error against regfiles.
Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
synchronous using the SG_IO ioctl, or if
the target is an sg character device
we use read(2) and write(2) for asynchronous
synchronous using the SG_IO ioctl, or if
the target is an sg character device
we use read(2) and write(2) for asynchronous
+ io. Requires filename option to specify either
+ block or character devices.
null Doesn't transfer any data, just pretends
to. This is mainly used to exercise fio
null Doesn't transfer any data, just pretends
to. This is mainly used to exercise fio
}
} else {
td_verror(td, EINVAL, "wrong file type");
}
} else {
td_verror(td, EINVAL, "wrong file type");
- log_err("ioengine sg only works on block devices\n");
+ log_err("ioengine sg only works on block or character devices\n");
if (fio_file_size_known(f))
return 0;
if (fio_file_size_known(f))
return 0;
+ if (f->filetype != FIO_TYPE_BD && f->filetype != FIO_TYPE_CHAR) {
+ td_verror(td, EINVAL, "wrong file type");
+ log_err("ioengine sg only works on block or character devices\n");
+ return 1;
+ }
+
ret = fio_sgio_read_capacity(td, &bs, &max_lba);
if (ret ) {
td_verror(td, td->error, "fio_sgio_read_capacity");
ret = fio_sgio_read_capacity(td, &bs, &max_lba);
if (ret ) {
td_verror(td, td->error, "fio_sgio_read_capacity");