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>
Tue, 15 Feb 2022 15:54:50 +0000 (16:54 +0100)
commit98a7b7e5f1b7a8769bbe7dbd729e367539eb9229
tree177bc5adf2e22557a957d974e2ac80fa1471e735
parentf8fdec1e3aeb23801edc56d78f9439776d151c06
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