return false;
for_each_file(td, f, i) {
- if (f->filetype != FIO_TYPE_BD)
+ if (f->filetype != FIO_TYPE_BLOCK)
continue;
if (device_is_mounted(f->file_name))
goto mounted;
if (ret)
return 1;
- if (f->filetype != FIO_TYPE_BD) {
+ if (f->filetype != FIO_TYPE_BLOCK) {
log_err("fio: binject only works with block devices\n");
goto err_close;
}
}
#ifdef FIO_MADV_FREE
- if (f->filetype == FIO_TYPE_BD)
+ if (f->filetype == FIO_TYPE_BLOCK)
(void) posix_madvise(fmd->mmap_ptr, fmd->mmap_sz, FIO_MADV_FREE);
#endif
struct fio_file *f = io_u->file;
int ret;
- if (f->filetype == FIO_TYPE_BD) {
+ if (f->filetype == FIO_TYPE_BLOCK) {
ret = fio_sgio_ioctl_doio(td, f, io_u);
td->error = io_u->error;
} else {
unsigned int bs = 0;
unsigned long long max_lba = 0;
- if (f->filetype == FIO_TYPE_BD) {
+ if (f->filetype == FIO_TYPE_BLOCK) {
if (ioctl(f->fd, BLKSSZGET, &bs) < 0) {
td_verror(td, errno, "ioctl");
return 1;
MAX_10B_LBA, max_lba);
}
- if (f->filetype == FIO_TYPE_BD) {
+ if (f->filetype == FIO_TYPE_BLOCK) {
td->io_ops->getevents = NULL;
td->io_ops->event = NULL;
}
if (fio_file_size_known(f))
return 0;
- if (f->filetype != FIO_TYPE_BD && f->filetype != FIO_TYPE_CHAR) {
+ if (f->filetype != FIO_TYPE_BLOCK && 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;
*/
enum fio_filetype {
FIO_TYPE_FILE = 1, /* plain file */
- FIO_TYPE_BD, /* block device */
+ FIO_TYPE_BLOCK, /* block device */
FIO_TYPE_CHAR, /* character device */
FIO_TYPE_PIPE, /* pipe */
};
if (f->filetype == FIO_TYPE_FILE)
ret = file_size(td, f);
- else if (f->filetype == FIO_TYPE_BD)
+ else if (f->filetype == FIO_TYPE_BLOCK)
ret = bdev_size(td, f);
else if (f->filetype == FIO_TYPE_CHAR)
ret = char_size(td, f);
ret = posix_fadvise(f->fd, off, len, POSIX_FADV_DONTNEED);
if (ret)
errval = ret;
- } else if (f->filetype == FIO_TYPE_BD) {
+ } else if (f->filetype == FIO_TYPE_BLOCK) {
int retry_count = 0;
ret = blockdev_invalidate_cache(f);
struct stat sb;
char buf[256];
- if (f->filetype == FIO_TYPE_BD || f->filetype == FIO_TYPE_CHAR) {
+ if (f->filetype == FIO_TYPE_BLOCK || f->filetype == FIO_TYPE_CHAR) {
if (f->real_file_size != -1ULL)
ret += f->real_file_size;
continue;
/* \\.\ is the device namespace in Windows, where every file is
* a block device */
if (strncmp(f->file_name, "\\\\.\\", 4) == 0)
- f->filetype = FIO_TYPE_BD;
+ f->filetype = FIO_TYPE_BLOCK;
#endif
if (!stat(f->file_name, &sb)) {
if (S_ISBLK(sb.st_mode))
- f->filetype = FIO_TYPE_BD;
+ f->filetype = FIO_TYPE_BLOCK;
else if (S_ISCHR(sb.st_mode))
f->filetype = FIO_TYPE_CHAR;
else if (S_ISFIFO(sb.st_mode))
goto err;
if (td->o.fadvise_hint != F_ADV_NONE &&
- (f->filetype == FIO_TYPE_BD || f->filetype == FIO_TYPE_FILE)) {
+ (f->filetype == FIO_TYPE_BLOCK || f->filetype == FIO_TYPE_FILE)) {
int flags;
if (td->o.fadvise_hint == F_ADV_TYPE) {
}
#ifdef FIO_HAVE_STREAMID
if (td->o.fadvise_stream &&
- (f->filetype == FIO_TYPE_BD || f->filetype == FIO_TYPE_FILE)) {
+ (f->filetype == FIO_TYPE_BLOCK || f->filetype == FIO_TYPE_FILE)) {
off_t stream = td->o.fadvise_stream;
if (posix_fadvise(f->fd, stream, f->io_size, POSIX_FADV_STREAMID) < 0) {