Lines Matching refs:bip

26 				 struct bio_integrity_payload *bip)  in __bio_integrity_free()  argument
29 if (bip->bip_vec) in __bio_integrity_free()
30 bvec_free(&bs->bvec_integrity_pool, bip->bip_vec, in __bio_integrity_free()
31 bip->bip_max_vcnt); in __bio_integrity_free()
32 mempool_free(bip, &bs->bio_integrity_pool); in __bio_integrity_free()
34 kfree(bip); in __bio_integrity_free()
52 struct bio_integrity_payload *bip; in bio_integrity_alloc() local
60 bip = kmalloc(struct_size(bip, bip_inline_vecs, nr_vecs), gfp_mask); in bio_integrity_alloc()
63 bip = mempool_alloc(&bs->bio_integrity_pool, gfp_mask); in bio_integrity_alloc()
67 if (unlikely(!bip)) in bio_integrity_alloc()
70 memset(bip, 0, sizeof(*bip)); in bio_integrity_alloc()
73 bip->bip_max_vcnt = nr_vecs; in bio_integrity_alloc()
74 bip->bip_vec = bvec_alloc(&bs->bvec_integrity_pool, in bio_integrity_alloc()
75 &bip->bip_max_vcnt, gfp_mask); in bio_integrity_alloc()
76 if (!bip->bip_vec) in bio_integrity_alloc()
79 bip->bip_vec = bip->bip_inline_vecs; in bio_integrity_alloc()
80 bip->bip_max_vcnt = inline_vecs; in bio_integrity_alloc()
83 bip->bip_bio = bio; in bio_integrity_alloc()
84 bio->bi_integrity = bip; in bio_integrity_alloc()
87 return bip; in bio_integrity_alloc()
89 __bio_integrity_free(bs, bip); in bio_integrity_alloc()
103 struct bio_integrity_payload *bip = bio_integrity(bio); in bio_integrity_free() local
106 if (bip->bip_flags & BIP_BLOCK_INTEGRITY) in bio_integrity_free()
107 kfree(bvec_virt(bip->bip_vec)); in bio_integrity_free()
109 __bio_integrity_free(bs, bip); in bio_integrity_free()
126 struct bio_integrity_payload *bip = bio_integrity(bio); in bio_integrity_add_page() local
129 if (bip->bip_vcnt >= bip->bip_max_vcnt) { in bio_integrity_add_page()
134 iv = bip->bip_vec + bip->bip_vcnt; in bio_integrity_add_page()
136 if (bip->bip_vcnt && in bio_integrity_add_page()
138 &bip->bip_vec[bip->bip_vcnt - 1], offset)) in bio_integrity_add_page()
144 bip->bip_vcnt++; in bio_integrity_add_page()
163 struct bio_integrity_payload *bip = bio_integrity(bio); in bio_integrity_process() local
169 iter.prot_buf = bvec_virt(bip->bip_vec); in bio_integrity_process()
200 struct bio_integrity_payload *bip; in bio_integrity_prep() local
247 bip = bio_integrity_alloc(bio, GFP_NOIO, nr_pages); in bio_integrity_prep()
248 if (IS_ERR(bip)) { in bio_integrity_prep()
255 bip->bip_flags |= BIP_BLOCK_INTEGRITY; in bio_integrity_prep()
256 bip->bip_iter.bi_size = len; in bio_integrity_prep()
257 bip_set_seed(bip, bio->bi_iter.bi_sector); in bio_integrity_prep()
260 bip->bip_flags |= BIP_IP_CHECKSUM; in bio_integrity_prep()
296 bip->bio_iter = bio->bi_iter; in bio_integrity_prep()
318 struct bio_integrity_payload *bip = in bio_integrity_verify_fn() local
320 struct bio *bio = bip->bip_bio; in bio_integrity_verify_fn()
328 bio->bi_status = bio_integrity_process(bio, &bip->bio_iter, in bio_integrity_verify_fn()
348 struct bio_integrity_payload *bip = bio_integrity(bio); in __bio_integrity_endio() local
351 (bip->bip_flags & BIP_BLOCK_INTEGRITY) && bi->profile->verify_fn) { in __bio_integrity_endio()
352 INIT_WORK(&bip->bip_work, bio_integrity_verify_fn); in __bio_integrity_endio()
353 queue_work(kintegrityd_wq, &bip->bip_work); in __bio_integrity_endio()
372 struct bio_integrity_payload *bip = bio_integrity(bio); in bio_integrity_advance() local
376 bip->bip_iter.bi_sector += bytes_done >> 9; in bio_integrity_advance()
377 bvec_iter_advance(bip->bip_vec, &bip->bip_iter, bytes); in bio_integrity_advance()
388 struct bio_integrity_payload *bip = bio_integrity(bio); in bio_integrity_trim() local
391 bip->bip_iter.bi_size = bio_integrity_bytes(bi, bio_sectors(bio)); in bio_integrity_trim()
407 struct bio_integrity_payload *bip; in bio_integrity_clone() local
411 bip = bio_integrity_alloc(bio, gfp_mask, bip_src->bip_vcnt); in bio_integrity_clone()
412 if (IS_ERR(bip)) in bio_integrity_clone()
413 return PTR_ERR(bip); in bio_integrity_clone()
415 memcpy(bip->bip_vec, bip_src->bip_vec, in bio_integrity_clone()
418 bip->bip_vcnt = bip_src->bip_vcnt; in bio_integrity_clone()
419 bip->bip_iter = bip_src->bip_iter; in bio_integrity_clone()