md5: fix bug in hash size
[fio.git] / os / os-linux.h
index 7162dfa20fa7721434ccb23a9e3660909d776d36..b6ba569a46f603a389a12d959b19820be801079a 100644 (file)
@@ -4,6 +4,7 @@
 #include <sys/ioctl.h>
 #include <sys/uio.h>
 #include <sys/syscall.h>
+#include <sys/vfs.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
@@ -33,6 +34,9 @@
 #define FIO_HAVE_PSHARED_MUTEX
 #define FIO_HAVE_CL_SIZE
 #define FIO_HAVE_CGROUPS
+#define FIO_HAVE_FDATASYNC
+#define FIO_HAVE_SYNC_FILE_RANGE
+#define FIO_HAVE_FS_STAT
 
 #define OS_MAP_ANON            MAP_ANONYMOUS
 
@@ -278,4 +282,17 @@ static inline int arch_cache_line_size(void)
                return atoi(size);
 }
 
+static inline unsigned long long get_fs_size(const char *path)
+{
+       unsigned long long ret;
+       struct statfs s;
+
+       if (statfs(path, &s) < 0)
+               return -1ULL;
+
+       ret = s.f_bsize;
+       ret *= (unsigned long long) s.f_bfree;
+       return ret;
+}
+
 #endif