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>
Fri, 20 Dec 2024 15:30:54 +0000 (08:30 -0700)
commit1e356cfca552cb03d9b67a2cd6cfbb1646d7e962
tree4a71535634c95ca78d2261129854f1d1defd7fb3
parent257e92de795fdff7d7e256501e024fac6da6a7f4
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_DONTCACHE 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_DONTCACHE to the btrfs file_operations fop_flags
structure, enabling use of RWF_DONTCACHE.

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