Skip to content

Commit dcd04ea

Browse files
Kassey Librauner
authored andcommitted
iomap: Add processed for iomap_iter
processed: The number of bytes processed by the body in the most recent iteration, or a negative errno. 0 causes the iteration to stop. The processed is useful to check when the loop breaks. Signed-off-by: Kassey Li <quic_yingangl@quicinc.com> Link: https://lore.kernel.org/r/20240219021138.3481763-1-quic_yingangl@quicinc.com Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 54943ab commit dcd04ea

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fs/iomap/trace.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ TRACE_EVENT(iomap_iter,
206206
__field(u64, ino)
207207
__field(loff_t, pos)
208208
__field(u64, length)
209+
__field(s64, processed)
209210
__field(unsigned int, flags)
210211
__field(const void *, ops)
211212
__field(unsigned long, caller)
@@ -215,15 +216,17 @@ TRACE_EVENT(iomap_iter,
215216
__entry->ino = iter->inode->i_ino;
216217
__entry->pos = iter->pos;
217218
__entry->length = iomap_length(iter);
219+
__entry->processed = iter->processed;
218220
__entry->flags = iter->flags;
219221
__entry->ops = ops;
220222
__entry->caller = caller;
221223
),
222-
TP_printk("dev %d:%d ino 0x%llx pos 0x%llx length 0x%llx flags %s (0x%x) ops %ps caller %pS",
224+
TP_printk("dev %d:%d ino 0x%llx pos 0x%llx length 0x%llx processed %lld flags %s (0x%x) ops %ps caller %pS",
223225
MAJOR(__entry->dev), MINOR(__entry->dev),
224226
__entry->ino,
225227
__entry->pos,
226228
__entry->length,
229+
__entry->processed,
227230
__print_flags(__entry->flags, "|", IOMAP_FLAGS_STRINGS),
228231
__entry->flags,
229232
__entry->ops,

0 commit comments

Comments
 (0)