fill_mg_cmtime(9)
π fill_mg_cmtime(9) β the kernel API manual, bestie edition π
okay so this is a page from the Kernel API Manual, and it's literally called fill_mg_cmtime(9). yes the (9) is part of the name, it's a section thing, iykyk. let's get into it β¨
πΈ NAME πΈ
fill_mg_cmtime β fill in the mtime and ctime and flag ctime as QUERIED
like, that's the whole job. it fills stuff in and it flags stuff. iconic honestly π
π¦ SYNOPSIS π¦
void fill_mg_cmtime (struct kstat *stat , u32 request_mask , struct
inode *inode );
three args, returns nothing (void), it's giving "i do the work and i don't ask for credit" energy fr fr π
β¨ ARGUMENTS β¨
statβ where to store the resulting values π«Ά this is the output spot, the little home where the answers gorequest_maskβ theSTATX_*values that were requested, so, like, what actually got asked forinodeβ the inode from which to grab the c/mtime πΈ this is the source, the main character we're pulling from
π DESCRIPTION π
so given an inode, you grab the ctime and mtime out of it and store the result in stat. simple. slay. no cap.
when fetching the value, flag it as QUERIED (if it isn't already) so that the next write will record a distinct timestamp. that's the whole trick bestie, it's so the next write doesn't blend in with this one π
NB: the QUERIED flag is tracked in the ctime, but we set it there even if only the mtime was requested β because that, like, ensures that the next mtime change will be distinct. yes it's a little unhinged to stash the mtime's bookkeeping in the ctime but it works and we love her for it π
π₯ SEE ALSO π₯
- Kernel file
./fs/stat.c generic_fillattr(9)generic_fill_statx_attr(9)generic_fill_statx_atomic_writes(9)vfs_getattr_nosec(9)vfs_fstat(9)vfs_statx(9)sys_statx(9)
go read those too, they're all in the same friend group π§
and that's the page!! this one shipped out of the ./fs source, dated October 2026, and it's still called fill_mg_cmtime(9) if you need to cite her π bye bestie, go fill some timestamps π¦
π¦ 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