netfs_extract_user_iter(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… netfs_extract_user_iter πŸ’…

okay so bestie, welcome to the netfs_extract_user_iter page from the Kernel API Manual β€” yes it's a real function, yes it's lowercase-and-underscores core, and yes we're gonna get through it together 🫢


✨ NAME ✨

netfs_extract_user_iter β€” literally extracts the pages out of a user iterator and drops them into a bvec. that's it, that's the whole vibe πŸŽ€


🌸 SYNOPSIS 🌸

ssize_t netfs_extract_user_iter (struct iov_iter *orig , size_t orig_len
, struct iov_iter *new , iov_iter_extraction_t extraction_flags );

note the return type bestie: ssize_t. it's giving "i might hand you a count or i might hand you a problem" πŸ’€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • orig β€” the original iterator. the source material, the main character, where we're pulling from πŸ‘‘
  • orig_len β€” how much of that iterator we're copying. like how many slices of cake, and yes there will be a math check πŸ“
  • new β€” the iterator that's gonna get set up. it's a fresh empty vessel and we're filling it ✨
  • extraction_flags β€” flags to qualify the request, i.e. the little extras you can sprinkle on top πŸ’…

🌈 DESCRIPTION 🌈

so here's the tea: we take the page fragments from the given amount of the source iterator and we build up a second iterator that refers to all of those bits. basically the new iterator gets custody of all the fragments, which means the original iterator can be disposed of β€” free to go, no strings attached, we love a clean handoff 🧚

extraction_flags can have ITER_ALLOW_P2PDMA set to request that peer-to-peer DMA be allowed on the pages extracted. periodt πŸ”₯

on success, the number of elements in the bvec is returned, and the original iterator will have been advanced by the amount extracted. so it's not just copying, it's actually moving itself forward, very glow-up of it ⭐

πŸ’– important bestie: use the iov_iter_extract_mode function to query how cleanup should be performed. do not freestyle the cleanup, i'm begging 😭

πŸ‘€ SEE ALSO πŸ‘€

  • Kernel file ./fs/netfs/iterator.c β€” go read it, iykyk πŸ“–

anyway that's the whole page, no cap. source lives at ./fs/netfs, dated October 2026, titled netfs_extract_user_iter(9) β€” mwah, slay, go forth and extract those pages πŸ’œπŸŽ€πŸ’…

πŸ“¦ where this page comes from