#include <errno.h>#include <fcntl.h>#include <string.h>#include <sys/stat.h>#include <unistd.h>#include <atalk/directory.h>#include <atalk/logger.h>#include <atalk/util.h>#include "dircache.h"#include "directory.h"#include "pfd_cache.h"#include "volume.h"Data Structures | |
| struct | pfd_slot |
Macros | |
| #define | PFD_SLOTS 16 |
| #define | PFD_OPEN_FLAGS (O_RDONLY | O_DIRECTORY) |
Functions | |
| static void | pfd_init_once (void) |
| static void | slot_retire (struct pfd_slot *s) |
| static int | slot_fill (struct pfd_slot *s, const struct vol *vol, const struct dir *parent) |
| static void | slot_move_to_front (int i) |
| static int | pfd_get (const struct vol *vol, const struct dir *parent) |
| static void | pfd_repair_path (struct dir *entry, const struct dir *parent) |
| int | pfd_ostat (const struct vol *vol, struct dir *entry, struct stat *st, int options) |
| ostat(cfrombstr(entry->d_fullpath), st, options), accelerated. | |
| void | pfd_purge (uint16_t vid, cnid_t did) |
| void | pfd_purge_vol (uint16_t vid) |
| void | pfd_shutdown (void) |
| void | pfd_stats_get (struct pfd_stats *out) |
| void | pfd_log_stats (void) |
Variables | |
| static struct pfd_slot | pfd_slots [PFD_SLOTS] |
| static int | pfd_initialized |
| static struct pfd_stats | pfd_stat |
| #define PFD_OPEN_FLAGS (O_RDONLY | O_DIRECTORY) |
| #define PFD_SLOTS 16 |
|
static |
| void pfd_log_stats | ( | void | ) |
ostat(cfrombstr(entry->d_fullpath), st, options), accelerated.
Resolves entry's parent to a cached dir fd and fstatat()s the leaf name; any impediment (no parent entry, ghost parent, open failure) falls back to the full-path ostat internally. Callers cannot observe which path ran: return value and errno are exactly what ostat would produce.
On success the entry's d_fullpath is additionally repaired against the parent's — the relative stat can outlive a rename the path string hasn't caught up with (see pfd_repair_path).
| void pfd_purge | ( | uint16_t | vid, |
| cnid_t | did ) |
| void pfd_purge_vol | ( | uint16_t | vid | ) |
| void pfd_shutdown | ( | void | ) |
| void pfd_stats_get | ( | struct pfd_stats * | out | ) |
|
static |
|
static |
|
static |
|
static |