summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2018-02-09 22:20:56 +0100
committerLeah Neukirchen <leah@vuxu.org>2018-02-09 22:20:56 +0100
commit3217fffd0948de9cdf96fb1bcdfb7419baee8620 (patch)
treed41fe9473271b14607c02f261fbb17cb7ac16113
parente523a844d63e998a1291823ff7b5cf05fcc4a427 (diff)
Patches to support musl libc
UTIME_NOW is defined in <sys/stat.h> on glibc and musl. Else, we just need a few headers to get glibc's <sys/cdefs.h> crud.
-rw-r--r--include/linux/byteorder.h1
-rw-r--r--include/linux/log2.h2
-rw-r--r--include/linux/stat.h3
-rw-r--r--include/linux/types.h1
-rw-r--r--libbcachefs/bcachefs_format.h1
-rw-r--r--libbcachefs/siphash.c1
6 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/byteorder.h b/include/linux/byteorder.h
index 35ef228..7b04f5b 100644
--- a/include/linux/byteorder.h
+++ b/include/linux/byteorder.h
@@ -1,6 +1,7 @@
#ifndef __LINUX_BYTEORDER_H
#define __LINUX_BYTEORDER_H
+#include <linux/compiler.h>
#include <asm/byteorder.h>
#define swab16 __swab16
diff --git a/include/linux/log2.h b/include/linux/log2.h
index 6fecd39..1f977d6 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 d5ded25..1a30957 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 ddc8eca..2c1e9a2 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -5,6 +5,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <fcntl.h>
#include <sys/types.h>
#define __SANE_USERSPACE_TYPES__ /* For PPC64, to get LL64 types */
diff --git a/libbcachefs/bcachefs_format.h b/libbcachefs/bcachefs_format.h
index 85f728f..854e1c3 100644
--- a/libbcachefs/bcachefs_format.h
+++ b/libbcachefs/bcachefs_format.h
@@ -6,6 +6,7 @@
*/
#include <asm/types.h>
+#include <linux/compiler.h>
#include <asm/byteorder.h>
#include <linux/uuid.h>
diff --git a/libbcachefs/siphash.c b/libbcachefs/siphash.c
index 3a6c9c8..d689a7b 100644
--- a/libbcachefs/siphash.c
+++ b/libbcachefs/siphash.c
@@ -43,6 +43,7 @@
* https://131002.net/siphash/
*/
+#include <linux/compiler.h>
#include <asm/byteorder.h>
#include <asm/unaligned.h>
#include <linux/bitops.h>