gfs2_glock_nq_num(9)
π 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 theu64that 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. aconst 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. anunsigned int, and it's literally the mode you want it in, no cap πflagsβ modifier flags for the acquisition. au16, so it's tiny but it's mighty β these are the little tweaks on how you grab it βghβ thestruct 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
- 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