STRUCT NETLBL_LSM_CACHE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ struct netlbl_lsm_cache(9) πŸŽ€

okay bestie, welcome to the Kernel API Manual β€” this one's a struct page, and it's honestly giving "small but mighty" ✨


✨ NAME ✨

struct netlbl_lsm_cache β€” the NetLabel LSM security attribute cache, aka the little struct that remembers stuff so your LSM doesn't have to keep doing the same math over and over πŸ’…


🌸 SYNOPSIS 🌸

struct netlbl_lsm_cache {
    refcount_t refcount;
    void (*free) (const void *data);
    void *data;
 };

like... look at her. three fields. impeccable. no notes. 🫢


πŸ¦‹ Members πŸ¦‹

  • refcount β€” an atomic reference counter, fr fr. it's counting refs, atomically, the way it should. ⭐
  • free β€” a function pointer that the LSM supplies, and its whole job is to free the cache data. void (*free) (const void *data); β€” yes bestie, you bring your own cleanup. 🧹
  • data β€” the LSM supplied cache data. it's a void *, so it could literally be anything, and honestly? main character energy. 🫢

πŸ’– Description πŸ’–

so this struct exists for LSMs that want to use the NetLabel caching mechanism to stash LSM specific data/attributes in the NetLabel cache. that's it, that's the vibe. ✨

here's the situation where you'd care: if your LSM has to perform, like, a lot of translation from the NetLabel security attributes into its own internal representation, then the cache mechanism can give you a way to eliminate some or all of that translation overhead on a cache hit. 🎯

read that again, bestie: on a cache hit. the whole flex is that hits get cheaper. lowkey iconic. πŸ”₯


πŸ‘‘ SEE ALSO πŸ‘‘

no gatekeeping here, go read all of them, iykyk πŸ’œ


ngl, this page has zero warnings, zero bugs, and zero drama. it's just a chill little struct doing its job. we love a stable queen. 🌈

and that's the whole page, bestie! πŸ“ this came to you from ./include/net in the Kernel API Manual, dated October 2026 β€” struct netlbl_lsm_cache(9), signing off πŸ’…πŸŽ€πŸŒŸ

πŸ“¦ where this page comes from