Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\bio-integrity.c Create Date:2022-07-28 18:02:11
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:_integrity_alloc - Allocate integrity payload and attach it to bio*@bio: bio to attach integrity metadata to*@gfp_mask: Memory allocation mask*@nr_vecs: Number of integrity metadata scatter-gather elements* Description: This function prepares a bio for

Proto:struct bio_integrity_payload *bio_integrity_alloc(struct bio *bio, gfp_t gfp_mask, unsigned int nr_vecs)

Type:struct bio_integrity_payload

Parameter:

TypeParameterName
struct bio *bio
gfp_tgfp_mask
unsigned intnr_vecs
42  bs = bi_pool
45  If Not bs || Not mempool_initialized( & bio_integrity_pool) Then
46  bip = Allocation memory
47  inline_vecs = nr_vecs
48  Else
49  bip = mempool_alloc - allocate an element from a specific memory pool*@pool: pointer to the memory pool which was allocated via* mempool_create().*@gfp_mask: the usual allocation bitmask.* this function only sleeps if the alloc_fn() function sleeps or
50  inline_vecs = BIP_INLINE_VECS
53  If Value for the false possibility is greater at compile time(!bip) Then Return ERR_PTR( - ENOMEM)
56  memset(bip, 0, size of bip )
58  If nr_vecs > inline_vecs Then
59  idx = 0
61  bip_vec = bvec_alloc(gfp_mask, nr_vecs, & idx, & bvec_integrity_pool)
63  If Not bip_vec Then Go to err
65  grity bio_vec slots = bvec_nr_vecs(idx)
66  slab the bip came from = idx
67  Else
68  bip_vec = mbedded bvec array
69  grity bio_vec slots = inline_vecs
72  parent bio = bio
73  data integrity = bip
74  bottom bits req flags, * top bits REQ_OP. Use * accessors. |= REQ_INTEGRITY
76  Return bip
77  err :
78  mempool_free - return an element to the pool.*@element: pool element pointer.*@pool: pointer to the memory pool which was allocated via* mempool_create().* this function only sleeps if the free_fn() function sleeps.
79  Return ERR_PTR( - ENOMEM)
Caller
NameDescribe
bio_integrity_prep_integrity_prep - Prepare bio for integrity I/O*@bio: bio to prepare* Description: Checks if the bio already has an integrity payload attached.* If it does, the payload has been generated by another kernel subsystem,* and we just pass it through
bio_integrity_clone_integrity_clone - Callback for cloning bios with integrity metadata*@bio: New bio*@bio_src: Original bio*@gfp_mask: Memory allocation mask* Description: Called to allocate a bip when cloning a bio