btrfs: add support for uncached writes buffered-uncached.7
authorJens Axboe <axboe@kernel.dk>
Sun, 10 Nov 2024 20:44:52 +0000 (13:44 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 14 Nov 2024 14:15:22 +0000 (07:15 -0700)
commitcc2d6a034e91e9e7704f104e68c7c75f98666b9f
tree941d5bf0ca04222505cda7aa831a3bfaca90ec9c
parent7fc58748d57e4bda165098802cf06eba150427f1
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