bcachefs: thread_with_file: allow creation of readonly files
authorDarrick J. Wong <djwong@kernel.org>
Wed, 7 Feb 2024 19:43:32 +0000 (11:43 -0800)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 14 Mar 2024 01:22:08 +0000 (21:22 -0400)
commitfcb1620edd4d59eff4b3466be1d61263cea958a8
treec8c59c73272624d0eba47576bdc956b697ffeedb
parenta5a650d6472f238191d98d8aba7536a9fb3d9f99
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>
fs/bcachefs/thread_with_file.c
fs/bcachefs/thread_with_file.h