diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-02-04 22:20:40 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-03-13 18:39:13 -0400 |
commit | 60e1baa872a1550ea7c083977c817ca2ede04eaf (patch) | |
tree | d72ec05bbb89f5b8c3ca0878ad5b50444b83bf8e /fs/bcachefs/super.c | |
parent | e017047fdb3a449f45d73ea4c4e94465090b93a1 (diff) | |
download | linux-60e1baa872a1550ea7c083977c817ca2ede04eaf.tar.gz linux-60e1baa872a1550ea7c083977c817ca2ede04eaf.tar.bz2 linux-60e1baa872a1550ea7c083977c817ca2ede04eaf.zip |
bcachefs: thread_with_stdio: convert to darray
- eliminate the dependency on printbufs, so that we can lift
thread_with_file for use in xfs
- add a nonblocking parameter to stdio_redirect_printf(), and either
block if the buffer is full or drop it on the floor - don't buffer
infinitely
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/super.c')
-rw-r--r-- | fs/bcachefs/super.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c index b17f2e199322..eeeb01156444 100644 --- a/fs/bcachefs/super.c +++ b/fs/bcachefs/super.c @@ -56,6 +56,7 @@ #include "super.h" #include "super-io.h" #include "sysfs.h" +#include "thread_with_file.h" #include "trace.h" #include <linux/backing-dev.h> @@ -95,16 +96,10 @@ void __bch2_print(struct bch_fs *c, const char *fmt, ...) if (likely(!stdio)) { vprintk(fmt, args); } else { - unsigned long flags; - if (fmt[0] == KERN_SOH[0]) fmt += 2; - spin_lock_irqsave(&stdio->output_lock, flags); - prt_vprintf(&stdio->output_buf, fmt, args); - spin_unlock_irqrestore(&stdio->output_lock, flags); - - wake_up(&stdio->output_wait); + bch2_stdio_redirect_vprintf(stdio, true, fmt, args); } va_end(args); } |