netatalk 4.4.3
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
dircache.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2010 Frank Lahm <franklahm@gmail.com>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 */
14
15#ifndef DIRCACHE_H
16#define DIRCACHE_H
17
18#include <sys/types.h>
19
20#include <atalk/directory.h>
21#include <atalk/volume.h>
22
23/* Maximum size of the dircache hashtable */
24#define MAX_POSSIBLE_DIRCACHE_SIZE 131072
25#define DIRCACHE_FREE_QUANTUM 256
26
27/* flags for dircache_remove */
28#define DIRCACHE (1 << 0)
29#define DIDNAME_INDEX (1 << 1)
30#define QUEUE_INDEX (1 << 2)
31#define DIRCACHE_ALL (DIRCACHE|DIDNAME_INDEX|QUEUE_INDEX)
32
33 extern int dircache_init(int reqsize);
34 extern int dircache_add(const struct vol *, struct dir *);
35 extern void dircache_remove(const struct vol *, struct dir *, int flag);
36 extern struct dir *dircache_search_by_did(const struct vol *vol, cnid_t did);
37 extern struct dir *dircache_search_by_name(const struct vol *,
38 const struct dir *dir, char *name, size_t len);
39 extern void dircache_dump(void);
40 extern void log_dircache_stat(void);
41 extern int dircache_set_validation_params(unsigned int freq,
42 unsigned int meta_win,
43 unsigned int meta_thresh);
44 extern void dircache_reset_validation_counter(void);
45 extern void dircache_report_invalid_entry(struct dir *dir);
46 extern int dircache_remove_children(const struct vol *vol,
47 struct dir *dir);
48#endif /* DIRCACHE_H */
cnid_t
uint32_t cnid_t
Definition adouble.h:156
dircache_search_by_did
struct dir * dircache_search_by_did(const struct vol *vol, cnid_t did)
Search the dircache via a CNID for a directory.
Definition dircache.c:417
dircache_dump
void dircache_dump(void)
Dump dircache to /tmp/dircache.PID.
Definition dircache.c:971
dircache_remove_children
int dircache_remove_children(const struct vol *vol, struct dir *dir)
Remove all child entries of a directory from the dircache.
Definition dircache.c:749
dircache_init
int dircache_init(int reqsize)
Initialize the dircache and indexes.
Definition dircache.c:868
log_dircache_stat
void log_dircache_stat(void)
Log dircache statistics.
Definition dircache.c:925
dircache_search_by_name
struct dir * dircache_search_by_name(const struct vol *, const struct dir *dir, char *name, size_t len)
Search the cache via did/name hashtable.
Definition dircache.c:522
dircache_reset_validation_counter
void dircache_reset_validation_counter(void)
Reset validation counter for consistent testing.
Definition dircache.c:1101
dircache_remove
void dircache_remove(const struct vol *, struct dir *, int flag)
Remove an entry from the dircache.
Definition dircache.c:683
dircache_set_validation_params
int dircache_set_validation_params(unsigned int freq, unsigned int meta_win, unsigned int meta_thresh)
Set directory cache validation parameters.
Definition dircache.c:1067
dircache_report_invalid_entry
void dircache_report_invalid_entry(struct dir *dir)
Report that a cache entry was invalid when actually used.
Definition dircache.c:1118
dircache_add
int dircache_add(const struct vol *, struct dir *)
create struct dir from struct path
Definition dircache.c:600
directory.h
volume.h
did
cnid_t did
Definition nad_cp.c:93
flag
#define flag(x)
Definition netacnv.c:15
dir
Definition include/atalk/directory.h:55
vol
Definition include/atalk/volume.h:30