summaryrefslogtreecommitdiff
path: root/fs/bcachefs/thread_with_file.h
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2024-02-07 11:43:32 -0800
committerKent Overstreet <kent.overstreet@linux.dev>2024-03-13 21:22:08 -0400
commitfcb1620edd4d59eff4b3466be1d61263cea958a8 (patch)
treec8c59c73272624d0eba47576bdc956b697ffeedb /fs/bcachefs/thread_with_file.h
parenta5a650d6472f238191d98d8aba7536a9fb3d9f99 (diff)
bcachefs: thread_with_file: allow creation of readonly files
Create a new run_thread_with_stdout function that opens a file in O_RDONLY mode so that the kernel can write things to userspace but userspace cannot write to the kernel. This will be used to convey xfs health event information to userspace. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/thread_with_file.h')
-rw-r--r--fs/bcachefs/thread_with_file.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/bcachefs/thread_with_file.h b/fs/bcachefs/thread_with_file.h
index f06f8ff19a79..2b687723d6b9 100644
--- a/fs/bcachefs/thread_with_file.h
+++ b/fs/bcachefs/thread_with_file.h
@@ -59,6 +59,9 @@ struct thread_with_stdio {
int bch2_run_thread_with_stdio(struct thread_with_stdio *,
void (*exit)(struct thread_with_stdio *),
void (*fn)(struct thread_with_stdio *));
+int bch2_run_thread_with_stdout(struct thread_with_stdio *,
+ void (*exit)(struct thread_with_stdio *),
+ void (*fn)(struct thread_with_stdio *));
int bch2_stdio_redirect_read(struct stdio_redirect *, char *, size_t);
int bch2_stdio_redirect_readline(struct stdio_redirect *, char *, size_t);