16
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
/* $Id: aufs.h,v 1.26 2007/06/04 02:15:32 sfjro Exp $ */
19
/* $Id: aufs.h,v 1.40 2007/12/03 01:37:26 sfjro Exp $ */
26
26
#include <linux/version.h>
27
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18)
28
#include <linux/uaccess.h>
30
#include <asm/uaccess.h>
33
/* ---------------------------------------------------------------------- */
28
35
/* limited support before 2.6.16, curretly 2.6.15 only. */
29
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
30
#define atomic_long_t atomic_t
31
#define atomic_long_set atomic_set
32
#define timespec_to_ns(ts) ({(long long)(ts)->tv_sec;})
36
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
37
#define timespec_to_ns(ts) ({ (long long)(ts)->tv_sec; })
33
38
#define D_CHILD d_child
35
40
#define D_CHILD d_u.d_child
43
#include <linux/types.h>
44
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 17)
45
typedef unsigned long blkcnt_t;
48
#include <linux/list.h>
49
#include <linux/sysfs.h>
50
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
51
typedef struct kset au_subsys_t;
52
#define au_subsys_to_kset(subsys) (subsys)
54
typedef struct subsystem au_subsys_t;
55
#define au_subsys_to_kset(subsys) ((subsys).kset)
58
#include <linux/gfp.h>
60
#define GFP_TEMPORARY GFP_KERNEL
65
/* introduced linux-2.6.17 */
69
#include <linux/compiler.h>
71
#define __packed __attribute__((packed))
74
#define __aligned(x) __attribute__((aligned(x)))
77
/* ---------------------------------------------------------------------- */
79
#define _AuNoNfsBranchMsg "NFS branch is not supported"
80
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
82
#define AuNoNfsBranchMsg _AuNoNfsBranchMsg
83
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) \
84
&& (!defined(CONFIG_AUFS_LHASH_PATCH) \
85
|| !(defined(CONFIG_AUFS) \
86
|| defined(CONFIG_AUFS_PUT_FILP_PATCH)) \
87
|| defined(CONFIG_AUFS_FAKE_DM))
89
#define AuNoNfsBranchMsg _AuNoNfsBranchMsg \
90
", try some configurations and patches included in aufs source CVS"
38
93
/* ---------------------------------------------------------------------- */
57
113
//#include "xattr.h"
59
#define AuUse_ISSUBDIR
115
/* ---------------------------------------------------------------------- */
60
117
#ifdef CONFIG_AUFS_MODULE
62
119
/* call ksize() or not */
63
#ifndef CONFIG_AUFS_KSIZE_PATCH
120
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) \
121
&& !defined(CONFIG_AUFS_KSIZE_PATCH)
64
122
#define ksize(p) (0U)
67
/* call is_subdir() or not */
68
#ifndef CONFIG_AUFS_ISSUBDIR_PATCH
72
125
#endif /* CONFIG_AUFS_MODULE */
74
127
#endif /* __KERNEL__ */