projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] File creation and info fixes
[fio.git]
/
os-linux.h
diff --git
a/os-linux.h
b/os-linux.h
index 4c54c8ccc6f0991af3dfbf4edd16d3267c45e0ea..752d17e1e84db3af75726560574aaa20b712a8e1 100644
(file)
--- a/
os-linux.h
+++ b/
os-linux.h
@@
-84,6
+84,18
@@
enum {
#define BLKGETSIZE64 _IOR(0x12,114,size_t)
#endif
#define BLKGETSIZE64 _IOR(0x12,114,size_t)
#endif
+#ifndef BLKFLSBUF
+#define BLKFLSBUF _IO(0x12,97)
+#endif
+
+static inline int blockdev_invalidate_cache(int fd)
+{
+ if (!ioctl(fd, BLKFLSBUF))
+ return 0;
+
+ return errno;
+}
+
static inline int blockdev_size(int fd, unsigned long long *bytes)
{
if (!ioctl(fd, BLKGETSIZE64, bytes))
static inline int blockdev_size(int fd, unsigned long long *bytes)
{
if (!ioctl(fd, BLKGETSIZE64, bytes))