inode_query_iversion(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 the i_version from, 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:


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