glock_compare(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… glock_compare β€” the Kernel API Manual, section 9, bestie πŸŽ€

okay so picture this: you're deep in ./fs/gfs2/glock.c and somebody needs to sort a whole pile of glocks. That's literally it. That's the whole job of glock_compare β€” it compares two struct gfs2_glock structures so they can be sorted. No cap, that's the entire assignment and she ate. ✨


✨ NAME ✨

glock_compare β€” compare two struct gfs2_glock structures for sorting πŸ¦‹

Lowkey the most self-explanatory name in the whole kernel and honestly? We love that for her.


🌸 SYNOPSIS 🌸

int glock_compare (const void *arg_a , const void *arg_b );

Look at that signature. const void * twice, because she's flexible like that β€” she'll take any two pointers and do her little comparison thing. Periodt. πŸ’…


🫢 ARGUMENTS 🫢

  • arg_a β€” the first structure πŸ’–
  • arg_b β€” the second structure ⭐

That's it. Two structures. She's not asking for much, she just wants both of them and then she's gonna tell you how they sort. Iconic behavior honestly.


πŸ‘‘ SEE ALSO πŸ‘‘

okay so this is the part where I gotta name-drop the entire friend group, because glock_compare does NOT roll alone. Every single one of these lives in the kernel file ./fs/gfs2/glock.c and you should absolutely go say hi to all forty of them:

Forty entries. Forty!! The way this function has more mutuals than I do 😭 but fr fr, that whole roster is the glock squad and they're all in ./fs/gfs2/glock.c together, living their best lives.

ngl if you're hunting for a function that actually does the sorting instead of just comparing, this page isn't gonna hand it to you β€” but the list above is genuinely where you start looking. No invented tips here, just the actual references, iykyk. πŸ™ˆ

🧚 sign-off 🧚

this page came straight out of ./fs/gfs2, dated October 2026 β€” so yes, bestie, she's serving future-core and she knows it. stay glocked and loaded πŸ’œπŸŒˆπŸ”₯

πŸ“¦ where this page comes from