Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\bio.c Create Date:2022-07-28 16:55:00
Last Modify:2020-03-17 23:13:58 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:_truncate - truncate the bio to small size of @new_size*@bio: the bio to be truncated*@new_size: new size for truncating the bio* Description:* Truncate the bio to new size of @new_size. If bio_op(bio) is* REQ_OP_READ, zero the truncated part

Proto:void bio_truncate(struct bio *bio, unsigned new_size)

Type:void

Parameter:

TypeParameterName
struct bio *bio
unsignednew_size
555  done = 0
556  bool truncated = false
558  If new_size >= residual I/O count Then Return
561  If bio_op(bio) != REQ_OP_READ Then Go to exit
564  bio_for_each_segment(bv, bio, iter)
565  If done + bv_len > new_size Then
568  If Not truncated Then offset = new_size - done
570  Else offset = 0
573  truncated = true
575  done += bv_len
578  exit :
587  residual I/O count = new_size