bcachefs: BCH_WRITE_SYNC
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 29 Oct 2022 19:54:17 +0000 (15:54 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:45 +0000 (17:09 -0400)
commit1df3e19996a3b29ed82315bf03cb02ac4e4e70ab
tree745b9032df5c61f7b371071cbfd62622a8e4258c
parenta10195764901e0a41e64d596de57a957e7f982f0
bcachefs: BCH_WRITE_SYNC

This adds a new flag for the write path, BCH_WRITE_SYNC, and switches
the O_DIRECT write path to use it when we're not running asynchronously.

It runs the btree update after the write in the original thread's
context instead of a kworker, cutting context switches in half.

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