[RFC PATCH 15/19] btrfs: allow writing compressed, encrypted, inline extents
From: Mark Harmstone
Date: Tue Jan 08 2019 - 20:28:23 EST
Signed-off-by: Mark Harmstone <mark@xxxxxxxxxxxxx>
---
fs/btrfs/inode.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 61481833f5e4..f8bc7174f7e3 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -219,6 +219,22 @@ static int insert_inline_extent(struct btrfs_trans_handle *trans,
if (compress_type != BTRFS_COMPRESS_NONE) {
struct page *cpage;
int i = 0;
+
+ if (enc_key) {
+ struct btrfs_file_extent_inline_enc *eienc;
+
+ eienc = (struct btrfs_file_extent_inline_enc *)ptr;
+
+ btrfs_set_file_extent_inline_enc_key_number(leaf,
+ eienc, enc_key->key_number);
+
+ write_eb_member(leaf, eienc,
+ struct btrfs_file_extent_inline_enc,
+ iv, iv);
+
+ ptr += sizeof(struct btrfs_file_extent_inline_enc);
+ }
+
while (compressed_size > 0) {
cpage = compressed_pages[i];
cur_size = min_t(unsigned long, compressed_size,
--
2.19.2