netfs_perform_write(9)
π netfs_perform_write β like, the Kernel API Manual girlies know π
okay so bestie, today's main character is netfs_perform_write(9) from the Kernel API Manual, and she is literally out here copying data into the pagecache. no cap. let's get into it π«Ά
β¨ NAME β¨
netfs_perform_write β copy data into the pagecache. that's it, that's the vibe π
πΈ SYNOPSIS πΈ
ssize_t netfs_perform_write (struct kiocb *iocb , struct iov_iter *iter
, struct netfs_group *netfs_group );
look at her. three args. iconic behavior only π
π¦ ARGUMENTS π¦
iocbβ the operation parameters, aka the whole entire vibe of the write. she's the blueprint β¨iterβ the source buffer. this is where the data is actually coming from, bestie πnetfs_groupβ the grouping for dirty folios (eg. ceph snaps). yes she groups. she organizes. she's that girl π
π₯ DESCRIPTION π₯
So what does she do? She copies data into pagecache folios attached to the inode specified by iocb. Simple. Clean. Gorgeous. π
β οΈ But listen β the caller must hold appropriate inode locks. Do not skip this. This is not a suggestion, this is a requirement, and she WILL know if you skipped it π
Now for the lore π§ Dirty folios get tagged with a netfs_folio struct if they're not up to date β that tag is there to indicate the range modified. Like a little sticky note saying "hey, this part changed" π
Dirty folios may also be tagged with a netfs-specific grouping, such that data from an old group gets flushed before a new one is started. old group out, new group in. slay πβ¨
π SEE ALSO π
- Kernel file
./fs/netfs/buffered_write.c netfs_buffered_write_iter_locked(9)netfs_file_write_iter(9)
go read those too, bestie, you won't regret it π
and that's the whole page, fr fr π«Ά this little gem lives in ./fs/netfs, dated October 2026, and she goes by netfs_perform_write(9) β mwah, no notes, periodt ππΈ
π¦ 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