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

« back to all changes in this revision

Viewing changes to fs/aufs/hinode.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
 * lower (branch filesystem) inode and setting inotify
21
21
 *
22
 
 * $Id: hinode.h,v 1.9 2008/03/31 07:45:32 sfjro Exp $
 
22
 * $Id: hinode.h,v 1.10 2008/04/13 23:41:37 sfjro Exp $
23
23
 */
24
24
 
25
25
#ifndef __AUFS_HINODE_H__
32
32
#include <linux/version.h>
33
33
#include <linux/aufs_type.h>
34
34
//#include "branch.h"
35
 
#include "inode.h"
 
35
//#include "inode.h"
36
36
//#include "vfsub.h"
37
37
 
38
38
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18)
44
44
 
45
45
/* ---------------------------------------------------------------------- */
46
46
 
47
 
struct aufs_hinotify {
 
47
struct au_hinotify {
48
48
#ifdef CONFIG_AUFS_HINOTIFY
49
49
        struct inotify_watch    hin_watch;
50
50
        struct inode            *hin_aufs_inode;        /* no get/put */
54
54
#endif
55
55
};
56
56
 
57
 
struct aufs_hinode {
 
57
struct au_hinode {
58
58
        struct inode            *hi_inode;
59
59
        aufs_bindex_t           hi_id;
60
60
#ifdef CONFIG_AUFS_HINOTIFY
61
 
        struct aufs_hinotify    *hi_notify;
 
61
        struct au_hinotify      *hi_notify;
62
62
#endif
63
63
 
64
64
        /* reference to the copied-up whiteout with get/put */
65
65
        struct dentry           *hi_whdentry;
66
66
};
67
67
 
68
 
struct aufs_hin_ignore {
 
68
struct au_hin_ignore {
69
69
#ifdef CONFIG_AUFS_HINOTIFY
70
70
        __u32                   ign_events;
71
 
        struct aufs_hinode      *ign_hinode;
 
71
        struct au_hinode        *ign_hinode;
72
72
#endif
73
73
};
74
74
 
76
76
 
77
77
#ifdef CONFIG_AUFS_HINOTIFY
78
78
static inline
79
 
void au_hin_init(struct aufs_hinode *hinode, struct aufs_hinotify *val)
 
79
void au_hin_init(struct au_hinode *hinode, struct au_hinotify *val)
80
80
{
81
81
        hinode->hi_notify = val;
82
82
}
83
83
 
84
84
/* hinotify.c */
85
 
 
86
 
int au_hin_alloc(struct aufs_hinode *hinode, struct inode *inode,
 
85
int au_hin_alloc(struct au_hinode *hinode, struct inode *inode,
87
86
                 struct inode *h_inode);
88
 
void au_hin_free(struct aufs_hinode *hinode);
 
87
void au_hin_free(struct au_hinode *hinode);
89
88
void au_do_hdir_lock(struct inode *h_dir, struct inode *dir,
90
89
                     aufs_bindex_t bindex, unsigned int lsc);
91
 
void hdir_unlock(struct inode *h_dir, struct inode *dir, aufs_bindex_t bindex);
92
 
struct dentry *hdir_lock_rename(struct dentry **h_parents, struct inode **dirs,
93
 
                                aufs_bindex_t bindex, int issamedir);
94
 
void hdir_unlock_rename(struct dentry **h_parents, struct inode **dirs,
95
 
                        aufs_bindex_t bindex, int issamedir);
 
90
void au_hdir_unlock(struct inode *h_dir, struct inode *dir,
 
91
                    aufs_bindex_t bindex);
 
92
struct dentry *au_hdir_lock_rename(struct dentry **h_parents,
 
93
                                   struct inode **dirs, aufs_bindex_t bindex,
 
94
                                   int issamedir);
 
95
void au_hdir_unlock_rename(struct dentry **h_parents, struct inode **dirs,
 
96
                           aufs_bindex_t bindex, int issamedir);
96
97
void au_reset_hinotify(struct inode *inode, unsigned int flags);
97
98
 
98
 
void au_hin_ignore(struct aufs_hinode *hinode, __u32 events);
99
 
void au_hin_unignore(struct aufs_hinode *hinode, __u32 events);
 
99
void au_hin_ignore(struct au_hinode *hinode, __u32 events);
 
100
void au_hin_unignore(struct au_hinode *hinode, __u32 events);
100
101
 
101
102
int __init au_inotify_init(void);
102
103
void au_inotify_fin(void);
 
104
 
103
105
#else
 
106
 
104
107
static inline
105
 
void au_hin_init(struct aufs_hinode *hinode, struct aufs_hinotify *val)
 
108
void au_hin_init(struct au_hinode *hinode, struct au_hinotify *val)
106
109
{
107
110
        /* empty */
108
111
}
109
112
 
110
113
static inline
111
 
int au_hin_alloc(struct aufs_hinode *hinode, struct inode *inode,
 
114
int au_hin_alloc(struct au_hinode *hinode, struct inode *inode,
112
115
                 struct inode *h_inode)
113
116
{
114
117
        return -EOPNOTSUPP;
115
118
}
116
119
 
117
 
static inline void au_hin_free(struct aufs_hinode *hinode)
 
120
static inline void au_hin_free(struct au_hinode *hinode)
118
121
{
119
122
        /* nothing */
120
123
}
121
124
 
122
 
static inline void au_do_hdir_lock(struct inode *h_dir, struct inode *dir,
123
 
                                   aufs_bindex_t bindex, unsigned int lsc)
 
125
static inline
 
126
void au_do_hdir_lock(struct inode *h_dir, struct inode *dir,
 
127
                     aufs_bindex_t bindex, unsigned int lsc)
124
128
{
125
129
        vfsub_i_lock_nested(h_dir, lsc);
126
130
}
127
131
 
128
132
static inline
129
 
void hdir_unlock(struct inode *h_dir, struct inode *dir, aufs_bindex_t bindex)
 
133
void au_hdir_unlock(struct inode *h_dir, struct inode *dir,
 
134
                    aufs_bindex_t bindex)
130
135
{
131
136
        vfsub_i_unlock(h_dir);
132
137
}
133
138
 
134
139
static inline
135
 
struct dentry *hdir_lock_rename(struct dentry **h_parents, struct inode **dirs,
136
 
                                aufs_bindex_t bindex, int issamedir)
 
140
struct dentry *au_hdir_lock_rename(struct dentry **h_parents,
 
141
                                   struct inode **dirs, aufs_bindex_t bindex,
 
142
                                   int issamedir)
137
143
{
138
144
        return vfsub_lock_rename(h_parents[0], h_parents[1]);
139
145
}
140
146
 
141
147
static inline
142
 
void hdir_unlock_rename(struct dentry **h_parents, struct inode **dirs,
143
 
                        aufs_bindex_t bindex, int issamedir)
 
148
void au_hdir_unlock_rename(struct dentry **h_parents, struct inode **dirs,
 
149
                           aufs_bindex_t bindex, int issamedir)
144
150
{
145
151
        vfsub_unlock_rename(h_parents[0], h_parents[1]);
146
152
}
150
156
        /* nothing */
151
157
}
152
158
 
153
 
static inline __u32 au_notify_change_events(struct iattr *ia)
 
159
static inline void au_hin_ignore(struct au_hinotify *hinotify, __u32 events)
 
160
{
 
161
        /* nothing */
 
162
}
 
163
 
 
164
static inline void au_hin_unignore(struct au_hinotify *hinotify, __u32 events)
 
165
{
 
166
        /* nothing */
 
167
}
 
168
 
 
169
static inline int au_inotify_init(void)
154
170
{
155
171
        return 0;
156
172
}
157
173
 
158
 
static inline void au_hin_ignore(struct aufs_hinotify *hinotify, __u32 events)
159
 
{
160
 
        /* nothing */
161
 
}
162
 
 
163
 
static inline void au_hin_unignore(struct aufs_hinotify *hinotify, __u32 events)
164
 
{
165
 
        /* nothing */
166
 
}
167
 
 
168
 
#define au_inotify_init()       0
169
174
#define au_inotify_fin()        do {} while (0)
170
175
#endif /* CONFIG_AUFS_HINOTIFY */
171
176
 
172
177
/* ---------------------------------------------------------------------- */
173
178
 
174
179
/*
175
 
 * hgdir_lock, hdir_lock, hdir2_lock
 
180
 * hgdir_lock, au_hdir_lock, au_hdir2_lock
176
181
 */
177
 
#define LockFunc(name, lsc) \
 
182
#define AuLockFunc(name, lsc) \
178
183
static inline \
179
184
void name##_lock(struct inode *h_dir, struct inode *dir, aufs_bindex_t bindex) \
180
185
{ au_do_hdir_lock(h_dir, dir, bindex, AuLsc_I_##lsc); }
181
186
 
182
 
LockFunc(hdir, PARENT);
183
 
LockFunc(hdir2, PARENT2);
 
187
AuLockFunc(au_hdir, PARENT);
 
188
AuLockFunc(au_hdir2, PARENT2);
184
189
 
185
 
#undef LockFunc
 
190
#undef AuLockFunc
186
191
 
187
192
/* ---------------------------------------------------------------------- */
188
193