summaryrefslogtreecommitdiff
path: root/fs/bcachefs/bcachefs.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-12-31 10:04:54 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2024-01-05 23:24:19 -0500
commit96f37eabe7a5cb4746f369e959f935be464950be (patch)
tree7687178f9db3a005ece86a80e4b3c222736ed3a1 /fs/bcachefs/bcachefs.h
parentf60250de329ae6dbf8aeb49ebb13bf0b79e86a1d (diff)
bcachefs: factor out thread_with_file, thread_with_stdio
thread_with_stdio now knows how to handle input - fsck can now prompt to fix errors. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bcachefs.h')
-rw-r--r--fs/bcachefs/bcachefs.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h
index 840f605eff1f..ffef6182a477 100644
--- a/fs/bcachefs/bcachefs.h
+++ b/fs/bcachefs/bcachefs.h
@@ -464,6 +464,7 @@ enum bch_time_stats {
#include "replicas_types.h"
#include "subvolume_types.h"
#include "super_types.h"
+#include "thread_with_file_types.h"
/* Number of nodes btree coalesce will try to coalesce at once */
#define GC_MERGE_NODES 4U
@@ -478,12 +479,6 @@ enum bch_time_stats {
struct btree;
-struct log_output {
- spinlock_t lock;
- wait_queue_head_t wait;
- struct printbuf buf;
-};
-
enum gc_phase {
GC_PHASE_NOT_RUNNING,
GC_PHASE_START,
@@ -739,8 +734,8 @@ struct bch_fs {
struct super_block *vfs_sb;
dev_t dev;
char name[40];
- struct log_output *output;
- struct task_struct *output_filter;
+ struct stdio_redirect *stdio;
+ struct task_struct *stdio_filter;
/* ro/rw, add/remove/resize devices: */
struct rw_semaphore state_lock;
@@ -1252,6 +1247,15 @@ static inline bool bch2_dev_exists2(const struct bch_fs *c, unsigned dev)
return dev < c->sb.nr_devices && c->devs[dev];
}
+static inline struct stdio_redirect *bch2_fs_stdio_redirect(struct bch_fs *c)
+{
+ struct stdio_redirect *stdio = c->stdio;
+
+ if (c->stdio_filter && c->stdio_filter != current)
+ stdio = NULL;
+ return stdio;
+}
+
#define BKEY_PADDED_ONSTACK(key, pad) \
struct { struct bkey_i key; __u64 key ## _pad[pad]; }