summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2024-10-25 21:08:19 +0200
committerChristian Brauner <brauner@kernel.org>2024-11-05 17:20:00 +0100
commitbf64913dfe623d6325329e42fb621b3f358ce40e (patch)
tree9f9226c9154a655b8af2bba37ec0a60943ae3ac1
parentecryptfs: Convert ecryptfs_decrypt_page() to take a folio (diff)
downloadlinux-bf64913dfe623d6325329e42fb621b3f358ce40e.tar.xz
linux-bf64913dfe623d6325329e42fb621b3f358ce40e.zip
ecryptfs: Convert lower_offset_for_page() to take a folio
Both callers have a folio, so pass it in and use folio->index instead of page->index. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Link: https://lore.kernel.org/r/20241025190822.1319162-10-willy@infradead.org Signed-off-by: Christian Brauner <brauner@kernel.org>
-rw-r--r--fs/ecryptfs/crypto.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index 90d38da20f5c..bb65a3a5ee9b 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -328,10 +328,10 @@ out:
* Convert an eCryptfs page index into a lower byte offset
*/
static loff_t lower_offset_for_page(struct ecryptfs_crypt_stat *crypt_stat,
- struct page *page)
+ struct folio *folio)
{
return ecryptfs_lower_header_size(crypt_stat) +
- ((loff_t)page->index << PAGE_SHIFT);
+ (loff_t)folio->index * PAGE_SIZE;
}
/**
@@ -440,7 +440,7 @@ int ecryptfs_encrypt_page(struct folio *folio)
}
}
- lower_offset = lower_offset_for_page(crypt_stat, &folio->page);
+ lower_offset = lower_offset_for_page(crypt_stat, folio);
enc_extent_virt = kmap_local_page(enc_extent_page);
rc = ecryptfs_write_lower(ecryptfs_inode, enc_extent_virt, lower_offset,
PAGE_SIZE);
@@ -489,7 +489,7 @@ int ecryptfs_decrypt_page(struct folio *folio)
&(ecryptfs_inode_to_private(ecryptfs_inode)->crypt_stat);
BUG_ON(!(crypt_stat->flags & ECRYPTFS_ENCRYPTED));
- lower_offset = lower_offset_for_page(crypt_stat, &folio->page);
+ lower_offset = lower_offset_for_page(crypt_stat, folio);
page_virt = kmap_local_folio(folio, 0);
rc = ecryptfs_read_lower(page_virt, lower_offset, PAGE_SIZE,
ecryptfs_inode);