Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\crypto\crypto.c Create Date:2022-07-28 20:23:31
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:scrypt_encrypt_pagecache_blocks() - Encrypt filesystem blocks from a pagecache page*@page: The locked pagecache page containing the block(s) to encrypt*@len: Total size of the block(s) to encrypt. Must be a nonzero* multiple of the filesystem's block size.

Proto:struct page *fscrypt_encrypt_pagecache_blocks(struct page *page, unsigned int len, unsigned int offs, gfp_t gfp_flags)

Type:struct page

Parameter:

TypeParameterName
struct page *page
unsigned intlen
unsigned intoffs
gfp_tgfp_flags
161  inode = host
162  blockbits = i_blkbits
163  blocksize = 1 << blockbits
165  lblk_num = ( Our offset within mapping. << PAGE_SHIFT determines the page size - blockbits ) + (offs >> blockbits)
170  If WARN_ON_ONCE(!PageLocked(page)) Then Return ERR_PTR( - EINVAL)
173  If WARN_ON_ONCE(len <= 0 || !IS_ALIGNED(len | offs, blocksize)) Then Return ERR_PTR( - EINVAL)
176  ciphertext_page = fscrypt_alloc_bounce_page(gfp_flags)
177  If Not ciphertext_page Then Return ERR_PTR( - ENOMEM)
180  When i < offs + len cycle
181  err = Encrypt or decrypt a single filesystem block of file contents
184  If err Then
186  Return ERR_PTR(err)
189  Private page markings that may be used by the filesystem that owns the page* for its own purposes.* - PG_private and PG_private_2 cause releasepage() and co to be invoked
190  set_page_private(ciphertext_page, (unsignedlong)page)
191  Return ciphertext_page