inode_query_iversion(9)
π inode_query_iversion(9) π
okay so bestie, welcome to the Kernel API Manual β today's main character is inode_query_iversion, and honestly? she's giving "quietly essential" and we're obsessed. β¨
πΈ NAME πΈ
inode_query_iversion β read i_version for later use π«Ά
β¨ SYNOPSIS β¨
u64 inode_query_iversion (struct inode *inode );
π ARGUMENTS π
inodeβ the inode you're pulling thei_versionfrom, no cap π
π¦ DESCRIPTION π¦
So here's the vibe: you read the inode's i_version counter. That's it. That's the function. π
This is the one you want if you're a caller who's planning to store the returned i_version so you can compare against it later. Because that's the whole point, bestie β this guarantees that if you query the i_version again later, you'll get a different value if literally anything has changed. Fr fr, that's the promise. π
Now into the implementation, because it's lowkey iconic: we fetch the current value, set the QUERIED flag, and then try to swap it into place with a cmpxchg β but only if it wasn't already set. If that swap fails? No stress, we just try again with the newly fetched value from the cmpxchg. Retry era. π₯
π SEE ALSO π
Under the Kernel file ./fs/libfs.c, we've got the whole friend group:
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_write_end(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)simple_inode_init_ts(9)path_from_stashed(9)simple_start_creating(9)
and that's the page, bestie π§π sign-off time: this one lives over in ./fs, dated October 2026, and it's inode_query_iversion(9) β 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