simple_write_end(9)
π simple_write_end β Kernel API Manual energy, but make it cute
okay so bestie, welcome to simple_write_end(9) from the Kernel API Manual β she's a tiny little helper living in the kernel and she's honestly iconic for how little she does. Let's get into it π«Ά
β¨ NAME β¨
simple_write_end β the .write_end helper for non-block-device FSes. That's it, that's the whole job description, and she slays it π
π¦ SYNOPSIS π¦
int simple_write_end (const struct kiocb *iocb , struct address_space
*mapping , loff_t pos , unsigned len , unsigned copied , struct folio
*folio , void *fsdata );
look at her, seven arguments, absolutely no notes π copy this exactly, do not get creative, this is not the vibe for creative liberties.
π ARGUMENTS π
okay so here's the thing β the man page is so real for this. Most of these just say " which is ditto-mark speak for "same as above", so mapping, pos, len, copied, folio and fsdata are all described as...
iocbβ kernel I/O control block β¨mappingβ"posβ"lenβ"copiedβ"folioβ"fsdataβ"
no cap, that's genuinely what's printed. Six little quotation marks. she said "read the room, you already know" ππ ngl it's giving mysterious main character energy.
π₯ DESCRIPTION π₯
so what does she actually do? simple_write_end does the minimum needed for updating a folio after writing is done. Minimum effort, maximum usefulness β honestly relatable π§
she has the same API signature as the .write_end of the address_space_operations vector, which is the whole point: you can just set her straight onto .write_end for FSes that don't need any other processing. plug and play, no cap π«Ά
a couple of house rules though, bestie:
i_rwsemis assumed to be held exclusively. assumed. as in, that's on you to actually do π- Block based filesystems should use
generic_write_end. not her. she's the non-block-device girlie. periodt.
π NOTE π
okay pay attention, this part matters π
Even though i_size might get updated by this function, mark_inode_dirty is not called. So if you're a filesystem that actually does store data in .write_inode, you need to extend on what's done here with a call to mark_inode_dirty in the case that i_size has changed. she updated the size but she did NOT tell anyone about it, so you have to be the one to spill the tea π
Use *ONLY* with simple_read_folio β the asterisks are doing a lot of heavy lifting there and honestly they earned it. ONLY. π₯
πΈ SEE ALSO πΈ
Kernel file ./fs/libfs.c and her whole group chat of friends β all of them, in order, no one left on read:
simple_offset_init(9),simple_offset_add(9),simple_offset_remove(9)simple_offset_rename(9),simple_offset_rename_exchange(9),simple_offset_destroy(9)offset_dir_llseek(9),offset_readdir(9)simple_rename_timestamp(9)simple_setattr(9)simple_read_from_buffer(9),simple_write_to_buffer(9),memory_read_from_buffer(9)generic_encode_ino32_fh(9),generic_fh_to_dentry(9),generic_fh_to_parent(9)simple_fsync_noflush(9),simple_fsync(9)generic_check_addressable(9)simple_get_link(9)generic_ci_d_compare(9),generic_ci_d_hash(9),generic_ci_match(9)generic_set_sb_d_ops(9)inode_maybe_inc_iversion(9),inode_query_iversion(9)simple_inode_init_ts(9)path_from_stashed(9)simple_start_creating(9)
and that's the whole page, bestie β ty for coming to my ted talk π this lil queen lives in ./fs, the version vibes are October 2026, and she answers to simple_write_end(9) and nothing else. mwah πβ¨
π¦ 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