fscache_begin_volume_access(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

fscache_begin_volume_access(9) β€” Kernel API Manual energy ✨

okay so bestie, this is the Kernel API Manual page for fscache_begin_volume_access β€” and yes, I’m folding the manual name right into the intro because copying a header line is not the move πŸ’…. This one is literally about pinning a cache so a volume can be accessed, and it’s giving kernel-internals main character energy πŸ”₯.


πŸ’– NAME πŸ’–

fscache_begin_volume_access β€” pin a cache so a volume can be accessed πŸŽ€


✨ SYNOPSIS ✨

the signature, verbatim, no edits, no cap:

bool fscache_begin_volume_access (struct fscache_volume *volume , struct
       fscache_cookie *cookie , enum fscache_access_trace why );

πŸŽ€ ARGUMENTS πŸŽ€

  • volume β€” the volume cookie πŸͺ
  • cookie β€” a datafile cookie for a tracing reference, or NULL 🫢
  • why β€” an indication of the circumstances of the access, for tracing πŸ”

πŸ¦‹ DESCRIPTION πŸ¦‹

It tries to pin the cache so it won’t go away whilst we’re accessing a volume, and it returns true if successful. Here’s the whole flow, bestie:

  1. If the cache tests as not live (state is not FSCACHE_CACHE_IS_ACTIVE), then we return false to indicate access was not permitted. no access for you πŸ™ˆ
  2. If the cache tests as live, then we increment the volume’s n_accesses count and then recheck the cache liveness, ending the access if it ceased to be live.
  3. When we end the access, we decrement the volume’s n_accesses and wake up any waiters if it reaches 0.
  4. Whilst the cache is caching, the volume’s n_accesses is kept artificially incremented to prevent wakeups from happening.
  5. When the cache is taken offline, the state is changed to prevent new accesses, the volume’s n_accesses is decremented and we wait for it to become 0.

The datafile cookie and the why indicator are merely provided for tracing purposes. that’s it, that’s the tea β˜•.


🌈 SEE ALSO 🌈

Kernel file ./fs/netfs/fscache_volume.c β€” yes, that exact path, bestie β€” plus fscache_end_volume_access(9) and fscache_withdraw_volume(9) πŸ’œ


and that’s the whole page 🫢 β€” source/version ./fs/netfs, date October 2026, and the title is fscache_begin_volume_access(9). slay, bye πŸ’…βœ¨

πŸ“¦ where this page comes from