diff options
Diffstat (limited to 'fs/ecryptfs/mmap.c')
-rw-r--r-- | fs/ecryptfs/mmap.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c index df4ce99d0597..5a30e01547f1 100644 --- a/fs/ecryptfs/mmap.c +++ b/fs/ecryptfs/mmap.c | |||
@@ -97,19 +97,6 @@ out: | |||
97 | * (big-endian) | 97 | * (big-endian) |
98 | * Octet 26: Begin RFC 2440 authentication token packet set | 98 | * Octet 26: Begin RFC 2440 authentication token packet set |
99 | */ | 99 | */ |
100 | static void set_header_info(char *page_virt, | ||
101 | struct ecryptfs_crypt_stat *crypt_stat) | ||
102 | { | ||
103 | size_t written; | ||
104 | size_t save_num_header_bytes_at_front = | ||
105 | crypt_stat->num_header_bytes_at_front; | ||
106 | |||
107 | crypt_stat->num_header_bytes_at_front = | ||
108 | ECRYPTFS_MINIMUM_HEADER_EXTENT_SIZE; | ||
109 | ecryptfs_write_header_metadata(page_virt + 20, crypt_stat, &written); | ||
110 | crypt_stat->num_header_bytes_at_front = | ||
111 | save_num_header_bytes_at_front; | ||
112 | } | ||
113 | 100 | ||
114 | /** | 101 | /** |
115 | * ecryptfs_copy_up_encrypted_with_header | 102 | * ecryptfs_copy_up_encrypted_with_header |
@@ -146,9 +133,13 @@ ecryptfs_copy_up_encrypted_with_header(struct page *page, | |||
146 | memset(page_virt, 0, PAGE_CACHE_SIZE); | 133 | memset(page_virt, 0, PAGE_CACHE_SIZE); |
147 | /* TODO: Support more than one header extent */ | 134 | /* TODO: Support more than one header extent */ |
148 | if (view_extent_num == 0) { | 135 | if (view_extent_num == 0) { |
136 | size_t written; | ||
137 | |||
149 | rc = ecryptfs_read_xattr_region( | 138 | rc = ecryptfs_read_xattr_region( |
150 | page_virt, page->mapping->host); | 139 | page_virt, page->mapping->host); |
151 | set_header_info(page_virt, crypt_stat); | 140 | ecryptfs_write_header_metadata(page_virt + 20, |
141 | crypt_stat, | ||
142 | &written); | ||
152 | } | 143 | } |
153 | kunmap_atomic(page_virt, KM_USER0); | 144 | kunmap_atomic(page_virt, KM_USER0); |
154 | flush_dcache_page(page); | 145 | flush_dcache_page(page); |