btrfs: add BTRFS_IOC_ENCODED_WRITE
authorOmar Sandoval <osandov@fb.com>
Tue, 13 Aug 2019 23:00:02 +0000 (16:00 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 28 Feb 2022 15:20:03 +0000 (16:20 +0100)
commit4af9848733aa0695d1b5654eaebf6891087b1806
tree623f31e26000a2e9a0eda8469dc3697718a8dcca
parent8ba385e00eb9e2cea594e48d3affa9c8ed311254
btrfs: add BTRFS_IOC_ENCODED_WRITE

The implementation resembles direct I/O: we have to flush any ordered
extents, invalidate the page cache, and do the io tree/delalloc/extent
map/ordered extent dance. From there, we can reuse the compression code
with a minor modification to distinguish the write from writeback. This
also creates inline extents when possible.

Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/compression.c
fs/btrfs/compression.h
fs/btrfs/ctree.h
fs/btrfs/file.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/ordered-data.c
fs/btrfs/ordered-data.h