Lines Matching refs:iter

32 static blk_status_t t10_pi_generate(struct blk_integrity_iter *iter,  in t10_pi_generate()  argument
37 for (i = 0 ; i < iter->data_size ; i += iter->interval) { in t10_pi_generate()
38 struct t10_pi_tuple *pi = iter->prot_buf; in t10_pi_generate()
40 pi->guard_tag = fn(iter->data_buf, iter->interval); in t10_pi_generate()
44 pi->ref_tag = cpu_to_be32(lower_32_bits(iter->seed)); in t10_pi_generate()
48 iter->data_buf += iter->interval; in t10_pi_generate()
49 iter->prot_buf += iter->tuple_size; in t10_pi_generate()
50 iter->seed++; in t10_pi_generate()
56 static blk_status_t t10_pi_verify(struct blk_integrity_iter *iter, in t10_pi_verify() argument
63 for (i = 0 ; i < iter->data_size ; i += iter->interval) { in t10_pi_verify()
64 struct t10_pi_tuple *pi = iter->prot_buf; in t10_pi_verify()
73 lower_32_bits(iter->seed)) { in t10_pi_verify()
75 "(rcvd %u)\n", iter->disk_name, in t10_pi_verify()
77 iter->seed, be32_to_cpu(pi->ref_tag)); in t10_pi_verify()
86 csum = fn(iter->data_buf, iter->interval); in t10_pi_verify()
90 "(rcvd %04x, want %04x)\n", iter->disk_name, in t10_pi_verify()
91 (unsigned long long)iter->seed, in t10_pi_verify()
97 iter->data_buf += iter->interval; in t10_pi_verify()
98 iter->prot_buf += iter->tuple_size; in t10_pi_verify()
99 iter->seed++; in t10_pi_verify()
105 static blk_status_t t10_pi_type1_generate_crc(struct blk_integrity_iter *iter) in t10_pi_type1_generate_crc() argument
107 return t10_pi_generate(iter, t10_pi_crc_fn, T10_PI_TYPE1_PROTECTION); in t10_pi_type1_generate_crc()
110 static blk_status_t t10_pi_type1_generate_ip(struct blk_integrity_iter *iter) in t10_pi_type1_generate_ip() argument
112 return t10_pi_generate(iter, t10_pi_ip_fn, T10_PI_TYPE1_PROTECTION); in t10_pi_type1_generate_ip()
115 static blk_status_t t10_pi_type1_verify_crc(struct blk_integrity_iter *iter) in t10_pi_type1_verify_crc() argument
117 return t10_pi_verify(iter, t10_pi_crc_fn, T10_PI_TYPE1_PROTECTION); in t10_pi_type1_verify_crc()
120 static blk_status_t t10_pi_type1_verify_ip(struct blk_integrity_iter *iter) in t10_pi_type1_verify_ip() argument
122 return t10_pi_verify(iter, t10_pi_ip_fn, T10_PI_TYPE1_PROTECTION); in t10_pi_type1_verify_ip()
145 struct bvec_iter iter; in t10_pi_type1_prepare() local
151 bip_for_each_vec(iv, bip, iter) { in t10_pi_type1_prepare()
195 struct bvec_iter iter; in t10_pi_type1_complete() local
197 bip_for_each_vec(iv, bip, iter) { in t10_pi_type1_complete()
217 static blk_status_t t10_pi_type3_generate_crc(struct blk_integrity_iter *iter) in t10_pi_type3_generate_crc() argument
219 return t10_pi_generate(iter, t10_pi_crc_fn, T10_PI_TYPE3_PROTECTION); in t10_pi_type3_generate_crc()
222 static blk_status_t t10_pi_type3_generate_ip(struct blk_integrity_iter *iter) in t10_pi_type3_generate_ip() argument
224 return t10_pi_generate(iter, t10_pi_ip_fn, T10_PI_TYPE3_PROTECTION); in t10_pi_type3_generate_ip()
227 static blk_status_t t10_pi_type3_verify_crc(struct blk_integrity_iter *iter) in t10_pi_type3_verify_crc() argument
229 return t10_pi_verify(iter, t10_pi_crc_fn, T10_PI_TYPE3_PROTECTION); in t10_pi_type3_verify_crc()
232 static blk_status_t t10_pi_type3_verify_ip(struct blk_integrity_iter *iter) in t10_pi_type3_verify_ip() argument
234 return t10_pi_verify(iter, t10_pi_ip_fn, T10_PI_TYPE3_PROTECTION); in t10_pi_type3_verify_ip()
288 static blk_status_t ext_pi_crc64_generate(struct blk_integrity_iter *iter, in ext_pi_crc64_generate() argument
293 for (i = 0 ; i < iter->data_size ; i += iter->interval) { in ext_pi_crc64_generate()
294 struct crc64_pi_tuple *pi = iter->prot_buf; in ext_pi_crc64_generate()
296 pi->guard_tag = ext_pi_crc64(iter->data_buf, iter->interval); in ext_pi_crc64_generate()
300 put_unaligned_be48(iter->seed, pi->ref_tag); in ext_pi_crc64_generate()
304 iter->data_buf += iter->interval; in ext_pi_crc64_generate()
305 iter->prot_buf += iter->tuple_size; in ext_pi_crc64_generate()
306 iter->seed++; in ext_pi_crc64_generate()
319 static blk_status_t ext_pi_crc64_verify(struct blk_integrity_iter *iter, in ext_pi_crc64_verify() argument
324 for (i = 0; i < iter->data_size; i += iter->interval) { in ext_pi_crc64_verify()
325 struct crc64_pi_tuple *pi = iter->prot_buf; in ext_pi_crc64_verify()
334 seed = lower_48_bits(iter->seed); in ext_pi_crc64_verify()
337 iter->disk_name, seed, ref); in ext_pi_crc64_verify()
346 csum = ext_pi_crc64(iter->data_buf, iter->interval); in ext_pi_crc64_verify()
350 iter->disk_name, (unsigned long long)iter->seed, in ext_pi_crc64_verify()
356 iter->data_buf += iter->interval; in ext_pi_crc64_verify()
357 iter->prot_buf += iter->tuple_size; in ext_pi_crc64_verify()
358 iter->seed++; in ext_pi_crc64_verify()
364 static blk_status_t ext_pi_type1_verify_crc64(struct blk_integrity_iter *iter) in ext_pi_type1_verify_crc64() argument
366 return ext_pi_crc64_verify(iter, T10_PI_TYPE1_PROTECTION); in ext_pi_type1_verify_crc64()
369 static blk_status_t ext_pi_type1_generate_crc64(struct blk_integrity_iter *iter) in ext_pi_type1_generate_crc64() argument
371 return ext_pi_crc64_generate(iter, T10_PI_TYPE1_PROTECTION); in ext_pi_type1_generate_crc64()
384 struct bvec_iter iter; in ext_pi_type1_prepare() local
390 bip_for_each_vec(iv, bip, iter) { in ext_pi_type1_prepare()
423 struct bvec_iter iter; in ext_pi_type1_complete() local
425 bip_for_each_vec(iv, bip, iter) { in ext_pi_type1_complete()
446 static blk_status_t ext_pi_type3_verify_crc64(struct blk_integrity_iter *iter) in ext_pi_type3_verify_crc64() argument
448 return ext_pi_crc64_verify(iter, T10_PI_TYPE3_PROTECTION); in ext_pi_type3_verify_crc64()
451 static blk_status_t ext_pi_type3_generate_crc64(struct blk_integrity_iter *iter) in ext_pi_type3_generate_crc64() argument
453 return ext_pi_crc64_generate(iter, T10_PI_TYPE3_PROTECTION); in ext_pi_type3_generate_crc64()