bcachefs: thread_with_stdio: eliminate double buffering
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 5 Feb 2024 01:19:49 +0000 (20:19 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Wed, 13 Mar 2024 22:39:13 +0000 (18:39 -0400)
commite017047fdb3a449f45d73ea4c4e94465090b93a1
tree9b0a3812d4b92b8956113b9d1d9f55526a9f4133
parentcb6fc943b650c4f0ca2ba753531c0803c8afbb5c
bcachefs: thread_with_stdio: eliminate double buffering

The output buffer lock has to be a spinlock so that we can write to it
from interrupt context, so we can't use a direct copy_to_user; this
switches thread_with_file_read() to use fault_in_writeable() and
copy_to_user_nofault(), similar to how thread_with_file_write() works.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/thread_with_file.c
fs/bcachefs/thread_with_file.h