MCPcopy Create free account
hub / github.com/F-Stack/f-stack / abd_iterate_func

Function abd_iterate_func

freebsd/contrib/openzfs/module/zfs/abd.c:780–818  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

778}
779
780int
781abd_iterate_func(abd_t *abd, size_t off, size_t size,
782 abd_iter_func_t *func, void *private)
783{
784 struct abd_iter aiter;
785 int ret = 0;
786
787 if (size == 0)
788 return (0);
789
790 abd_verify(abd);
791 ASSERT3U(off + size, <=, abd->abd_size);
792
793 boolean_t abd_multi = abd_is_gang(abd);
794 abd_t *c_abd = abd_init_abd_iter(abd, &aiter, off);
795
796 while (size > 0) {
797 /* If we are at the end of the gang ABD we are done */
798 if (abd_multi && !c_abd)
799 break;
800
801 abd_iter_map(&aiter);
802
803 size_t len = MIN(aiter.iter_mapsize, size);
804 ASSERT3U(len, >, 0);
805
806 ret = func(aiter.iter_mapaddr, len, private);
807
808 abd_iter_unmap(&aiter);
809
810 if (ret != 0)
811 break;
812
813 size -= len;
814 c_abd = abd_advance_abd_iter(abd, c_abd, &aiter, len);
815 }
816
817 return (ret);
818}
819
820struct buf_arg {
821 void *arg_buf;

Callers 15

vdev_raidz_reconstruct_qFunction · 0.85
abd_copy_to_buf_offFunction · 0.85
abd_cmp_buf_offFunction · 0.85
abd_copy_from_buf_offFunction · 0.85
abd_zero_offFunction · 0.85
abd_fletcher_2_nativeFunction · 0.85

Calls 6

abd_verifyFunction · 0.85
abd_is_gangFunction · 0.85
abd_init_abd_iterFunction · 0.85
abd_advance_abd_iterFunction · 0.85
abd_iter_mapFunction · 0.50
abd_iter_unmapFunction · 0.50

Tested by 2

corrupt_columsFunction · 0.68
init_zio_abdFunction · 0.68