Lines Matching refs:iter
10 static inline int iomap_iter_advance(struct iomap_iter *iter) in iomap_iter_advance() argument
13 if (iter->iomap.length) { in iomap_iter_advance()
14 if (iter->processed <= 0) in iomap_iter_advance()
15 return iter->processed; in iomap_iter_advance()
16 if (WARN_ON_ONCE(iter->processed > iomap_length(iter))) in iomap_iter_advance()
18 iter->pos += iter->processed; in iomap_iter_advance()
19 iter->len -= iter->processed; in iomap_iter_advance()
20 if (!iter->len) in iomap_iter_advance()
25 iter->processed = 0; in iomap_iter_advance()
26 memset(&iter->iomap, 0, sizeof(iter->iomap)); in iomap_iter_advance()
27 memset(&iter->srcmap, 0, sizeof(iter->srcmap)); in iomap_iter_advance()
31 static inline void iomap_iter_done(struct iomap_iter *iter) in iomap_iter_done() argument
33 WARN_ON_ONCE(iter->iomap.offset > iter->pos); in iomap_iter_done()
34 WARN_ON_ONCE(iter->iomap.length == 0); in iomap_iter_done()
35 WARN_ON_ONCE(iter->iomap.offset + iter->iomap.length <= iter->pos); in iomap_iter_done()
37 trace_iomap_iter_dstmap(iter->inode, &iter->iomap); in iomap_iter_done()
38 if (iter->srcmap.type != IOMAP_HOLE) in iomap_iter_done()
39 trace_iomap_iter_srcmap(iter->inode, &iter->srcmap); in iomap_iter_done()
57 int iomap_iter(struct iomap_iter *iter, const struct iomap_ops *ops) in iomap_iter() argument
61 if (iter->iomap.length && ops->iomap_end) { in iomap_iter()
62 ret = ops->iomap_end(iter->inode, iter->pos, iomap_length(iter), in iomap_iter()
63 iter->processed > 0 ? iter->processed : 0, in iomap_iter()
64 iter->flags, &iter->iomap); in iomap_iter()
65 if (ret < 0 && !iter->processed) in iomap_iter()
69 trace_iomap_iter(iter, ops, _RET_IP_); in iomap_iter()
70 ret = iomap_iter_advance(iter); in iomap_iter()
74 ret = ops->iomap_begin(iter->inode, iter->pos, iter->len, iter->flags, in iomap_iter()
75 &iter->iomap, &iter->srcmap); in iomap_iter()
78 iomap_iter_done(iter); in iomap_iter()