~ubuntu-branches/ubuntu/raring/aufs/raring

« back to all changes in this revision

Viewing changes to fs/aufs/vfsub.h

  • Committer: Bazaar Package Importer
  • Author(s): Julian Andres Klode
  • Date: 2008-05-06 18:35:50 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20080506183550-0b6c974kkgc46oeh
Tags: 0+20080506-1
* New upstream release, supports Kernel 2.6.25 (Closes: #479717)
* Fix building with older Kernels (Closes: #475042)
* Update the patches 01, 04 and 07 to also patch fs/aufs25

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
/*
20
20
 * sub-routines for VFS
21
21
 *
22
 
 * $Id: vfsub.h,v 1.34 2008/03/31 07:45:32 sfjro Exp $
 
22
 * $Id: vfsub.h,v 1.36 2008/04/13 23:46:11 sfjro Exp $
23
23
 */
24
24
 
25
25
#ifndef __AUFS_VFSUB_H__
30
30
#include <linux/fs.h>
31
31
#include <linux/namei.h>
32
32
#include <linux/version.h>
33
 
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) \
34
 
        && defined(CONFIG_AUFS_SPLICE_PATCH)
 
33
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23)
35
34
#include <linux/splice.h>
36
35
#endif
37
 
#ifdef CONFIG_AUFS_HINOTIFY
38
36
#include <linux/inotify.h>
39
 
#endif
40
37
 
41
38
/* ---------------------------------------------------------------------- */
42
39
 
46
43
#define vfsub_ftest(flags, name)        ((flags) & Vfsub_##name)
47
44
#define vfsub_fset(flags, name)         { (flags) |= Vfsub_##name; }
48
45
#define vfsub_fclr(flags, name)         { (flags) &= ~Vfsub_##name; }
 
46
#ifndef CONFIG_AUFS_DLGT
 
47
#undef Vfsub_DLGT
 
48
#define Vfsub_DLGT      0
 
49
#endif
49
50
 
50
 
struct aufs_hin_ignore;
 
51
struct au_hin_ignore;
51
52
struct vfsub_args {
52
53
#ifdef CONFIG_AUFS_HINOTIFY
53
54
        /* inotify events to be ignored */
54
55
        int                     nignore;
55
 
        struct aufs_hin_ignore  *ignore;
 
56
        struct au_hin_ignore    *ignore;
56
57
#endif
57
58
 
58
59
        unsigned int            flags;
59
60
};
60
61
 
61
 
struct aufs_hinode;
 
62
struct au_hinode;
62
63
#ifdef CONFIG_AUFS_HINOTIFY
63
64
static inline
64
 
void do_vfsub_args_reinit(struct vfsub_args *vargs, struct aufs_hin_ignore *ign)
 
65
void do_vfsub_args_reinit(struct vfsub_args *vargs, struct au_hin_ignore *ign)
65
66
{
66
67
        vargs->nignore = 0;
67
68
        vargs->ignore = ign;
68
69
}
69
70
 
70
 
static inline
71
 
void vfsub_args_reinit(struct vfsub_args *vargs)
 
71
static inline void vfsub_args_reinit(struct vfsub_args *vargs)
72
72
{
73
73
        vargs->nignore = 0;
74
74
}
75
75
 
76
76
__u32 vfsub_events_notify_change(struct iattr *ia);
77
77
void vfsub_ign_hinode(struct vfsub_args *vargs, __u32 events,
78
 
                      struct aufs_hinode *hinode);
 
78
                      struct au_hinode *hinode);
79
79
void vfsub_ign_inode(struct vfsub_args *vargs, __u32 events,
80
80
                     struct inode *inode, struct inode *h_inode);
81
81
 
83
83
void vfsub_unignore(struct vfsub_args *vargs);
84
84
#else
85
85
static inline
86
 
void do_vfsub_args_reinit(struct vfsub_args *vargs, struct aufs_hin_ignore *ign)
 
86
void do_vfsub_args_reinit(struct vfsub_args *vargs, struct au_hin_ignore *ign)
87
87
{
88
88
        /* empty */
89
89
}
90
90
 
91
 
static inline
92
 
void vfsub_args_reinit(struct vfsub_args *vargs)
 
91
static inline void vfsub_args_reinit(struct vfsub_args *vargs)
93
92
{
94
93
        /* empty */
95
94
}
99
98
        return 0;
100
99
}
101
100
 
102
 
static inline
103
 
void vfsub_ign_hinode(struct vfsub_args *vargs, __u32 events,
104
 
                      struct aufs_hinode *hinode)
 
101
static inline void vfsub_ign_hinode(struct vfsub_args *vargs, __u32 events,
 
102
                                    struct au_hinode *hinode)
105
103
{
106
104
        /* empty */
107
105
}
108
106
 
109
 
static inline
110
 
void vfsub_ign_inode(struct vfsub_args *vargs, __u32 events,
111
 
                     struct inode *inode, struct inode *h_inode)
 
107
static inline void vfsub_ign_inode(struct vfsub_args *vargs, __u32 events,
 
108
                                   struct inode *inode, struct inode *h_inode)
112
109
{
113
110
        /* empty */
114
111
}
125
122
#endif /* CONFIG_AUFS_HINOTIFY */
126
123
 
127
124
static inline
128
 
void vfsub_args_init(struct vfsub_args *vargs, struct aufs_hin_ignore *ign,
129
 
                     int dlgt, int force_unlink)
 
125
void vfsub_args_init(struct vfsub_args *vargs, struct au_hin_ignore *ign,
 
126
                     int dlgt, const int force_unlink)
130
127
{
131
128
        do_vfsub_args_reinit(vargs, ign);
132
129
        vargs->flags = 0;
155
152
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
156
153
#define I_MUTEX_QUOTA 0
157
154
#endif
 
155
 
158
156
enum {
159
157
        AuLsc_I_Begin = I_MUTEX_QUOTA, /* 4 */
160
158
        AuLsc_I_PARENT,         /* hidden inode, parent first */
232
230
/* ---------------------------------------------------------------------- */
233
231
 
234
232
#ifdef CONFIG_AUFS_WORKAROUND_FUSE
 
233
/* br_fuse.c */
235
234
int au_update_fuse_h_inode(struct vfsmount *h_mnt, struct dentry *h_dentry);
236
235
#else
237
236
static inline
241
240
}
242
241
#endif
243
242
 
244
 
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) \
245
 
        && (defined(CONFIG_XFS_FS) || defined(CONFIG_XFS_FS_MODULE))
 
243
#ifdef CONFIG_AUFS_BR_XFS
 
244
/* br_xfs.c */
246
245
dev_t au_h_rdev(struct inode *h_inode, struct vfsmount *h_mnt,
247
246
                struct dentry *h_dentry);
248
247
#else
263
262
        return permission(inode, mask, nd);
264
263
}
265
264
 
 
265
/* ---------------------------------------------------------------------- */
 
266
 
266
267
static inline
267
268
struct file *vfsub_filp_open(const char *path, int oflags, int mode)
268
269
{
426
427
 
427
428
/* ---------------------------------------------------------------------- */
428
429
 
429
 
#if defined(CONFIG_AUFS_DLGT) || defined(CONFIG_AUFS_HINOTIFY)
 
430
#if defined(CONFIG_AUFS_HINOTIFY) || defined(CONFIG_AUFS_DLGT)
 
431
/* hin_or_dlgt.c */
430
432
int vfsub_permission(struct inode *inode, int mask, struct nameidata *nd,
431
433
                     int dlgt);
432
434
 
601
603
        return err;
602
604
}
603
605
 
604
 
static inline int vfsub_getattr(struct vfsmount *mnt, struct dentry *dentry,
605
 
                                struct kstat *st, int dlgt)
 
606
static inline
 
607
int vfsub_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *st,
 
608
                  int dlgt)
606
609
{
607
610
        return do_vfsub_getattr(mnt, dentry, st);
608
611
}