summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2022-11-13 20:04:21 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2022-11-13 20:07:22 -0500
commitc1e4d447f6dd0ee60495b651436d2055db7777ed (patch)
tree36a657f7018cecc6bad43e0e178ef1913154eba0 /include/linux
parent980f7437e2588d100456640cb863908a3cc6fc77 (diff)
Update bcachefs sources to 8d3fc97ca3 bcachefs: Fixes for building in userspace
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/atomic.h12
-rw-r--r--include/linux/kernel.h2
-rw-r--r--include/linux/mean_and_variance.h2
-rw-r--r--include/linux/wait.h1
4 files changed, 16 insertions, 1 deletions
diff --git a/include/linux/atomic.h b/include/linux/atomic.h
index 38a364c0..a9852fa1 100644
--- a/include/linux/atomic.h
+++ b/include/linux/atomic.h
@@ -54,6 +54,8 @@ typedef struct {
#define __ATOMIC_ADD_RETURN_RELEASE(v, p) \
__atomic_add_fetch(p, v, __ATOMIC_RELEASE)
#define __ATOMIC_SUB_RETURN(v, p) __atomic_sub_fetch(p, v, __ATOMIC_RELAXED)
+#define __ATOMIC_SUB_RETURN_RELEASE(v, p) \
+ __atomic_sub_fetch(p, v, __ATOMIC_RELEASE)
#define xchg(p, v) __atomic_exchange_n(p, v, __ATOMIC_SEQ_CST)
#define xchg_acquire(p, v) __atomic_exchange_n(p, v, __ATOMIC_ACQUIRE)
@@ -123,6 +125,11 @@ do { \
({ smp_mb__before_atomic(); __ATOMIC_ADD_RETURN(i, v); })
#endif
+#ifndef __ATOMIC_SUB_RETURN_RELEASE
+#define __ATOMIC_SUB_RETURN_RELEASE(i, v) \
+ ({ smp_mb__before_atomic(); __ATOMIC_SUB_RETURN(i, v); })
+#endif
+
#ifndef __ATOMIC_SUB
#define __ATOMIC_SUB(i, v) __ATOMIC_SUB_RETURN(i, v)
#endif
@@ -164,6 +171,11 @@ static inline i_type a_type##_add_return_release(i_type i, a_type##_t *v)\
return __ATOMIC_ADD_RETURN_RELEASE(i, &v->counter); \
} \
\
+static inline i_type a_type##_sub_return_release(i_type i, a_type##_t *v)\
+{ \
+ return __ATOMIC_SUB_RETURN_RELEASE(i, &v->counter); \
+} \
+ \
static inline i_type a_type##_sub_return(i_type i, a_type##_t *v) \
{ \
return __ATOMIC_SUB_RETURN(i, &v->counter); \
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index d31b5f56..b2c1751c 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -229,6 +229,8 @@ static inline int __must_check kstrtos32(const char *s, unsigned int base, s32 *
}
struct printbuf;
+extern void prt_u64(struct printbuf *out, u64 num);
+
extern __printf(2, 0) void prt_vprintf(struct printbuf *out, const char *fmt, va_list args);
extern __printf(2, 3) void prt_printf(struct printbuf *out, const char *fmt, ...);
diff --git a/include/linux/mean_and_variance.h b/include/linux/mean_and_variance.h
index 3d62abe7..cbac6ac8 100644
--- a/include/linux/mean_and_variance.h
+++ b/include/linux/mean_and_variance.h
@@ -155,7 +155,7 @@ struct mean_and_variance_weighted {
u64 variance;
};
-inline s64 fast_divpow2(s64 n, u8 d);
+s64 fast_divpow2(s64 n, u8 d);
struct mean_and_variance mean_and_variance_update(struct mean_and_variance s1, s64 v1);
s64 mean_and_variance_get_mean(struct mean_and_variance s);
diff --git a/include/linux/wait.h b/include/linux/wait.h
index d1d33e67..d30fb10d 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -24,6 +24,7 @@ typedef struct {
} wait_queue_head_t;
void wake_up(wait_queue_head_t *);
+void wake_up_all(wait_queue_head_t *);
void prepare_to_wait(wait_queue_head_t *q, wait_queue_t *wait, int state);
void finish_wait(wait_queue_head_t *q, wait_queue_t *wait);
int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);