~ubuntu-branches/ubuntu/vivid/aufs/vivid

« back to all changes in this revision

Viewing changes to fs/aufs25/hinode.h

  • Committer: Bazaar Package Importer
  • Author(s): Julian Andres Klode
  • Date: 2008-08-21 14:58:54 UTC
  • mfrom: (1.1.8 upstream) (4.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080821145854-4b49x09r4zmvlk5o
Tags: 0+20080719-4
01_vserver_apparmor.dpatch: [UPDATE] Disable vserver patches on kernel 
2.6.26, because they are not needed anymore. (Closes: #495921)

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
/*
20
20
 * lower (branch filesystem) inode and setting inotify
21
21
 *
22
 
 * $Id: hinode.h,v 1.4 2008/05/26 04:04:24 sfjro Exp $
 
22
 * $Id: hinode.h,v 1.8 2008/07/14 00:15:21 sfjro Exp $
23
23
 */
24
24
 
25
25
#ifndef __AUFS_HINODE_H__
37
37
 
38
38
struct au_hinotify {
39
39
#ifdef CONFIG_AUFS_HINOTIFY
 
40
        spinlock_t              hin_ignore_lock;
 
41
        struct list_head        hin_ignore_list;
 
42
 
40
43
        struct inotify_watch    hin_watch;
41
44
        struct inode            *hin_aufs_inode;        /* no get/put */
42
 
 
43
 
        /* an array of atomic_t X au_hin_nignore */
44
 
        atomic_t                hin_ignore[0];
45
45
#endif
46
46
};
47
47
 
58
58
 
59
59
struct au_hin_ignore {
60
60
#ifdef CONFIG_AUFS_HINOTIFY
61
 
        __u32                   ign_events;
 
61
        struct list_head        ign_list;
 
62
 
 
63
        pid_t                   ign_pid;
 
64
        __u32                   ign_events, ign_handled;
62
65
        struct au_hinode        *ign_hinode;
63
66
#endif
64
67
};
66
69
/* ---------------------------------------------------------------------- */
67
70
 
68
71
#ifdef CONFIG_AUFS_HINOTIFY
 
72
/* inotify events */
 
73
static const __u32 AuInMask = (IN_MOVE | IN_DELETE | IN_CREATE
 
74
                               /* | IN_ACCESS */
 
75
                               | IN_MODIFY | IN_ATTRIB
 
76
                               /* | IN_DELETE_SELF | IN_MOVE_SELF */
 
77
        );
 
78
 
69
79
static inline
70
80
void au_hin_init(struct au_hinode *hinode, struct au_hinotify *val)
71
81
{
76
86
int au_hin_alloc(struct au_hinode *hinode, struct inode *inode,
77
87
                 struct inode *h_inode);
78
88
void au_hin_free(struct au_hinode *hinode);
79
 
void au_do_hdir_lock(struct inode *h_dir, struct inode *dir,
80
 
                     aufs_bindex_t bindex, unsigned int lsc);
81
 
void au_hdir_unlock(struct inode *h_dir, struct inode *dir,
82
 
                    aufs_bindex_t bindex);
83
 
struct dentry *au_hdir_lock_rename(struct dentry **h_parents,
84
 
                                   struct inode **dirs, aufs_bindex_t bindex,
85
 
                                   int issamedir);
86
 
void au_hdir_unlock_rename(struct dentry **h_parents, struct inode **dirs,
87
 
                           aufs_bindex_t bindex, int issamedir);
 
89
void au_hin_ctl(struct au_hinode *hinode, const __u32 mask);
88
90
void au_reset_hinotify(struct inode *inode, unsigned int flags);
89
91
 
90
 
void au_hin_ignore(struct au_hinode *hinode, __u32 events);
91
 
void au_hin_unignore(struct au_hinode *hinode, __u32 events);
92
 
 
93
92
int __init au_inotify_init(void);
94
93
void au_inotify_fin(void);
95
94
 
 
95
static inline void au_hin_suspend(struct au_hinode *hinode)
 
96
{
 
97
        au_hin_ctl(hinode, 0);
 
98
}
 
99
 
 
100
static inline void au_hin_resume(struct au_hinode *hinode)
 
101
{
 
102
        au_hin_ctl(hinode, AuInMask);
 
103
}
 
104
 
96
105
#else
97
106
 
98
107
static inline
113
122
        /* nothing */
114
123
}
115
124
 
116
 
static inline
117
 
void au_do_hdir_lock(struct inode *h_dir, struct inode *dir,
118
 
                     aufs_bindex_t bindex, unsigned int lsc)
119
 
{
120
 
        mutex_lock_nested(&h_dir->i_mutex, lsc);
121
 
}
122
 
 
123
 
static inline
124
 
void au_hdir_unlock(struct inode *h_dir, struct inode *dir,
125
 
                    aufs_bindex_t bindex)
126
 
{
127
 
        mutex_unlock(&h_dir->i_mutex);
128
 
}
129
 
 
130
 
static inline
131
 
struct dentry *au_hdir_lock_rename(struct dentry **h_parents,
132
 
                                   struct inode **dirs, aufs_bindex_t bindex,
133
 
                                   int issamedir)
134
 
{
135
 
        return vfsub_lock_rename(h_parents[0], h_parents[1]);
136
 
}
137
 
 
138
 
static inline
139
 
void au_hdir_unlock_rename(struct dentry **h_parents, struct inode **dirs,
140
 
                           aufs_bindex_t bindex, int issamedir)
141
 
{
142
 
        vfsub_unlock_rename(h_parents[0], h_parents[1]);
143
 
}
144
 
 
145
125
static inline void au_reset_hinotify(struct inode *inode, unsigned int flags)
146
126
{
147
127
        /* nothing */
148
128
}
149
129
 
150
 
static inline void au_hin_ignore(struct au_hinotify *hinotify, __u32 events)
151
 
{
152
 
        /* nothing */
153
 
}
154
 
 
155
 
static inline void au_hin_unignore(struct au_hinotify *hinotify, __u32 events)
156
 
{
157
 
        /* nothing */
158
 
}
159
 
 
160
130
static inline int au_inotify_init(void)
161
131
{
162
132
        return 0;
163
133
}
164
134
 
165
135
#define au_inotify_fin()        do {} while (0)
 
136
 
 
137
static inline void au_hin_suspend(struct au_hinode *hinode)
 
138
{
 
139
        /* empty */
 
140
}
 
141
 
 
142
static inline void au_hin_resume(struct au_hinode *hinode)
 
143
{
 
144
        /* empty */
 
145
}
166
146
#endif /* CONFIG_AUFS_HINOTIFY */
167
147
 
168
 
/* ---------------------------------------------------------------------- */
169
 
 
170
 
/*
171
 
 * au_hdir_lock, au_hdir2_lock
172
 
 */
173
 
#define AuLockFunc(name, lsc) \
174
 
static inline \
175
 
void name##_lock(struct inode *h_dir, struct inode *dir, aufs_bindex_t bindex) \
176
 
{ au_do_hdir_lock(h_dir, dir, bindex, AuLsc_I_##lsc); }
177
 
 
178
 
AuLockFunc(au_hdir, PARENT);
179
 
AuLockFunc(au_hdir2, PARENT2);
180
 
 
181
 
#undef AuLockFunc
 
148
#if defined(CONFIG_AUFS_HINOTIFY) && defined(CONFIG_AUFS_DEBUG)
 
149
static inline void au_hin_list_del(struct list_head *e)
 
150
{
 
151
        list_del_init(e);
 
152
}
 
153
 
 
154
void au_dbg_hin_list(struct vfsub_args *vargs);
 
155
#else
 
156
static inline void au_hin_list_del(struct list_head *e)
 
157
{
 
158
        list_del(e);
 
159
}
 
160
 
 
161
static inline void au_dbg_hin_list(struct vfsub_args *vargs)
 
162
{
 
163
        /* empty */
 
164
}
 
165
#endif /* CONFIG_AUFS_DEBUG */
182
166
 
183
167
/* ---------------------------------------------------------------------- */
184
168