]> arthur.barton.de Git - netatalk.git/blob - etc/afpd/dircache.h
Merge remote-tracking branch 'remotes/origin/branch-netatalk-2-1'
[netatalk.git] / etc / afpd / dircache.h
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/volume.h>
21 #include <atalk/directory.h>
22
23 /* Maximum size of the dircache hashtable */
24 #define DEFAULT_MAX_DIRCACHE_SIZE 8192
25 #define MAX_POSSIBLE_DIRCACHE_SIZE 131072
26 #define DIRCACHE_FREE_QUANTUM 256
27
28 /* flags for dircache_remove */
29 #define DIRCACHE      (1 << 0)
30 #define DIDNAME_INDEX (1 << 1)
31 #define QUEUE_INDEX   (1 << 2)
32 #define DIRCACHE_ALL  (DIRCACHE|DIDNAME_INDEX|QUEUE_INDEX)
33
34 extern int        dircache_init(int reqsize);
35 extern int        dircache_add(const struct vol *, struct dir *);
36 extern void       dircache_remove(const struct vol *, struct dir *, int flag);
37 extern struct dir *dircache_search_by_did(const struct vol *vol, cnid_t did);
38 extern struct dir *dircache_search_by_name(const struct vol *, const struct dir *dir, char *name, int len, time_t ctime);
39 extern void       dircache_dump(void);
40 extern void       log_dircache_stat(void);
41 #endif /* DIRCACHE_H */