netatalk  4.4.0dev
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 <[email protected]>
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
33extern int dircache_init(int reqsize);
34extern int dircache_add(const struct vol *, struct dir *);
35extern void dircache_remove(const struct vol *, struct dir *, int flag);
36extern struct dir *dircache_search_by_did(const struct vol *vol, cnid_t did);
37extern struct dir *dircache_search_by_name(const struct vol *,
38 const struct dir *dir, char *name, int len);
39extern void dircache_dump(void);
40extern void log_dircache_stat(void);
41extern int dircache_set_validation_params(unsigned int freq,
42 unsigned int meta_win,
43 unsigned int meta_thresh);
44extern void dircache_reset_validation_counter(void);
45extern void dircache_report_invalid_entry(struct dir *dir);
46extern void dircache_remove_children(const struct vol *vol,
47 struct dir *dir);
48#endif /* DIRCACHE_H */
uint32_t cnid_t
Definition adouble.h:156
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:410
void dircache_dump(void)
Dump dircache to /tmp/dircache.PID.
Definition dircache.c:921
int dircache_init(int reqsize)
Initialize the dircache and indexes.
Definition dircache.c:819
void dircache_remove_children(const struct vol *vol, struct dir *dir)
Remove all child entries of a directory from the dircache.
Definition dircache.c:719
struct dir * dircache_search_by_name(const struct vol *, const struct dir *dir, char *name, int len)
Search the cache via did/name hashtable.
Definition dircache.c:501
void log_dircache_stat(void)
Log dircache statistics.
Definition dircache.c:875
void dircache_reset_validation_counter(void)
Reset validation counter for consistent testing.
Definition dircache.c:1051
void dircache_remove(const struct vol *, struct dir *, int flag)
int dircache_set_validation_params(unsigned int freq, unsigned int meta_win, unsigned int meta_thresh)
Set directory cache validation parameters.
Definition dircache.c:1017
void dircache_report_invalid_entry(struct dir *dir)
Report that a cache entry was invalid when actually used.
Definition dircache.c:1068
int dircache_add(const struct vol *, struct dir *)
create struct dir from struct path
Definition dircache.c:585
cnid_t did
Definition nad_cp.c:92
#define flag(x)
Definition netacnv.c:15
Definition include/atalk/directory.h:62
Definition include/atalk/volume.h:32