nq_m_sync(9)
π nq_m_sync(9) β from the Kernel API Manual, bestie β¨
Okay so imagine you need multiple glocks at once and you're like "pls don't deadlock on me π₯Ί" β that's literally this function. It's the synchronous, deadlock-free-order glock-hauling queen of the GFS2 kernel API. π
β¨ NAME β¨
nq_m_sync β synchronously acquire more than one glock in deadlock free order π«Ά
πΈ SYNOPSIS πΈ
int nq_m_sync (unsigned int num_gh , struct gfs2_holder *ghs , struct
gfs2_holder **p );
π ARGUMENTS π
num_ghβ the number of structures π (yes, the count, she counts)ghsβ an array ofstruct gfs2_holderstructures β¨pβ placeholder for the holder structure to pass back π
π RETURN π
0on success β i.e. all glocks acquired, slay πerrnoon failure β and no cap, no glocks acquired π (all-or-nothing energy fr fr)
π¦ SEE ALSO π¦
Kernel file ./fs/gfs2/glock.c β that's where the magic lives, go read it πβ¨
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)gfs2_glock_nq_num(9)glock_compare(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)
Reminder bestie: the whole point is the deadlock free order part β that's the main character energy of this function, don't sleep on it πβ¨
Okay that's the whole page, mwah π«Ά β brought to you by the fine folks at ./fs/gfs2, dated October 2026, and the page itself is nq_m_sync(9) in case you forgot already (no judgement, it's a lot of glocks) ππ
π¦ 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