STRUCT IOMAP_ITER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct iomap_iter ✨

okay so this is a page from the Kernel API Manual and it's literally about iterating through a range of a file, bestie. struct city, population: you. let's get into it πŸ’…


🌸 NAME 🌸

struct iomap_iter β€” iterate through a range of a file


πŸ¦‹ SYNOPSIS πŸ¦‹

struct iomap_iter {
    struct inode *inode;
    loff_t pos;
    u64 len;
    loff_t iter_start_pos;
    int status;
    unsigned flags;
    struct iomap iomap;
    struct iomap srcmap;
    struct folio_batch *fbatch;
    void *private;
 };

like, look at her. ten whole members. main character energy fr fr πŸ‘‘


πŸ’– Members πŸ’–

  • inode β€” set at the start of the iteration and it should not change. hands off, no cap. 🫢
  • pos β€” the current file position we're operating on. it gets updated by calls to iomap_iter, so treat it as read-only inside the body. it's giving "look but don't touch" ✨
  • len β€” the remaining length of the file segment we're operating on. it updates at the exact same time as pos, they're matching, they're coordinated, we love a synchronized duo πŸŽ€
  • iter_start_pos β€” the original start pos for the current iomap. used for incremental iter advance. the origin story, the beginning of the era πŸ¦‹
  • status β€” status of the most recent iteration. zero on success, or a negative errno on error. so basically zero = slay, negative errno = 😭
  • flags β€” zero or more of the iomap_begin flags above. (yes, "above" β€” they live earlier in this manual, go look πŸ‘€)
  • iomap β€” map describing the I/O iteration πŸ’«
  • srcmap β€” source map for COW operations πŸ„
  • fbatch β€” okay so the page literally doesn't describe this one, and I'm not out here making stuff up, so: it's in the struct, it's a struct folio_batch *, that's what we know πŸ™ˆ
  • private β€” same situation bestie, it's a void * and the manpage doesn't say a word about it. mysterious. lowkey iconic of it πŸ’€

⭐ SEE ALSO ⭐

all the related lore, from the kernel file ./include/linux/iomap.h:

go read them, iykyk πŸ’œ


ngl this one's short but she ate. every member accounted for, nothing skipped, we keep the details and the vibe 🌈

okay that's the whole page!! sourced straight from ./include/linux, dated October 2026, and it's the struct iomap_iter(9) page of the Kernel API Manual β€” mwah, go iterate something, bestie πŸ’…πŸ’–πŸŽ€

πŸ“¦ where this page comes from