Lines Matching refs:iter
37 static void t10_pi_generate(struct blk_integrity_iter *iter, in t10_pi_generate() argument
43 for (i = 0 ; i < iter->data_size ; i += iter->interval) { in t10_pi_generate()
44 struct t10_pi_tuple *pi = iter->prot_buf + offset; in t10_pi_generate()
46 pi->guard_tag = t10_pi_csum(0, iter->data_buf, iter->interval, in t10_pi_generate()
50 iter->prot_buf, offset, bi->csum_type); in t10_pi_generate()
54 pi->ref_tag = cpu_to_be32(lower_32_bits(iter->seed)); in t10_pi_generate()
58 iter->data_buf += iter->interval; in t10_pi_generate()
59 iter->prot_buf += bi->tuple_size; in t10_pi_generate()
60 iter->seed++; in t10_pi_generate()
64 static blk_status_t t10_pi_verify(struct blk_integrity_iter *iter, in t10_pi_verify() argument
70 for (i = 0 ; i < iter->data_size ; i += iter->interval) { in t10_pi_verify()
71 struct t10_pi_tuple *pi = iter->prot_buf + offset; in t10_pi_verify()
79 lower_32_bits(iter->seed)) { in t10_pi_verify()
81 "(rcvd %u)\n", iter->disk_name, in t10_pi_verify()
83 iter->seed, be32_to_cpu(pi->ref_tag)); in t10_pi_verify()
92 csum = t10_pi_csum(0, iter->data_buf, iter->interval, in t10_pi_verify()
95 csum = t10_pi_csum(csum, iter->prot_buf, offset, in t10_pi_verify()
100 "(rcvd %04x, want %04x)\n", iter->disk_name, in t10_pi_verify()
101 (unsigned long long)iter->seed, in t10_pi_verify()
107 iter->data_buf += iter->interval; in t10_pi_verify()
108 iter->prot_buf += bi->tuple_size; in t10_pi_verify()
109 iter->seed++; in t10_pi_verify()
137 struct bvec_iter iter; in t10_pi_type1_prepare() local
143 bip_for_each_vec(iv, bip, iter) { in t10_pi_type1_prepare()
189 struct bvec_iter iter; in t10_pi_type1_complete() local
191 bip_for_each_vec(iv, bip, iter) { in t10_pi_type1_complete()
216 static void ext_pi_crc64_generate(struct blk_integrity_iter *iter, in ext_pi_crc64_generate() argument
222 for (i = 0 ; i < iter->data_size ; i += iter->interval) { in ext_pi_crc64_generate()
223 struct crc64_pi_tuple *pi = iter->prot_buf + offset; in ext_pi_crc64_generate()
225 pi->guard_tag = ext_pi_crc64(0, iter->data_buf, iter->interval); in ext_pi_crc64_generate()
228 iter->prot_buf, offset); in ext_pi_crc64_generate()
232 put_unaligned_be48(iter->seed, pi->ref_tag); in ext_pi_crc64_generate()
236 iter->data_buf += iter->interval; in ext_pi_crc64_generate()
237 iter->prot_buf += bi->tuple_size; in ext_pi_crc64_generate()
238 iter->seed++; in ext_pi_crc64_generate()
249 static blk_status_t ext_pi_crc64_verify(struct blk_integrity_iter *iter, in ext_pi_crc64_verify() argument
255 for (i = 0; i < iter->data_size; i += iter->interval) { in ext_pi_crc64_verify()
256 struct crc64_pi_tuple *pi = iter->prot_buf + offset; in ext_pi_crc64_verify()
265 seed = lower_48_bits(iter->seed); in ext_pi_crc64_verify()
268 iter->disk_name, seed, ref); in ext_pi_crc64_verify()
277 csum = ext_pi_crc64(0, iter->data_buf, iter->interval); in ext_pi_crc64_verify()
279 csum = ext_pi_crc64(be64_to_cpu(csum), iter->prot_buf, in ext_pi_crc64_verify()
285 iter->disk_name, (unsigned long long)iter->seed, in ext_pi_crc64_verify()
291 iter->data_buf += iter->interval; in ext_pi_crc64_verify()
292 iter->prot_buf += bi->tuple_size; in ext_pi_crc64_verify()
293 iter->seed++; in ext_pi_crc64_verify()
311 struct bvec_iter iter; in ext_pi_type1_prepare() local
317 bip_for_each_vec(iv, bip, iter) { in ext_pi_type1_prepare()
352 struct bvec_iter iter; in ext_pi_type1_complete() local
354 bip_for_each_vec(iv, bip, iter) { in ext_pi_type1_complete()
379 struct blk_integrity_iter iter; in blk_integrity_generate() local
383 iter.disk_name = bio->bi_bdev->bd_disk->disk_name; in blk_integrity_generate()
384 iter.interval = 1 << bi->interval_exp; in blk_integrity_generate()
385 iter.seed = bio->bi_iter.bi_sector; in blk_integrity_generate()
386 iter.prot_buf = bvec_virt(bip->bip_vec); in blk_integrity_generate()
390 iter.data_buf = kaddr; in blk_integrity_generate()
391 iter.data_size = bv.bv_len; in blk_integrity_generate()
394 ext_pi_crc64_generate(&iter, bi); in blk_integrity_generate()
398 t10_pi_generate(&iter, bi); in blk_integrity_generate()
411 struct blk_integrity_iter iter; in blk_integrity_verify() local
419 iter.disk_name = bio->bi_bdev->bd_disk->disk_name; in blk_integrity_verify()
420 iter.interval = 1 << bi->interval_exp; in blk_integrity_verify()
421 iter.seed = bip->bio_iter.bi_sector; in blk_integrity_verify()
422 iter.prot_buf = bvec_virt(bip->bip_vec); in blk_integrity_verify()
427 iter.data_buf = kaddr; in blk_integrity_verify()
428 iter.data_size = bv.bv_len; in blk_integrity_verify()
431 ret = ext_pi_crc64_verify(&iter, bi); in blk_integrity_verify()
435 ret = t10_pi_verify(&iter, bi); in blk_integrity_verify()