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, 13 Dec 2024 15:29:02 +0000 (08:29 -0700)
commit9fd830c331ad8227bf5e0214155e4ba81451ff83
tree7ef2b016c7febfc9dc530060cb7e70c7ac6f52a6
parentacd8316c669257c294dac5c4b76a41ba139db64a
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