Lines Matching refs:page

50 struct page *fscrypt_alloc_bounce_page(gfp_t gfp_flags)
56 * fscrypt_free_bounce_page() - free a ciphertext bounce page
57 * @bounce_page: the bounce page to free, or NULL
59 * Free a bounce page that was allocated by fscrypt_encrypt_pagecache_blocks(),
62 void fscrypt_free_bounce_page(struct page *bounce_page)
94 u64 lblk_num, struct page *src_page,
95 struct page *dest_page, unsigned int len,
141 * pagecache page
142 * @page: The locked pagecache page containing the block(s) to encrypt
145 * @offs: Byte offset within @page of the first block to encrypt. Must be
149 * A new bounce page is allocated, and the specified block(s) are encrypted into
150 * it. In the bounce page, the ciphertext block(s) will be located at the same
151 * offsets at which the plaintext block(s) were located in the source page; any
152 * other parts of the bounce page will be left uninitialized. However, normally
153 * blocksize == PAGE_SIZE and the whole page is encrypted at once.
157 * The bounce page allocation is mempool-backed, so it will always succeed when
159 * only the first page of each bio can be allocated this way. To prevent
162 * Return: the new encrypted bounce page on success; an ERR_PTR() on failure
164 struct page *fscrypt_encrypt_pagecache_blocks(struct page *page,
170 const struct inode *inode = page->mapping->host;
173 struct page *ciphertext_page;
174 u64 lblk_num = ((u64)page->index << (PAGE_SHIFT - blockbits)) +
179 if (WARN_ON_ONCE(!PageLocked(page)))
191 page, ciphertext_page,
199 set_page_private(ciphertext_page, (unsigned long)page);
207 * @page: The page containing the block to encrypt
210 * @offs: Byte offset within @page at which the block to encrypt begins
216 * arbitrary page, not necessarily in the original pagecache page. The @inode
217 * and @lblk_num must be specified, as they can't be determined from @page.
221 int fscrypt_encrypt_block_inplace(const struct inode *inode, struct page *page,
225 return fscrypt_crypt_block(inode, FS_ENCRYPT, lblk_num, page, page,
232 * pagecache page
233 * @page: The locked pagecache page containing the block(s) to decrypt
236 * @offs: Byte offset within @page of the first block to decrypt. Must be
239 * The specified block(s) are decrypted in-place within the pagecache page,
241 * PAGE_SIZE and the whole page is decrypted at once.
247 int fscrypt_decrypt_pagecache_blocks(struct page *page, unsigned int len,
250 const struct inode *inode = page->mapping->host;
253 u64 lblk_num = ((u64)page->index << (PAGE_SHIFT - blockbits)) +
258 if (WARN_ON_ONCE(!PageLocked(page)))
265 err = fscrypt_crypt_block(inode, FS_DECRYPT, lblk_num, page,
266 page, blocksize, i, GFP_NOFS);
277 * @page: The page containing the block to decrypt
280 * @offs: Byte offset within @page at which the block to decrypt begins
285 * arbitrary page, not necessarily in the original pagecache page. The @inode
286 * and @lblk_num must be specified, as they can't be determined from @page.
290 int fscrypt_decrypt_block_inplace(const struct inode *inode, struct page *page,
294 return fscrypt_crypt_block(inode, FS_DECRYPT, lblk_num, page, page,
312 /* No need to allocate a bounce page pool if this FS won't use it. */