X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=os%2Fos.h;h=1a4437c940ad1b3f9c7f9266be1f2d021963d797;hb=34851ad5ffacf9f4f8a7f23ee2edb17281b917a0;hp=21b7a9d03a5269e2b02e04517cfe944577977413;hpb=1ed84d86e0e357fd525c91ee41c0a56d4a71ef85;p=fio.git diff --git a/os/os.h b/os/os.h index 21b7a9d0..1a4437c9 100644 --- a/os/os.h +++ b/os/os.h @@ -60,11 +60,6 @@ typedef struct aiocb os_aiocb_t; #endif #endif -#ifdef FIO_HAVE_SGIO -#include -#include -#endif - #ifndef CONFIG_STRSEP #include "../oslib/strsep.h" #endif @@ -160,7 +155,7 @@ extern int fio_cpus_split(os_cpu_mask_t *mask, unsigned int cpu); #endif #ifndef FIO_OS_PATH_SEPARATOR -#define FIO_OS_PATH_SEPARATOR "/" +#define FIO_OS_PATH_SEPARATOR '/' #endif #ifndef FIO_PREFERRED_CLOCK_SOURCE @@ -209,16 +204,20 @@ static inline uint64_t fio_swap64(uint64_t val) #ifndef FIO_HAVE_BYTEORDER_FUNCS #ifdef CONFIG_LITTLE_ENDIAN +#define __be64_to_cpu(x) fio_swap64(x) #define __le16_to_cpu(x) (x) #define __le32_to_cpu(x) (x) #define __le64_to_cpu(x) (x) +#define __cpu_to_be64(x) fio_swap64(x) #define __cpu_to_le16(x) (x) #define __cpu_to_le32(x) (x) #define __cpu_to_le64(x) (x) #else +#define __be64_to_cpu(x) (x) #define __le16_to_cpu(x) fio_swap16(x) #define __le32_to_cpu(x) fio_swap32(x) #define __le64_to_cpu(x) fio_swap64(x) +#define __cpu_to_be64(x) (x) #define __cpu_to_le16(x) fio_swap16(x) #define __cpu_to_le32(x) fio_swap32(x) #define __cpu_to_le64(x) fio_swap64(x) @@ -226,6 +225,10 @@ static inline uint64_t fio_swap64(uint64_t val) #endif /* FIO_HAVE_BYTEORDER_FUNCS */ #ifdef FIO_INTERNAL +#define be64_to_cpu(val) ({ \ + typecheck(uint64_t, val); \ + __be64_to_cpu(val); \ +}) #define le16_to_cpu(val) ({ \ typecheck(uint16_t, val); \ __le16_to_cpu(val); \ @@ -240,6 +243,10 @@ static inline uint64_t fio_swap64(uint64_t val) }) #endif +#define cpu_to_be64(val) ({ \ + typecheck(uint64_t, val); \ + __cpu_to_be64(val); \ +}) #define cpu_to_le16(val) ({ \ typecheck(uint16_t, val); \ __cpu_to_le16(val); \ @@ -329,14 +336,6 @@ static inline unsigned long long get_fs_free_size(const char *path) } #endif -#ifdef __powerpc64__ -#define FIO_HAVE_CPU_ONLINE_SYSCONF -static inline unsigned int cpus_online(void) -{ - return sysconf(_SC_NPROCESSORS_CONF); -} -#endif - #ifndef FIO_HAVE_CPU_ONLINE_SYSCONF static inline unsigned int cpus_online(void) { @@ -374,4 +373,16 @@ static inline int shm_attach_to_open_removed(void) } #endif +#ifndef FIO_HAVE_NATIVE_FALLOCATE +static inline bool fio_fallocate(struct fio_file *f, uint64_t offset, uint64_t len) +{ + errno = ENOSYS; + return false; +} +#endif + +#if defined(CONFIG_POSIX_FALLOCATE) || defined(FIO_HAVE_NATIVE_FALLOCATE) +# define FIO_HAVE_ANY_FALLOCATE +#endif + #endif