27#define MIN_DIRCACHE_SIZE 1024
28#define MAX_DIRCACHE_SIZE 1048576
29#define DIRCACHE_FREE_QUANTUM 256
32#define DEFERRED_CHAIN_BATCH 16
35#define DIRCACHE (1 << 0)
36#define DIDNAME_INDEX (1 << 1)
37#define QUEUE_INDEX (1 << 2)
38#define DIRCACHE_NOSHRINK (1 << 3)
39#define DIRCACHE_ALL (DIRCACHE|DIDNAME_INDEX|QUEUE_INDEX)
50 const struct dir *
dir,
char *name,
size_t len);
uint32_t cnid_t
Definition adouble.h:157
struct dir * dircache_search_by_name(const struct vol *vol, const struct dir *dir, char *name, size_t len)
Search the cache via did/name hashtable.
Definition dircache.c:1585
void dircache_flush_deferred_for_vol(uint16_t vid)
Process deferred cleanup entries for a closing volume synchronously.
Definition dircache.c:3170
void dircache_purge_vol(const struct vol *vol)
Release every cache entry belonging to a closing volume.
Definition dircache.c:492
struct dir * dircache_search_by_did(const struct vol *vol, cnid_t cnid)
Search the dircache via a CNID for a directory.
Definition dircache.c:1437
unsigned long long rfork_stat_evicted
Definition dircache.c:232
int dircache_process_deferred_chain(void)
Process one unit of deferred cleanup.
Definition dircache.c:3581
void dircache_dump(void)
Dump dircache to /tmp/dircache.PID.
Definition dircache.c:2617
int dircache_remove_children(const struct vol *vol, struct dir *dir)
Remove all child entries of a directory from the dircache.
Definition dircache.c:2051
int dircache_init(int reqsize)
Initialize the dircache and indexes.
Definition dircache.c:2274
struct dir * dircache_lookup_parent(const struct vol *vol, cnid_t did)
Plain index probe for pfd_cache parent resolution.
Definition dircache.c:1393
size_t rfork_cache_budget
Definition dircache.c:243
unsigned int dircache_resolve_size(int reqsize)
Resolve a requested dircache size to the effective maximum.
Definition dircache.c:2230
void dircache_rfork_shutdown(void)
Shutdown the rfork cache — free remaining RFork LRU nodes and sentinel.
Definition dircache.c:2592
size_t rfork_max_entry_size
Definition dircache.c:245
unsigned long long rfork_stat_added
Definition dircache.c:231
void log_dircache_stat(void)
Log dircache statistics.
Definition dircache.c:2375
int dircache_add(const struct vol *vol, struct dir *dir)
create struct dir from struct path
Definition dircache.c:1743
unsigned int rfork_lru_count
Definition dircache.c:247
size_t rfork_stat_used_max
Definition dircache.c:234
unsigned long long rfork_stat_hits
Definition dircache.c:229
unsigned long long rfork_stat_misses
Definition dircache.c:230
void dircache_remove(const struct vol *vol, struct dir *dir, int flags)
Remove an entry from the dircache.
Definition dircache.c:1909
unsigned long long rfork_stat_lookups
Definition dircache.c:228
int dircache_has_deferred_work(void)
Definition dircache.c:3236
q_t * rfork_lru
Definition dircache.c:249
size_t rfork_cache_used
Definition dircache.c:241
void dircache_remove_children_defer(const struct vol *vol, struct dir *dir)
Enqueue a deferred dircache_remove_children operation.
Definition dircache.c:3086
void dircache_reset_validation_counter(void)
Reset validation counter for consistent testing.
Definition dircache.c:2831
qnode_t * arc_ghost_trim_candidate(q_t *q, const struct dir *skip)
Pick the ghost to release from a list at capacity.
Definition dircache.c:571
void process_cache_hints(AFPObj *obj)
Process cross-process dircache invalidation hints.
Definition dircache.c:2862
void dircache_promote(struct dir *dir)
Promote a cache entry to signal recency.
Definition dircache.c:2189
void dircache_report_invalid_entry(struct dir *dir)
Report that a cache entry was invalid when actually used.
Definition dircache.c:3064
unsigned long long rfork_stat_invalidated
Definition dircache.c:233
int dircache_reindex_didname(const struct vol *vol, struct dir *dir)
Re-insert entry into DID/name index after key change.
Definition dircache.c:2141
cnid_t did
Definition nad_cp.c:92
#define flag(x)
Definition netacnv.c:15
qnode_t q_t
Definition queue.h:32
Definition include/atalk/directory.h:72
Definition include/atalk/volume.h:33