summaryrefslogtreecommitdiff
path: root/libbcachefs/super.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-12-04 16:03:52 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-12-07 11:57:36 -0500
commit8d8a9f3e9bdd1d84fbbe0531e81977cc9044654a (patch)
treec40d5ed1c9e276ce3a5600971d02b533e45b05d2 /libbcachefs/super.c
parentdb9ae9a79d44ad0f74e9f95e88e6b3f9e83ca691 (diff)
Update bcachefs sources to 6d44812757dd bcachefs: BCH_IOCTL_FSCK_ONLINE
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'libbcachefs/super.c')
-rw-r--r--libbcachefs/super.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/libbcachefs/super.c b/libbcachefs/super.c
index e7f186b4..3abccdbf 100644
--- a/libbcachefs/super.c
+++ b/libbcachefs/super.c
@@ -80,6 +80,25 @@ const char * const bch2_fs_flag_strs[] = {
NULL
};
+void __bch2_print(struct bch_fs *c, const char *fmt, ...)
+{
+ va_list args;
+
+ va_start(args, fmt);
+ if (likely(!c->output)) {
+ vprintk(fmt, args);
+ } else {
+ unsigned long flags;
+
+ spin_lock_irqsave(&c->output->lock, flags);
+ prt_vprintf(&c->output->buf, fmt, args);
+ spin_unlock_irqrestore(&c->output->lock, flags);
+
+ wake_up(&c->output->wait);
+ }
+ va_end(args);
+}
+
#define KTYPE(type) \
static const struct attribute_group type ## _group = { \
.attrs = type ## _files \
@@ -703,6 +722,8 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts)
goto out;
}
+ c->output = (void *)(unsigned long) opts.log_output;
+
__module_get(THIS_MODULE);
closure_init(&c->cl, NULL);