ceph_cls_lock(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ceph_cls_lock(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so this is page ceph_cls_lock(9) from the Kernel API Manual, and it's literally about grabbing a rados lock for an object. yes bestie, we're doing kernel locking today, put your hair up πŸ’–


✨ NAME ✨

ceph_cls_lock β€” grab rados lock for object πŸ”’


✨ SYNOPSIS ✨

int ceph_cls_lock (struct ceph_osd_client *osdc , struct ceph_object_id
*oid , struct ceph_object_locator *oloc , char *lock_name , u8 type ,
char *cookie , char *tag , char *desc , u8 flags );

it returns an int, and the way that this signature is LONG β€” nine whole parameters, she's highkey doing the most 😭 but we love her for it 🫢


✨ ARGUMENTS ✨

  • osdc β€” the OSD client instance, aka your main character struct πŸ’…
  • oid β€” the object you wanna lock πŸ‘‘
  • oloc β€” the object you wanna lock (yes, same description as oid, no bestie I'm not messing with you, that's literally what it says πŸ™ˆ)
  • lock_name β€” the name of the lock, give her a name, she deserves one πŸŽ€
  • type β€” the lock type, and it's either CEPH_CLS_LOCK_EXCLUSIVE or CEPH_CLS_LOCK_SHARED β€” pick one, queen 🌈
  • cookie β€” a user-defined identifier for this instance of the lock πŸ“
  • tag β€” a user-defined tag, remember this one, she comes back in the description πŸ‘€
  • desc β€” a user-defined lock description ✨
  • flags β€” lock flags, that's it, that's the vibe πŸ¦‹

✨ DESCRIPTION ✨

okay so here's the one (1) actual rule and it's important, no cap:

all operations on the same lock should use the same <italic>tag</italic> πŸ’€

like literally, if you're touching the same lock from different places, keep the tag consistent. consistency is iconic, inconsistency is giving chaos 😭


✨ SEE ALSO ✨

  • the Kernel file ./net/ceph/cls_lock_client.c β€” that's where the real lore lives πŸ“–
  • ceph_cls_unlock(9) β€” for when you're done holding the lock, let her go πŸ•ŠοΈ
  • ceph_cls_break_lock(9) β€” for when you gotta be dramatic about it πŸ’…

that's the whole page bestie, short and sweet, hope you slayed ✨

mwah πŸ’– β€” this has been ./net/ceph, October 2026, from the Kernel API Manual. catch you in the next ceph_cls_lock(9), ily 🫢

πŸ“¦ where this page comes from