diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-02-05 00:51:23 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-03-22 17:33:11 -0400 |
commit | e5cf4d5ae338b4e3ac5ba6af3f2fb03306eaf5d9 (patch) | |
tree | 903c307b84c133175cf62b376de220b1c2bea316 /fs/bcachefs/super.c | |
parent | d02f81d6093a8ffe1ca6673a118ca84a55c3cace (diff) |
thread_with_file: Lift from bcachefstime_stats_twf
thread_with_file and thread_with_stdio are abstractions for connecting
kthreads to file descriptors, which is handy for all sorts of things -
the running kthread has its lifetime connected to the file descriptor,
which means an asynchronous job running in the kernel can easily exit in
response to a ctrl-c, and the file descriptor also provides a
communications channel.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/super.c')
-rw-r--r-- | fs/bcachefs/super.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c index 9288e000d8d9..970d1abb5d7a 100644 --- a/fs/bcachefs/super.c +++ b/fs/bcachefs/super.c @@ -57,7 +57,6 @@ #include "super.h" #include "super-io.h" #include "sysfs.h" -#include "thread_with_file.h" #include "trace.h" #include <linux/backing-dev.h> @@ -69,6 +68,7 @@ #include <linux/percpu.h> #include <linux/random.h> #include <linux/sysfs.h> +#include <linux/thread_with_file.h> #include <crypto/hash.h> MODULE_LICENSE("GPL"); @@ -96,7 +96,7 @@ static void bch2_print_maybe_redirect(struct stdio_redirect *stdio, const char * if (fmt[0] == KERN_SOH[0]) fmt += 2; - bch2_stdio_redirect_vprintf(stdio, true, fmt, args); + stdio_redirect_vprintf(stdio, true, fmt, args); return; } #endif @@ -113,16 +113,6 @@ void bch2_print_opts(struct bch_opts *opts, const char *fmt, ...) va_end(args); } -void __bch2_print(struct bch_fs *c, const char *fmt, ...) -{ - struct stdio_redirect *stdio = bch2_fs_stdio_redirect(c); - - va_list args; - va_start(args, fmt); - bch2_print_maybe_redirect(stdio, fmt, args); - va_end(args); -} - #define KTYPE(type) \ static const struct attribute_group type ## _group = { \ .attrs = type ## _files \ |