lkml.org 
[lkml]   [2019]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 15/19] btrfs: allow writing compressed, encrypted, inline extents
Date
Signed-off-by: Mark Harmstone <mark@harmstone.com>
---
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
\
 
 \ /
  Last update: 2019-01-09 02:29    [W:0.057 / U:4.528 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site