btrfs: add support for uncached writes
authorJens Axboe <axboe@kernel.dk>
Sun, 10 Nov 2024 20:44:52 +0000 (13:44 -0700)
committerJens Axboe <axboe@kernel.dk>
Sun, 1 Dec 2024 22:55:24 +0000 (15:55 -0700)
commitb09fdfa5d7d5c4a79fb91e47b539c410eac89436
tree5a72ea66d9128926cd1f8bafd0cf1e4549ab5092
parent20f7474ab27f218d48ac2045b43bcc918b3eadc6
btrfs: add support for uncached writes

The read side is already covered as btrfs uses the generic filemap
helpers. For writes, just pass in FGP_UNCACHED if uncached IO is being
done, then the folios created should be marked appropriately.

For IO completion, ensure that writing back folios that are uncached
gets punted to one of the btrfs workers, as task context is needed for
that. Add an 'uncached_io' member to struct btrfs_bio to manage that.

With that, add FOP_UNCACHED to the btrfs file_operations fop_flags
structure, enabling use of RWF_UNCACHED.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/btrfs/bio.c
fs/btrfs/bio.h
fs/btrfs/extent_io.c
fs/btrfs/file.c