netatalk  4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
ad_cache.h
Go to the documentation of this file.
1#ifndef AD_CACHE_H
2#define AD_CACHE_H
3
4#include <stdbool.h>
5#include <sys/stat.h>
6
7#include <atalk/adouble.h>
8#include <atalk/directory.h>
9#include <atalk/volume.h>
10
11extern void ad_store_to_cache(struct adouble *adp, struct dir *cached);
12extern void ad_rebuild_from_cache(struct adouble *adp,
13 const struct dir *cached);
14extern int ad_metadata_cached(const char *name, int flags, struct adouble *adp,
15 const struct vol *vol, struct dir *dir,
16 bool strict, struct stat *recent_st);
17
18/* AD cache statistics — defined in ad_cache.c, logged by dircache.c */
19extern unsigned long long ad_cache_hits;
20extern unsigned long long ad_cache_misses;
21extern unsigned long long ad_cache_no_ad;
22
23/* Tier 2: Resource Fork data cache helpers — defined in ad_cache.c */
24extern int rfork_cache_store_from_fd(struct dir *entry,
25 struct adouble *adp, int eid);
26extern void rfork_cache_free(struct dir *entry);
27extern void rfork_cache_evict_to_budget(size_t needed);
28
29#endif /* AD_CACHE_H */
unsigned long long ad_cache_hits
Definition ad_cache.c:39
unsigned long long ad_cache_no_ad
Definition ad_cache.c:41
unsigned long long ad_cache_misses
Definition ad_cache.c:40
int rfork_cache_store_from_fd(struct dir *entry, struct adouble *adp, int eid)
Store resource fork data by reading directly from the ad fd.
Definition ad_cache.c:368
void rfork_cache_free(struct dir *entry)
Free a single entry's rfork buffer, remove from rfork LRU, update counter.
Definition ad_cache.c:274
void ad_store_to_cache(struct adouble *adp, struct dir *cached)
Store AD metadata results into struct dir cache fields.
Definition ad_cache.c:55
void rfork_cache_evict_to_budget(size_t needed)
Evict rfork buffers from rfork LRU head (oldest/LRU) until under budget.
Definition ad_cache.c:339
int ad_metadata_cached(const char *name, int flags, struct adouble *adp, const struct vol *vol, struct dir *dir, bool strict, struct stat *recent_st)
Unified AD metadata access with integrated cache management.
Definition ad_cache.c:142
void ad_rebuild_from_cache(struct adouble *adp, const struct dir *cached)
Populate struct adouble from struct dir cache fields.
Definition ad_cache.c:98
Part of Netatalk's AppleDouble implementatation.
static dbd_flags_t flags
Definition cmd_dbd.c:43
Definition adouble.h:191
Definition include/atalk/directory.h:56
Definition ad_open.c:95
Definition include/atalk/volume.h:33