cache_data_alloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

okay bestie, this is the cache_data_alloc(9) page from the Kernel API Manual, and it’s here to explain one very specific little allocation moment. πŸ’–

cache_data_alloc β€” Allocate data for a cache key. ✨


✨ SYNOPSIS ✨

int cache_data_alloc (struct pcache_cache *cache , struct
       pcache_cache_key *key );

πŸŽ€ ARGUMENTS πŸŽ€

  • cache β€” Pointer to the cache structure. πŸ’…
  • key β€” Pointer to the cache key to allocate data for. 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here’s the vibe: cache_data_alloc(9) tries to allocate space from the cache segment specified by the data head. 🌈

If the remaining space in the segment is insufficient to allocate the requested length for the cache key, it will allocate whatever is available and adjust the key's length accordingly. no cap, it makes it work with what’s there. πŸ’…

⚠️ huge caveat, bestie: this function does not allocate space that crosses segment boundaries. periodt. πŸ›‘

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/md/dm-pcache/cache_req.c β€” go read these too, iykyk:


xoxo, your ./drivers/md/dm-pcache source tree, dated October 2026 πŸŽ€πŸ’–

πŸ“¦ where this page comes from