#define FSCACHE_ADV_SINGLE_CHUNK 0x01 /* The object is a single chunk of data */ #define FSCACHE_ADV_WRITE_CACHE 0x00 /* Do cache if written to locally */ #define FSCACHE_ADV_WRITE_NOCACHE 0x02 /* Don't cache if written to locally */ #define FSCACHE_ADV_WANT_CACHE_SIZE 0x04 /* Retrieve cache size at runtime */
#define FSCACHE_INVAL_DIO_WRITE 0x01 /* Invalidate due to DIO write */
/* *Dataobjectstate.
*/ enum fscache_cookie_state {
FSCACHE_COOKIE_STATE_QUIESCENT, /* The cookie is uncached */
FSCACHE_COOKIE_STATE_LOOKING_UP, /* The cache object is being looked up */
FSCACHE_COOKIE_STATE_CREATING, /* The cache object is being created */
FSCACHE_COOKIE_STATE_ACTIVE, /* The cache is active, readable and writable */
FSCACHE_COOKIE_STATE_INVALIDATING, /* The cache is being invalidated */
FSCACHE_COOKIE_STATE_FAILED, /* The cache failed, withdraw to clear */
FSCACHE_COOKIE_STATE_LRU_DISCARDING, /* The cookie is being discarded by the LRU */
FSCACHE_COOKIE_STATE_WITHDRAWING, /* The cookie is being withdrawn */
FSCACHE_COOKIE_STATE_RELINQUISHING, /* The cookie is being relinquished */
FSCACHE_COOKIE_STATE_DROPPED, /* The cookie has been dropped */ #define FSCACHE_COOKIE_STATE__NR (FSCACHE_COOKIE_STATE_DROPPED + 1)
} __attribute__((mode(byte)));
/* *Volumerepresentationcookie.
*/ struct fscache_volume {
refcount_t ref;
atomic_t n_cookies; /* Number of data cookies in volume */
atomic_t n_accesses; /* Number of cache accesses in progress */ unsignedint debug_id; unsignedint key_hash; /* Hash of key string */
u8 *key; /* Volume ID, eg. "afs@example.com@1234" */ struct list_head proc_link; /* Link in /proc/fs/fscache/volumes */ struct hlist_bl_node hash_link; /* Link in hash table */ struct work_struct work; struct fscache_cache *cache; /* The cache in which this resides */ void *cache_priv; /* Cache private data */
spinlock_t lock; unsignedlong flags; #define FSCACHE_VOLUME_RELINQUISHED 0/* Volume is being cleaned up */ #define FSCACHE_VOLUME_INVALIDATE 1/* Volume was invalidated */ #define FSCACHE_VOLUME_COLLIDED_WITH 2/* Volume was collided with */ #define FSCACHE_VOLUME_ACQUIRE_PENDING 3/* Volume is waiting to complete acquisition */ #define FSCACHE_VOLUME_CREATING 4/* Volume is being created on disk */
u8 coherency_len; /* Length of the coherency data */
u8 coherency[]; /* Coherency data */
};
/* *Datafilerepresentationcookie. *-afilewillonlyappearinonecache *-arequesttocacheafilemayormaynotbehonoured,subjectto *constraintssuchasdiskspace *-indicesarecreatedondiskjust-in-time
*/ struct fscache_cookie {
refcount_t ref;
atomic_t n_active; /* number of active users of cookie */
atomic_t n_accesses; /* Number of cache accesses in progress */ unsignedint debug_id; unsignedint inval_counter; /* Number of invalidations made */
spinlock_t lock; struct fscache_volume *volume; /* Parent volume of this file. */ void *cache_priv; /* Cache-side representation */ struct hlist_bl_node hash_link; /* Link in hash table */ struct list_head proc_link; /* Link in proc list */ struct list_head commit_link; /* Link in commit queue */ struct work_struct work; /* Commit/relinq/withdraw work */
loff_t object_size; /* Size of the netfs object */ unsignedlong unused_at; /* Time at which unused (jiffies) */ unsignedlong flags; #define FSCACHE_COOKIE_RELINQUISHED 0/* T if cookie has been relinquished */ #define FSCACHE_COOKIE_RETIRED 1/* T if this cookie has retired on relinq */ #define FSCACHE_COOKIE_IS_CACHING 2/* T if this cookie is cached */ #define FSCACHE_COOKIE_NO_DATA_TO_READ 3/* T if this cookie has nothing to read */ #define FSCACHE_COOKIE_NEEDS_UPDATE 4/* T if attrs have been updated */ #define FSCACHE_COOKIE_HAS_BEEN_CACHED 5/* T if cookie needs withdraw-on-relinq */ #define FSCACHE_COOKIE_DISABLED 6/* T if cookie has been disabled */ #define FSCACHE_COOKIE_LOCAL_WRITE 7/* T if cookie has been modified locally */ #define FSCACHE_COOKIE_NO_ACCESS_WAKE 8/* T if no wake when n_accesses goes 0 */ #define FSCACHE_COOKIE_DO_RELINQUISH 9/* T if this cookie needs relinquishment */ #define FSCACHE_COOKIE_DO_WITHDRAW 10/* T if this cookie needs withdrawing */ #define FSCACHE_COOKIE_DO_LRU_DISCARD 11/* T if this cookie needs LRU discard */ #define FSCACHE_COOKIE_DO_PREP_TO_WRITE 12/* T if cookie needs write preparation */ #define FSCACHE_COOKIE_HAVE_DATA 13/* T if this cookie has data stored */ #define FSCACHE_COOKIE_IS_HASHED 14/* T if this cookie is hashed */ #define FSCACHE_COOKIE_DO_INVALIDATE 15/* T if cookie needs invalidation */
enum fscache_cookie_state state;
u8 advice; /* FSCACHE_ADV_* */
u8 key_len; /* Length of index key */
u8 aux_len; /* Length of auxiliary data */
u32 key_hash; /* Hash of volume, key, len */ union { void *key; /* Index key */
u8 inline_key[16]; /* - If the key is short enough */
}; union { void *aux; /* Auxiliary data */
u8 inline_aux[8]; /* - If the aux data is short enough */
};
};
/** *fscache_note_page_release-Notethatanetfspagegotreleased *@cookie:Thecookiecorrespondingtothefile * *Notethatapagethathasbeencopiedtothecachehasbeenreleased.This *meansthatfuturereadswillneedtolookinthecachetoseeifit'sthere.
*/ staticinline void fscache_note_page_release(struct fscache_cookie *cookie)
{ /* If we've written data to the cache (HAVE_DATA) and there wasn't any *datainthecachewhenwestarted(NO_DATA_TO_READ),itmayno *longerbetruethatwecanskipreadingfromthecache-soclear *theflagthatcausesreadstobeskipped.
*/ if (cookie &&
test_bit(FSCACHE_COOKIE_HAVE_DATA, &cookie->flags) &&
test_bit(FSCACHE_COOKIE_NO_DATA_TO_READ, &cookie->flags))
clear_bit(FSCACHE_COOKIE_NO_DATA_TO_READ, &cookie->flags);
}
#endif/* _LINUX_FSCACHE_H */
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.27 Sekunden
(vorverarbeitet am 2026-09-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.