From 3217fffd0948de9cdf96fb1bcdfb7419baee8620 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Fri, 9 Feb 2018 22:20:56 +0100 Subject: [PATCH] Patches to support musl libc UTIME_NOW is defined in on glibc and musl. Else, we just need a few headers to get glibc's crud. --- include/linux/byteorder.h | 1 + include/linux/log2.h | 2 +- include/linux/stat.h | 3 --- include/linux/types.h | 1 + libbcachefs/bcachefs_format.h | 1 + libbcachefs/siphash.c | 1 + 6 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/linux/byteorder.h b/include/linux/byteorder.h index 35ef2289..7b04f5bc 100644 --- a/include/linux/byteorder.h +++ b/include/linux/byteorder.h @@ -1,6 +1,7 @@ #ifndef __LINUX_BYTEORDER_H #define __LINUX_BYTEORDER_H +#include #include #define swab16 __swab16 diff --git a/include/linux/log2.h b/include/linux/log2.h index 6fecd393..1f977d60 100644 --- a/include/linux/log2.h +++ b/include/linux/log2.h @@ -184,7 +184,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n) __rounddown_pow_of_two(n) \ ) -static inline __attribute_const__ +static inline __attribute__((const)) int __get_order(unsigned long size) { int order; diff --git a/include/linux/stat.h b/include/linux/stat.h index d5ded253..1a30957b 100644 --- a/include/linux/stat.h +++ b/include/linux/stat.h @@ -9,7 +9,4 @@ #define S_IWUGO (S_IWUSR|S_IWGRP|S_IWOTH) #define S_IXUGO (S_IXUSR|S_IXGRP|S_IXOTH) -#define UTIME_NOW ((1l << 30) - 1l) -#define UTIME_OMIT ((1l << 30) - 2l) - #endif diff --git a/include/linux/types.h b/include/linux/types.h index ddc8eca7..2c1e9a22 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -5,6 +5,7 @@ #include #include +#include #include #define __SANE_USERSPACE_TYPES__ /* For PPC64, to get LL64 types */ diff --git a/libbcachefs/bcachefs_format.h b/libbcachefs/bcachefs_format.h index 85f728f2..854e1c3d 100644 --- a/libbcachefs/bcachefs_format.h +++ b/libbcachefs/bcachefs_format.h @@ -6,6 +6,7 @@ */ #include +#include #include #include diff --git a/libbcachefs/siphash.c b/libbcachefs/siphash.c index 3a6c9c82..d689a7b0 100644 --- a/libbcachefs/siphash.c +++ b/libbcachefs/siphash.c @@ -43,6 +43,7 @@ * https://131002.net/siphash/ */ +#include #include #include #include