netfs_extract_user_iter(9)
π 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms