@@ -41,30 +41,29 @@ int ecryptfs_write_lower(struct inode *ecryptfs_inode, char *data,
41
41
/**
42
42
* ecryptfs_write_lower_page_segment
43
43
* @ecryptfs_inode: The eCryptfs inode
44
- * @page_for_lower : The page containing the data to be written to the
44
+ * @folio_for_lower : The folio containing the data to be written to the
45
45
* lower file
46
- * @offset_in_page: The offset in the @page_for_lower from which to
46
+ * @offset_in_page: The offset in the @folio_for_lower from which to
47
47
* start writing the data
48
- * @size: The amount of data from @page_for_lower to write to the
48
+ * @size: The amount of data from @folio_for_lower to write to the
49
49
* lower file
50
50
*
51
51
* Determines the byte offset in the file for the given page and
52
52
* offset within the page, maps the page, and makes the call to write
53
- * the contents of @page_for_lower to the lower inode.
53
+ * the contents of @folio_for_lower to the lower inode.
54
54
*
55
55
* Returns zero on success; non-zero otherwise
56
56
*/
57
57
int ecryptfs_write_lower_page_segment (struct inode * ecryptfs_inode ,
58
- struct page * page_for_lower ,
58
+ struct folio * folio_for_lower ,
59
59
size_t offset_in_page , size_t size )
60
60
{
61
61
char * virt ;
62
62
loff_t offset ;
63
63
int rc ;
64
64
65
- offset = ((((loff_t )page_for_lower -> index ) << PAGE_SHIFT )
66
- + offset_in_page );
67
- virt = kmap_local_page (page_for_lower );
65
+ offset = (loff_t )folio_for_lower -> index * PAGE_SIZE + offset_in_page ;
66
+ virt = kmap_local_folio (folio_for_lower , 0 );
68
67
rc = ecryptfs_write_lower (ecryptfs_inode , virt , offset , size );
69
68
if (rc > 0 )
70
69
rc = 0 ;
@@ -172,7 +171,7 @@ int ecryptfs_write(struct inode *ecryptfs_inode, char *data, loff_t offset,
172
171
rc = ecryptfs_encrypt_page (& ecryptfs_folio -> page );
173
172
else
174
173
rc = ecryptfs_write_lower_page_segment (ecryptfs_inode ,
175
- & ecryptfs_folio -> page ,
174
+ ecryptfs_folio ,
176
175
start_offset_in_page ,
177
176
data_offset );
178
177
folio_put (ecryptfs_folio );
0 commit comments