gfs2_glock_get(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– gfs2_glock_get β€” the Kernel API Manual, bestie edition ✨

Okay so picture this: you're deep in the GFS2 filesystem code and you need a glock. Not the kind you're thinking of πŸ”« β€” the kernel kind. This little function right here? It's your girl. She finds you a glock, or she makes you one if there isn't one already. Iconic behaviour, honestly. πŸ‘‘


🌸 SYNOPSIS 🌸

int gfs2_glock_get (struct gfs2_sbd *sdp , u64 number , const struct
gfs2_glock_operations *glops , int create , struct gfs2_glock **glp );

Like, five whole arguments. She's a little extra but she delivers. πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • sdp β€” The GFS2 superblock. The main character of the whole situation, ngl.
  • number β€” the lock number. That's how she knows which glock we're talking about πŸ¦‹
  • glops β€” The glock_operations to use. The vibe/personality packet for this glock, fr fr.
  • create β€” If 0, don't create the glock if it doesn't exist. Like, if she's not there, she's not there. We move on. πŸ™ˆ
  • glp β€” the glock is returned here. This is the part where you actually get her 🫢

✨ DESCRIPTION ✨

Read this next bit carefully bestie, because it matters:

This does not lock a glock. It just finds/creates structures for one.

That's it. That's the whole assignment. She's doing structure admin, not the actual locking. Don't @ me, that's literally what the manpage says. πŸ’€


πŸ’œ RETURN πŸ’œ

errno β€” yes that's the entire return section. She's brief, she's mysterious, she ate and left no crumbs.


🌈 SEE ALSO 🌈

Literally the entire glock extended universe, no cap. Strap in:

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_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), 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 I said. The whole friend group. Go read all of them, iykyk. πŸ“šβœ¨


Also ./fs/gfs2 is where she lives, in case you were wondering. Home sweet home. 🏑

And that's a wrap on gfs2_glock_get(9)! πŸŽ€ This cutie comes to you from ./fs/gfs2, dated October 2026 β€” mwah, go get your glock bestie πŸ’‹πŸ¦‹πŸ’–

πŸ“¦ where this page comes from