Lines Matching refs:iter

22 static inline int iomap_iter_advance(struct iomap_iter *iter)  in iomap_iter_advance()  argument
24 bool stale = iter->iomap.flags & IOMAP_F_STALE; in iomap_iter_advance()
27 if (iter->iomap.length) { in iomap_iter_advance()
28 if (iter->processed < 0) in iomap_iter_advance()
29 return iter->processed; in iomap_iter_advance()
30 if (!iter->processed && !stale) in iomap_iter_advance()
32 if (WARN_ON_ONCE(iter->processed > iomap_length(iter))) in iomap_iter_advance()
34 iter->pos += iter->processed; in iomap_iter_advance()
35 iter->len -= iter->processed; in iomap_iter_advance()
36 if (!iter->len) in iomap_iter_advance()
41 iter->processed = 0; in iomap_iter_advance()
42 memset(&iter->iomap, 0, sizeof(iter->iomap)); in iomap_iter_advance()
43 memset(&iter->srcmap, 0, sizeof(iter->srcmap)); in iomap_iter_advance()
47 static inline void iomap_iter_done(struct iomap_iter *iter) in iomap_iter_done() argument
49 WARN_ON_ONCE(iter->iomap.offset > iter->pos); in iomap_iter_done()
50 WARN_ON_ONCE(iter->iomap.length == 0); in iomap_iter_done()
51 WARN_ON_ONCE(iter->iomap.offset + iter->iomap.length <= iter->pos); in iomap_iter_done()
52 WARN_ON_ONCE(iter->iomap.flags & IOMAP_F_STALE); in iomap_iter_done()
54 trace_iomap_iter_dstmap(iter->inode, &iter->iomap); in iomap_iter_done()
55 if (iter->srcmap.type != IOMAP_HOLE) in iomap_iter_done()
56 trace_iomap_iter_srcmap(iter->inode, &iter->srcmap); in iomap_iter_done()
74 int iomap_iter(struct iomap_iter *iter, const struct iomap_ops *ops) in iomap_iter() argument
78 if (iter->iomap.length && ops->iomap_end) { in iomap_iter()
79 ret = ops->iomap_end(iter->inode, iter->pos, iomap_length(iter), in iomap_iter()
80 iter->processed > 0 ? iter->processed : 0, in iomap_iter()
81 iter->flags, &iter->iomap); in iomap_iter()
82 if (ret < 0 && !iter->processed) in iomap_iter()
86 trace_iomap_iter(iter, ops, _RET_IP_); in iomap_iter()
87 ret = iomap_iter_advance(iter); in iomap_iter()
91 ret = ops->iomap_begin(iter->inode, iter->pos, iter->len, iter->flags, in iomap_iter()
92 &iter->iomap, &iter->srcmap); in iomap_iter()
95 iomap_iter_done(iter); in iomap_iter()