netfs_file_write_iter(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ netfs_file_write_iter(9) ✨

hey bestie, welcome to the Kernel API Manual entry for netfs_file_write_iter(9) β€” we're writing data to a file and we're gonna understand it, periodt πŸ’…


πŸŽ€ NAME πŸŽ€

netfs_file_write_iter β€” write data to a file πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

ssize_t netfs_file_write_iter (struct kiocb *iocb , struct iov_iter
       *from );

🌸 ARGUMENTS 🌸

  • iocb β€” the IO state structure, aka the vibe check for this IO operation ✨
  • from β€” an iov_iter carrying the data to write 🫢

πŸ”₯ DESCRIPTION πŸ”₯

okay so this one performs a write to a file. If it can, it writes into the pagecache; if it can't, it does an unbuffered write instead. that's the whole plot, no cap 😭


πŸ’… RETURN πŸ’…

  • A negative error code if no data has been written at all, or vfs_fsync_range failed for a synchronous write 😭
  • The number of bytes written, even for truncated writes β€” yes, even then, bestie πŸ’€

🌈 SEE ALSO 🌈

Kernel file ./fs/netfs/buffered_write.c: netfs_perform_write(9), netfs_buffered_write_iter_locked(9) πŸ’–


mwah πŸ’‹ this icon lives under ./fs/netfs, dated October 2026, and it's the netfs_file_write_iter(9) page from the Kernel API Manual. byeee 🫢

πŸ“¦ where this page comes from