static int
ecryptfs_decrypt_page_offset(struct ecryptfs_crypt_stat *crypt_stat,
- struct page *dst_page, int dst_offset,
- struct page *src_page, int src_offset, int size,
- unsigned char *iv);
+ struct page *dst_page, struct page *src_page,
+ int offset, int size, unsigned char *iv);
static int
ecryptfs_encrypt_page_offset(struct ecryptfs_crypt_stat *crypt_stat,
- struct page *dst_page, int dst_offset,
- struct page *src_page, int src_offset, int size,
- unsigned char *iv);
+ struct page *dst_page, struct page *src_page,
+ int offset, int size, unsigned char *iv);
/**
* ecryptfs_to_hex
(unsigned long long)(extent_base + extent_offset), rc);
goto out;
}
- rc = ecryptfs_encrypt_page_offset(crypt_stat, enc_extent_page,
- extent_offset * crypt_stat->extent_size,
- page,
+ rc = ecryptfs_encrypt_page_offset(crypt_stat, enc_extent_page, page,
extent_offset * crypt_stat->extent_size,
crypt_stat->extent_size, extent_iv);
if (rc < 0) {
(unsigned long long)(extent_base + extent_offset), rc);
goto out;
}
- rc = ecryptfs_decrypt_page_offset(crypt_stat, page,
- extent_offset * crypt_stat->extent_size,
- enc_extent_page,
+ rc = ecryptfs_decrypt_page_offset(crypt_stat, page, enc_extent_page,
extent_offset * crypt_stat->extent_size,
crypt_stat->extent_size, extent_iv);
if (rc < 0) {
* ecryptfs_encrypt_page_offset
* @crypt_stat: The cryptographic context
* @dst_page: The page to encrypt into
- * @dst_offset: The offset in the page to encrypt into
* @src_page: The page to encrypt from
- * @src_offset: The offset in the page to encrypt from
+ * @offset: The byte offset into the dst_page and src_page
* @size: The number of bytes to encrypt
* @iv: The initialization vector to use for the encryption
*
*/
static int
ecryptfs_encrypt_page_offset(struct ecryptfs_crypt_stat *crypt_stat,
- struct page *dst_page, int dst_offset,
- struct page *src_page, int src_offset, int size,
- unsigned char *iv)
+ struct page *dst_page, struct page *src_page,
+ int offset, int size, unsigned char *iv)
{
struct scatterlist src_sg, dst_sg;
sg_init_table(&src_sg, 1);
sg_init_table(&dst_sg, 1);
- sg_set_page(&src_sg, src_page, size, src_offset);
- sg_set_page(&dst_sg, dst_page, size, dst_offset);
+ sg_set_page(&src_sg, src_page, size, offset);
+ sg_set_page(&dst_sg, dst_page, size, offset);
return encrypt_scatterlist(crypt_stat, &dst_sg, &src_sg, size, iv);
}
* ecryptfs_decrypt_page_offset
* @crypt_stat: The cryptographic context
* @dst_page: The page to decrypt into
- * @dst_offset: The offset in the page to decrypt into
* @src_page: The page to decrypt from
- * @src_offset: The offset in the page to decrypt from
+ * @offset: The byte offset into the dst_page and src_page
* @size: The number of bytes to decrypt
* @iv: The initialization vector to use for the decryption
*
*/
static int
ecryptfs_decrypt_page_offset(struct ecryptfs_crypt_stat *crypt_stat,
- struct page *dst_page, int dst_offset,
- struct page *src_page, int src_offset, int size,
- unsigned char *iv)
+ struct page *dst_page, struct page *src_page,
+ int offset, int size, unsigned char *iv)
{
struct scatterlist src_sg, dst_sg;
sg_init_table(&src_sg, 1);
- sg_set_page(&src_sg, src_page, size, src_offset);
+ sg_set_page(&src_sg, src_page, size, offset);
sg_init_table(&dst_sg, 1);
- sg_set_page(&dst_sg, dst_page, size, dst_offset);
+ sg_set_page(&dst_sg, dst_page, size, offset);
return decrypt_scatterlist(crypt_stat, &dst_sg, &src_sg, size, iv);
}