lc_del(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– lc_del(9) β€” the kernel API manual, bestie edition πŸ’–

okay so you're here for lc_del(9), which lives in the Kernel API Manual (section 9, kernel-land, very main character of it). Let's get into it ✨


🌸 NAME 🌸

lc_del β€” literally just removes an element from the cache. that's the whole gig πŸŽ€


✨ SYNOPSIS ✨

void lc_del (struct lru_cache *lc , struct lc_element *e );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • lc β€” the lru_cache object. the cache in question, the vibe container πŸ’…
  • e β€” the element to remove. the one getting evicted, no cap 🫢

πŸ”₯ DESCRIPTION πŸ”₯

so here's the tea: e must be unused (refcnt == 0). that's a hard requirement, not a suggestion, ngl πŸ™ˆ

what it does, in order:

  • moves e from the "lru" list to the "free" list
  • sets e->enr to LC_FREE

that's it. that's the whole function. iconic efficiency ⭐

⚠️ fr fr remember: e must be unused β€” refcnt == 0. don't come at it with a live element 😭

🌈 SEE ALSO 🌈

kernel file ./lib/lru_cache.c β€” that's where the magic lives πŸ’œ

lc_create(9), lc_destroy(9), lc_reset(9), lc_seq_printf_stats(9), lc_find(9), lc_is_used(9), lc_get(9), lc_get_cumulative(9), lc_try_get(9), lc_committed(9), lc_put(9), lc_element_by_index(9), lc_seq_dump_details(9) β€” the whole friend group, go read them too 🧚


made with love from ./lib, dated October 2026 πŸ’– that's the source/version and date sign-off, bestie β€” go forth and delete responsibly πŸ’…βœ¨

πŸ“¦ where this page comes from