From: Jens Axboe Date: Mon, 16 Apr 2007 18:42:33 +0000 (+0200) Subject: Add check for pipe/fifo files X-Git-Tag: fio-1.16~20 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=b5605e9ded4188ed91faae1a43ecd333a9856f62 Add check for pipe/fifo files Signed-off-by: Jens Axboe --- diff --git a/filesetup.c b/filesetup.c index bd975d82..bb25cd5c 100644 --- a/filesetup.c +++ b/filesetup.c @@ -181,7 +181,7 @@ int file_invalidate_cache(struct thread_data *td, struct fio_file *f) log_err("fio: only root may flush block devices. Cache flush bypassed!\n"); ret = 0; } - } else if (f->filetype == FIO_TYPE_CHAR) + } else if (f->filetype == FIO_TYPE_CHAR || f->filetype == FIO_TYPE_PIPE) ret = 0; if (ret < 0) { @@ -485,6 +485,8 @@ static void get_file_type(struct fio_file *f) f->filetype = FIO_TYPE_BD; else if (S_ISCHR(sb.st_mode)) f->filetype = FIO_TYPE_CHAR; + else if (S_ISFIFO(sb.st_mode)) + f->filetype = FIO_TYPE_PIPE; } } diff --git a/fio.h b/fio.h index 1a318921..7ac57343 100644 --- a/fio.h +++ b/fio.h @@ -224,6 +224,7 @@ enum fio_filetype { FIO_TYPE_FILE = 1, /* plain file */ FIO_TYPE_BD, /* block device */ FIO_TYPE_CHAR, /* character device */ + FIO_TYPE_PIPE, /* pipe */ }; enum fio_ioengine_flags {