2
* Copyright (C) 2007-2008 Junjiro Okajima
4
* This program, aufs 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.
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.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
* module initialization and module-global
22
* $Id: module.h,v 1.2 2008/04/21 01:33:00 sfjro Exp $
25
#ifndef __AUFS_MODULE_H__
26
#define __AUFS_MODULE_H__
30
//#include <linux/slab.h>
32
/* ---------------------------------------------------------------------- */
34
/* module parameters */
35
extern short aufs_nwkq;
36
extern int sysaufs_brs;
38
/* ---------------------------------------------------------------------- */
40
extern char au_esc_chars[];
41
extern int au_dir_roflags;
50
#ifdef CONFIG_AUFS_HINOTIFY
56
extern struct kmem_cache *au_cachep[];
58
#define AuCacheArgs(type, sz) (type), (sz), 0, SLAB_RECLAIM_ACCOUNT, NULL
59
#define AuCacheX(type, extra) \
60
kmem_cache_create(AuCacheArgs(#type, sizeof(struct type) + extra))
61
#define AuCache(type) AuCacheX(type, 0)
63
/* ---------------------------------------------------------------------- */
65
#define AuCacheFuncs(name, index) \
66
static inline void *au_cache_alloc_##name(void) \
67
{ return kmem_cache_alloc(au_cachep[index], GFP_KERNEL); } \
68
static inline void au_cache_free_##name(void *p) \
69
{ kmem_cache_free(au_cachep[index], p); }
71
AuCacheFuncs(dinfo, AuCache_DINFO);
72
AuCacheFuncs(icntnr, AuCache_ICNTNR);
73
AuCacheFuncs(finfo, AuCache_FINFO);
74
AuCacheFuncs(vdir, AuCache_VDIR);
75
AuCacheFuncs(dehstr, AuCache_DEHSTR);
77
#endif /* __KERNEL__ */
78
#endif /* __AUFS_MODULE_H__ */