STRUCT NETLBL_LSM_CACHE(9)
π 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 avoid *, 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 π
- Kernel file
./include/net/netlabel.hstructnetlbl_lsm_secattr(9) struct netlbl_calipso_ops(9)netlbl_secattr_cache_alloc(9)netlbl_secattr_cache_free(9)netlbl_catmap_alloc(9)netlbl_catmap_free(9)netlbl_secattr_init(9)netlbl_secattr_destroy(9)netlbl_secattr_alloc(9)netlbl_secattr_free(9)
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
- 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