summaryrefslogtreecommitdiff
path: root/fs/btrfs/compression.h
diff options
context:
space:
mode:
authorOmar Sandoval <osandov@fb.com>2019-08-14 02:00:02 +0300
committerDavid Sterba <dsterba@suse.com>2022-03-14 15:13:51 +0300
commit7c0c7269f7b508ba6e4b063a9314d6bd1fb6db22 (patch)
tree97c42d1bcd553b2ef14e5b2494b4f303585e09b1 /fs/btrfs/compression.h
parent1881fba89bd5dcd364d2e1bf561912a90a11c21a (diff)
downloadlinux-7c0c7269f7b508ba6e4b063a9314d6bd1fb6db22.tar.xz
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>
Diffstat (limited to 'fs/btrfs/compression.h')
-rw-r--r--fs/btrfs/compression.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/compression.h b/fs/btrfs/compression.h
index 7dbd14caab01..7773953470e3 100644
--- a/fs/btrfs/compression.h
+++ b/fs/btrfs/compression.h
@@ -54,6 +54,9 @@ struct compressed_bio {
/* The compression algorithm for this bio */
u8 compress_type;
+ /* Whether this is a write for writeback. */
+ bool writeback;
+
/* IO errors */
u8 errors;
int mirror_num;
@@ -97,7 +100,8 @@ blk_status_t btrfs_submit_compressed_write(struct btrfs_inode *inode, u64 start,
struct page **compressed_pages,
unsigned int nr_pages,
unsigned int write_flags,
- struct cgroup_subsys_state *blkcg_css);
+ struct cgroup_subsys_state *blkcg_css,
+ bool writeback);
blk_status_t btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
int mirror_num, unsigned long bio_flags);