The return value of blockdev_invalidate_cache() has been platform
dependent (some pretend success, others return EINVAL) while Linux
is the only one actually supports this via Linux specific ioctl.
This commit makes all the rest return a consistent value ENOTSUP,
so __file_invalidate_cache() prints a blkdev invalidation failure
message that is consistent and makes sense.
Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
}
if (ret < 0)
errval = errno;
}
if (ret < 0)
errval = errno;
+ else if (ret) /* probably not supported */
+ errval = ret;
} else if (f->filetype == FIO_TYPE_CHAR ||
f->filetype == FIO_TYPE_PIPE) {
dprint(FD_IO, "invalidate not supported %s\n", f->file_name);
} else if (f->filetype == FIO_TYPE_CHAR ||
f->filetype == FIO_TYPE_PIPE) {
dprint(FD_IO, "invalidate not supported %s\n", f->file_name);
* continue on our way.
*/
if (errval)
* continue on our way.
*/
if (errval)
- log_info("fio: cache invalidation of %s failed: %s\n", f->file_name, strerror(errval));
+ log_info("fio: cache invalidation of %s failed: %s\n",
+ f->file_name, strerror(errval));
static inline int blockdev_invalidate_cache(struct fio_file *f)
{
static inline int blockdev_invalidate_cache(struct fio_file *f)
{
}
static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
}
static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
static inline int blockdev_invalidate_cache(struct fio_file *f)
{
static inline int blockdev_invalidate_cache(struct fio_file *f)
{
}
static inline unsigned long long os_phys_mem(void)
}
static inline unsigned long long os_phys_mem(void)
static inline int blockdev_invalidate_cache(struct fio_file *f)
{
static inline int blockdev_invalidate_cache(struct fio_file *f)
{
}
static inline unsigned long long os_phys_mem(void)
}
static inline unsigned long long os_phys_mem(void)
static inline int blockdev_invalidate_cache(struct fio_file *f)
{
static inline int blockdev_invalidate_cache(struct fio_file *f)
{
}
static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
}
static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
static inline int blockdev_invalidate_cache(struct fio_file *f)
{
static inline int blockdev_invalidate_cache(struct fio_file *f)
{
}
static inline unsigned long long os_phys_mem(void)
}
static inline unsigned long long os_phys_mem(void)
static inline int blockdev_invalidate_cache(struct fio_file *f)
{
static inline int blockdev_invalidate_cache(struct fio_file *f)
{
}
static inline unsigned long long os_phys_mem(void)
}
static inline unsigned long long os_phys_mem(void)
static inline int blockdev_invalidate_cache(struct fio_file *f)
{
static inline int blockdev_invalidate_cache(struct fio_file *f)
{
}
static inline unsigned long long os_phys_mem(void)
}
static inline unsigned long long os_phys_mem(void)
static inline int blockdev_invalidate_cache(struct fio_file *f)
{
static inline int blockdev_invalidate_cache(struct fio_file *f)
{
}
static inline unsigned long long os_phys_mem(void)
}
static inline unsigned long long os_phys_mem(void)
static inline int blockdev_invalidate_cache(struct fio_file *f)
{
static inline int blockdev_invalidate_cache(struct fio_file *f)
{
- /* There's no way to invalidate the cache in Windows
- * so just pretend to succeed */
- return 0;
}
static inline unsigned long long os_phys_mem(void)
}
static inline unsigned long long os_phys_mem(void)