Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:fscrypt_zeroout_range

Proto:int fscrypt_zeroout_range(const struct inode *inode, unsigned long lblk, sector_t pblk, unsigned int len)

Type:int

Parameter:

TypeParameterName
const struct inode *inode
unsigned longlblk
sector_tpblk
unsigned intlen
47  blockbits = i_blkbits
48  blocksize = 1 << blockbits
51  err = 0
53  ciphertext_page = fscrypt_alloc_bounce_page(GFP_NOWAIT)
54  If Not ciphertext_page Then Return -ENOMEM
57  When len-- cycle
58  err = Encrypt or decrypt a single filesystem block of file contents
61  If err Then Go to errout
64  bio = bio_alloc(GFP_NOWAIT, 1)
65  If Not bio Then
66  err = -ENOMEM
67  Go to errout
69  bio_set_dev(bio, s_bdev)
70  device address in 512 byte sectors = pblk << blockbits - 9
71  bsolete, don't use in new code
72  ret = bio_add_page(bio, ciphertext_page, blocksize, 0)
73  If WARN_ON(ret != blocksize) Then
75  bio_put(bio)
76  err = -EIO
77  Go to errout
79  err = submit_bio_wait(bio)
80  If err == 0 && bi_status Then err = -EIO
82  bio_put(bio)
83  If err Then Go to errout
85  lblk++
86  pblk++
88  err = 0
89  errout :
90  scrypt_free_bounce_page() - free a ciphertext bounce page* Free a bounce page that was allocated by fscrypt_encrypt_pagecache_blocks(),* or by fscrypt_alloc_bounce_page() directly.
91  Return err