diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-11-13 20:04:21 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2022-11-13 20:07:22 -0500 |
commit | c1e4d447f6dd0ee60495b651436d2055db7777ed (patch) | |
tree | 36a657f7018cecc6bad43e0e178ef1913154eba0 /linux | |
parent | 980f7437e2588d100456640cb863908a3cc6fc77 (diff) |
Update bcachefs sources to 8d3fc97ca3 bcachefs: Fixes for building in userspace
Diffstat (limited to 'linux')
-rw-r--r-- | linux/mean_and_variance.c | 2 | ||||
-rw-r--r-- | linux/printbuf_userspace.c | 5 | ||||
-rw-r--r-- | linux/six.c | 6 | ||||
-rw-r--r-- | linux/wait.c | 5 |
4 files changed, 16 insertions, 2 deletions
diff --git a/linux/mean_and_variance.c b/linux/mean_and_variance.c index 643e3113..aa95db12 100644 --- a/linux/mean_and_variance.c +++ b/linux/mean_and_variance.c @@ -52,7 +52,7 @@ * * note: this rounds towards 0. */ -inline s64 fast_divpow2(s64 n, u8 d) +s64 fast_divpow2(s64 n, u8 d) { return (n + ((n < 0) ? ((1 << d) - 1) : 0)) >> d; } diff --git a/linux/printbuf_userspace.c b/linux/printbuf_userspace.c index df9567c5..0ae56ee1 100644 --- a/linux/printbuf_userspace.c +++ b/linux/printbuf_userspace.c @@ -27,3 +27,8 @@ void prt_printf(struct printbuf *out, const char *fmt, ...) prt_vprintf(out, fmt, args); va_end(args); } + +void prt_u64(struct printbuf *out, u64 v) +{ + prt_printf(out, "%llu", v); +} diff --git a/linux/six.c b/linux/six.c index 39f7ea79..39a9bd6e 100644 --- a/linux/six.c +++ b/linux/six.c @@ -342,7 +342,11 @@ static bool __six_relock_type(struct six_lock *lock, enum six_lock_type type, return true; } -#ifdef CONFIG_LOCK_SPIN_ON_OWNER +/* + * We don't see stable performance with SIX_LOCK_SPIN_ON_OWNER enabled, so it's + * off for now: + */ +#ifdef SIX_LOCK_SPIN_ON_OWNER static inline bool six_optimistic_spin(struct six_lock *lock, struct six_lock_waiter *wait) diff --git a/linux/wait.c b/linux/wait.c index 991875c5..b1f002b9 100644 --- a/linux/wait.c +++ b/linux/wait.c @@ -66,6 +66,11 @@ void wake_up(wait_queue_head_t *q) __wake_up(q, TASK_NORMAL, 1, NULL); } +void wake_up_all(wait_queue_head_t *q) +{ + __wake_up(q, TASK_NORMAL, 0, NULL); +} + static void __wake_up_locked(wait_queue_head_t *q, unsigned int mode, int nr) { __wake_up_common(q, mode, nr, 0, NULL); |