gfs2_glock_nq_num(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… gfs2_glock_nq_num(9)

okay bestie, so this one's from the Kernel API Manual β€” it's a kernel-level function, it's giving deep filesystem internals, and honestly? kinda iconic of it. it lives in the GFS2 glock world, and it does exactly one thing: nabs you a glock based on a lock number. let's get into it πŸ’–


✨ NAME ✨

gfs2_glock_nq_num β€” acquire a glock based on lock number

like literally, that's the whole job description. you hand it a number, it goes and gets you the corresponding glock. slay 🫢


🌸 SYNOPSIS 🌸

int gfs2_glock_nq_num (struct gfs2_sbd *sdp , u64 number , const struct
gfs2_glock_operations *glops , unsigned int state , u16 flags , struct
gfs2_holder *gh );

six arguments, returns an int β€” cute, brief, to the point. six params is a lot but we don't judge, we understand πŸ’€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • sdp β€” the filesystem. yes ma'am, the whole filesystem handle. it's the main character here, respectfully πŸ’…
  • number β€” the lock number. this is the u64 that tells the function which glock you're after. it's giving "reservation number at a very nerdy restaurant" ✨
  • glops β€” the glock operations for the type of glock. a const struct gfs2_glock_operations *, so it's the behavior pack that comes with this flavor of glock πŸŽ€
  • state β€” the state to acquire the glock in. an unsigned int, and it's literally the mode you want it in, no cap 🌈
  • flags β€” modifier flags for the acquisition. a u16, so it's tiny but it's mighty β€” these are the little tweaks on how you grab it ⭐
  • gh β€” the struct gfs2_holder. this is your receipt, bestie. it's how the glock gets held onto 🧚

πŸ”₯ RETURN πŸ”₯

errno β€” that's it, that's the return value. classic kernel move, ngl 🫑


πŸ‘‘ SEE ALSO πŸ‘‘

okay this list is long and honestly it ate. it's the whole glock.c friend group:

Kernel file ./fs/gfs2/glock.c

wake_up_glock(9), gfs2_glock_hold(9), gfs2_glock_put(9), may_grant(9), do_error(9), find_first_holder(9), do_promote(9), find_first_waiter(9), find_last_waiter(9), state_change(9), finish_xmote(9), do_xmote(9), run_queue(9), glock_set_object(9), glock_clear_object(9), gfs2_glock_get(9), __gfs2_holder_init(9), gfs2_holder_reinit(9), gfs2_holder_uninit(9), gfs2_glock_holder_ready(9), gfs2_glock_wait(9), gfs2_glock_async_wait(9), request_demote(9), add_to_queue(9), gfs2_glock_nq(9), gfs2_glock_poll(9), gfs2_glock_dq(9), gfs2_glock_dq_uninit(9), glock_compare(9), nq_m_sync(9), gfs2_glock_nq_m(9), gfs2_glock_dq_m(9), gfs2_should_freeze(9), gfs2_glock_complete(9), glock_hash_walk(9), thaw_glock(9), gfs2_glock_thaw(9), gfs2_wait_glocks(9), dump_holder(9), gfs2_dump_glock(9)

like... forty-ish cross-references. the way this function is connected? main character energy fr fr πŸ’œ


πŸ’– tiny reminder babe: every function above is a real (9) kernel-API reference in ./fs/gfs2/glock.c β€” go read them if you want the full lore, iykyk.

okay that's the whole page!! source is ./fs/gfs2, dated October 2026 β€” so go forth, acquire those glocks responsibly, and remember: errno never lies. mwah πŸ’‹πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from