summaryrefslogtreecommitdiff
path: root/fs/bcachefs/thread_with_file.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/bcachefs/thread_with_file.h')
-rw-r--r--fs/bcachefs/thread_with_file.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/bcachefs/thread_with_file.h b/fs/bcachefs/thread_with_file.h
index e20f2d17ee59..5361611edb4c 100644
--- a/fs/bcachefs/thread_with_file.h
+++ b/fs/bcachefs/thread_with_file.h
@@ -49,19 +49,23 @@ int bch2_run_thread_with_file(struct thread_with_file *,
const struct file_operations *,
int (*fn)(void *));
+struct thread_with_stdio;
+
+struct thread_with_stdio_ops {
+ void (*exit)(struct thread_with_stdio *);
+ void (*fn)(struct thread_with_stdio *);
+};
+
struct thread_with_stdio {
struct thread_with_file thr;
struct stdio_redirect stdio;
- void (*exit)(struct thread_with_stdio *);
- void (*fn)(struct thread_with_stdio *);
+ const struct thread_with_stdio_ops *ops;
};
int bch2_run_thread_with_stdio(struct thread_with_stdio *,
- void (*exit)(struct thread_with_stdio *),
- void (*fn)(struct thread_with_stdio *));
+ const struct thread_with_stdio_ops *);
int bch2_run_thread_with_stdout(struct thread_with_stdio *,
- void (*exit)(struct thread_with_stdio *),
- void (*fn)(struct thread_with_stdio *));
+ const struct thread_with_stdio_ops *);
int bch2_stdio_redirect_read(struct stdio_redirect *, char *, size_t);
int bch2_stdio_redirect_readline(struct stdio_redirect *, char *, size_t);