#include <linux/unistd.h>
#include <linux/raw.h>
#include <linux/major.h>
+#include <linux/fs.h>
+#include <scsi/sg.h>
#include "./os-linux-syscall.h"
#include "binject.h"
return atoi(size);
}
+#ifdef __powerpc64__
+#define FIO_HAVE_CPU_ONLINE_SYSCONF
+static inline unsigned int cpus_online(void)
+{
+ return sysconf(_SC_NPROCESSORS_CONF);
+}
+#endif
+
static inline unsigned long long get_fs_free_size(const char *path)
{
unsigned long long ret;
}
#endif
-#ifndef POSIX_FADV_STREAMID
-#define POSIX_FADV_STREAMID 8
+#ifndef F_GET_RW_HINT
+#ifndef F_LINUX_SPECIFIC_BASE
+#define F_LINUX_SPECIFIC_BASE 1024
+#endif
+#define F_GET_RW_HINT (F_LINUX_SPECIFIC_BASE + 11)
+#define F_SET_RW_HINT (F_LINUX_SPECIFIC_BASE + 12)
#endif
-#define FIO_HAVE_STREAMID
+#ifndef RWH_WRITE_LIFE_NONE
+#define RWH_WRITE_LIFE_NONE 0
+#define RWH_WRITE_LIFE_SHORT 1
+#define RWH_WRITE_LIFE_MEDIUM 2
+#define RWH_WRITE_LIFE_LONG 3
+#define RWH_WRITE_LIFE_EXTREME 4
+#endif
+
+#define FIO_HAVE_WRITE_HINT
#ifndef RWF_HIPRI
#define RWF_HIPRI 0x00000001
#define RWF_SYNC 0x00000004
#endif
+#ifndef RWF_WRITE_LIFE_SHIFT
+#define RWF_WRITE_LIFE_SHIFT 4
+#define RWF_WRITE_LIFE_SHORT (1 << RWF_WRITE_LIFE_SHIFT)
+#define RWF_WRITE_LIFE_MEDIUM (2 << RWF_WRITE_LIFE_SHIFT)
+#define RWF_WRITE_LIFE_LONG (3 << RWF_WRITE_LIFE_SHIFT)
+#define RWF_WRITE_LIFE_EXTREME (4 << RWF_WRITE_LIFE_SHIFT)
+#endif
+
#ifndef CONFIG_PWRITEV2
#ifdef __NR_preadv2
static inline void make_pos_h_l(unsigned long *pos_h, unsigned long *pos_l,
off_t offset)
{
#if BITS_PER_LONG == 64
-#warning 64
*pos_l = offset;
*pos_h = 0;
#else
-#warning 32
*pos_l = offset & 0xffffffff;
*pos_h = ((uint64_t) offset) >> 32;
#endif