Lines Matching refs:iter

98 #define __bvec_iter_bvec(bvec, iter)	(&(bvec)[(iter).bi_idx])  argument
101 #define mp_bvec_iter_page(bvec, iter) \ argument
102 (__bvec_iter_bvec((bvec), (iter))->bv_page)
104 #define mp_bvec_iter_len(bvec, iter) \ argument
105 min((iter).bi_size, \
106 __bvec_iter_bvec((bvec), (iter))->bv_len - (iter).bi_bvec_done)
108 #define mp_bvec_iter_offset(bvec, iter) \ argument
109 (__bvec_iter_bvec((bvec), (iter))->bv_offset + (iter).bi_bvec_done)
111 #define mp_bvec_iter_page_idx(bvec, iter) \ argument
112 (mp_bvec_iter_offset((bvec), (iter)) / PAGE_SIZE)
114 #define mp_bvec_iter_bvec(bvec, iter) \ argument
116 .bv_page = mp_bvec_iter_page((bvec), (iter)), \
117 .bv_len = mp_bvec_iter_len((bvec), (iter)), \
118 .bv_offset = mp_bvec_iter_offset((bvec), (iter)), \
122 #define bvec_iter_offset(bvec, iter) \ argument
123 (mp_bvec_iter_offset((bvec), (iter)) % PAGE_SIZE)
125 #define bvec_iter_len(bvec, iter) \ argument
126 min_t(unsigned, mp_bvec_iter_len((bvec), (iter)), \
127 PAGE_SIZE - bvec_iter_offset((bvec), (iter)))
129 #define bvec_iter_page(bvec, iter) \ argument
130 (mp_bvec_iter_page((bvec), (iter)) + \
131 mp_bvec_iter_page_idx((bvec), (iter)))
133 #define bvec_iter_bvec(bvec, iter) \ argument
135 .bv_page = bvec_iter_page((bvec), (iter)), \
136 .bv_len = bvec_iter_len((bvec), (iter)), \
137 .bv_offset = bvec_iter_offset((bvec), (iter)), \
141 struct bvec_iter *iter, unsigned bytes) in bvec_iter_advance() argument
143 unsigned int idx = iter->bi_idx; in bvec_iter_advance()
145 if (WARN_ONCE(bytes > iter->bi_size, in bvec_iter_advance()
147 iter->bi_size = 0; in bvec_iter_advance()
151 iter->bi_size -= bytes; in bvec_iter_advance()
152 bytes += iter->bi_bvec_done; in bvec_iter_advance()
159 iter->bi_idx = idx; in bvec_iter_advance()
160 iter->bi_bvec_done = bytes; in bvec_iter_advance()
169 struct bvec_iter *iter, unsigned int bytes) in bvec_iter_advance_single() argument
171 unsigned int done = iter->bi_bvec_done + bytes; in bvec_iter_advance_single()
173 if (done == bv[iter->bi_idx].bv_len) { in bvec_iter_advance_single()
175 iter->bi_idx++; in bvec_iter_advance_single()
177 iter->bi_bvec_done = done; in bvec_iter_advance_single()
178 iter->bi_size -= bytes; in bvec_iter_advance_single()
181 #define for_each_bvec(bvl, bio_vec, iter, start) \ argument
182 for (iter = (start); \
183 (iter).bi_size && \
184 ((bvl = bvec_iter_bvec((bio_vec), (iter))), 1); \
185 bvec_iter_advance_single((bio_vec), &(iter), (bvl).bv_len))