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>
Sat, 22 Feb 2025 00:24:45 +0000 (17:24 -0700)
commit71901d4220806aa4e67584bda73983c810a0264c
tree5f683b34fc0bf59fd246f6e70b2f7b645de11a8f
parent95e7e20449f3f1fe1df44dab71839c59331e2e0d
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