@@ -95,7 +95,7 @@ static void strip_xattr_flag(char *page_virt,
95
95
96
96
/**
97
97
* ecryptfs_copy_up_encrypted_with_header
98
- * @page : Sort of a ``virtual'' representation of the encrypted lower
98
+ * @folio : Sort of a ``virtual'' representation of the encrypted lower
99
99
* file. The actual lower file does not have the metadata in
100
100
* the header. This is locked.
101
101
* @crypt_stat: The eCryptfs inode's cryptographic context
@@ -104,7 +104,7 @@ static void strip_xattr_flag(char *page_virt,
104
104
* seeing, with the header information inserted.
105
105
*/
106
106
static int
107
- ecryptfs_copy_up_encrypted_with_header (struct page * page ,
107
+ ecryptfs_copy_up_encrypted_with_header (struct folio * folio ,
108
108
struct ecryptfs_crypt_stat * crypt_stat )
109
109
{
110
110
loff_t extent_num_in_page = 0 ;
@@ -113,31 +113,31 @@ ecryptfs_copy_up_encrypted_with_header(struct page *page,
113
113
int rc = 0 ;
114
114
115
115
while (extent_num_in_page < num_extents_per_page ) {
116
- loff_t view_extent_num = (((( loff_t )page -> index )
116
+ loff_t view_extent_num = ((loff_t )folio -> index
117
117
* num_extents_per_page )
118
- + extent_num_in_page ) ;
118
+ + extent_num_in_page ;
119
119
size_t num_header_extents_at_front =
120
120
(crypt_stat -> metadata_size / crypt_stat -> extent_size );
121
121
122
122
if (view_extent_num < num_header_extents_at_front ) {
123
123
/* This is a header extent */
124
124
char * page_virt ;
125
125
126
- page_virt = kmap_local_page ( page );
126
+ page_virt = kmap_local_folio ( folio , 0 );
127
127
memset (page_virt , 0 , PAGE_SIZE );
128
128
/* TODO: Support more than one header extent */
129
129
if (view_extent_num == 0 ) {
130
130
size_t written ;
131
131
132
132
rc = ecryptfs_read_xattr_region (
133
- page_virt , page -> mapping -> host );
133
+ page_virt , folio -> mapping -> host );
134
134
strip_xattr_flag (page_virt + 16 , crypt_stat );
135
135
ecryptfs_write_header_metadata (page_virt + 20 ,
136
136
crypt_stat ,
137
137
& written );
138
138
}
139
139
kunmap_local (page_virt );
140
- flush_dcache_page ( page );
140
+ flush_dcache_folio ( folio );
141
141
if (rc ) {
142
142
printk (KERN_ERR "%s: Error reading xattr "
143
143
"region; rc = [%d]\n" , __func__ , rc );
@@ -150,9 +150,9 @@ ecryptfs_copy_up_encrypted_with_header(struct page *page,
150
150
- crypt_stat -> metadata_size );
151
151
152
152
rc = ecryptfs_read_lower_page_segment (
153
- page , (lower_offset >> PAGE_SHIFT ),
153
+ & folio -> page , (lower_offset >> PAGE_SHIFT ),
154
154
(lower_offset & ~PAGE_MASK ),
155
- crypt_stat -> extent_size , page -> mapping -> host );
155
+ crypt_stat -> extent_size , folio -> mapping -> host );
156
156
if (rc ) {
157
157
printk (KERN_ERR "%s: Error attempting to read "
158
158
"extent at offset [%lld] in the lower "
@@ -189,8 +189,8 @@ static int ecryptfs_read_folio(struct file *file, struct folio *folio)
189
189
inode );
190
190
} else if (crypt_stat -> flags & ECRYPTFS_VIEW_AS_ENCRYPTED ) {
191
191
if (crypt_stat -> flags & ECRYPTFS_METADATA_IN_XATTR ) {
192
- err = ecryptfs_copy_up_encrypted_with_header (& folio -> page ,
193
- crypt_stat );
192
+ err = ecryptfs_copy_up_encrypted_with_header (folio ,
193
+ crypt_stat );
194
194
if (err ) {
195
195
printk (KERN_ERR "%s: Error attempting to copy "
196
196
"the encrypted content from the lower "
@@ -291,7 +291,7 @@ static int ecryptfs_write_begin(struct file *file,
291
291
} else if (crypt_stat -> flags & ECRYPTFS_VIEW_AS_ENCRYPTED ) {
292
292
if (crypt_stat -> flags & ECRYPTFS_METADATA_IN_XATTR ) {
293
293
rc = ecryptfs_copy_up_encrypted_with_header (
294
- & folio -> page , crypt_stat );
294
+ folio , crypt_stat );
295
295
if (rc ) {
296
296
printk (KERN_ERR "%s: Error attempting "
297
297
"to copy the encrypted content "
0 commit comments