btrfs: add support for uncached writes buffered-uncached-6.12.8
authorJens Axboe <axboe@kernel.dk>
Sun, 10 Nov 2024 20:44:52 +0000 (13:44 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 20 Nov 2024 14:32:31 +0000 (07:32 -0700)
commitac4f5829e990244742af7115411016bdb355b8e2
treef3bef26c60fc8a550fa8aacde352fc63d69900b1
parentd08f4929543526fe07a2163d7c51dd14f25e51b5
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