bcachefs: Add buffered IO fallback for userspace
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 11 Jul 2023 00:30:04 +0000 (20:30 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:10:07 +0000 (17:10 -0400)
commitf39d1aca4de011949b1b1c636de3146f3b7c1384
tree46691098043c7c43b70c8341d1c36c3e5f9f74b7
parenta09818c7e78633ee8a6d147ea5bf074d60ea66cd
bcachefs: Add buffered IO fallback for userspace

In userspace, we want to be able to switch to buffered IO when we're
dealing with an image on a filesystem/device that doesn't support the
blocksize the filesystem was formatted with.

This plumbs through !opts.direct_io -> FMODE_BUFFERED, which will be
supported by the shim version of blkdev_get_by_path() in -tools, and it
adds a fallback to disable direct IO and retry for userspace.

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