may_grant(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… may_grant β€” kernel API manual, bestie edition ✨

okay so this is may_grant from the gfs2 glock corner of the kernel, and yes we're getting into it 🫢


🌸 NAME 🌸

may_grant β€” check if it's ok to grant a new lock πŸ”₯


✨ SYNOPSIS ✨

bool may_grant (struct gfs2_glock *gl , struct gfs2_holder *current_gh ,
struct gfs2_holder *gh );

like, it returns a bool, it takes three things, that's the whole vibe πŸ’–


πŸŽ€ ARGUMENTS πŸŽ€

  • gl β€” The glock πŸ‘‘ this is the main character of the whole situation ngl
  • current_gh β€” One of the current holders of gl 🫢 literally just one of them, we'll get to why any of them works
  • gh β€” The lock request which we wish to grant πŸ™ˆ the new kid asking to sit with us

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜• with our current compatibility rules, if a glock has one or more active holders (that's the HIF_HOLDER flag being set, iykyk), any of those holders can be passed in as current_gh. literally any of them. they are all the same as far as compatibility with the new gh goes πŸ’€ like it does not matter which one you hand over, the answer comes out identical.

Returns true if it's ok to grant the lock ✨ that's it, that's the whole function, and honestly? iconic.


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./fs/gfs2/glock.c, plus the whole extended friend group:


and that's the page bestie πŸŽ€ brought to you from ./fs/gfs2, dated October 2026, and it's still called may_grant(9) because we don't do name changes around here πŸ’œ slay 🌈

πŸ“¦ where this page comes from