1
Checking RT patch for linux-2.6.23, I found,
2
- lock_list_first_entry() and lock_list_next_entry() were changed from
3
'static inline'-ed function to 'global un-inlined'-ed function, and
4
moved from lock_list.h to lock_list.c. They are not exported to kernel
6
- lock_list_splice_init() was newly introduced, and it is not exported
10
- link aufs statically
11
- or, ask Ingo Molar to export them.
14
Index: fs/aufs/branch.c
15
===================================================================
16
RCS file: /cvsroot/aufs/aufs/fs/aufs/branch.c,v
17
retrieving revision 1.67
18
diff -u -p -r1.67 branch.c
19
--- fs/aufs/branch.c 5 Nov 2007 01:36:26 -0000 1.67
20
+++ fs/aufs/branch.c 14 Nov 2007 17:16:49 -0000
21
@@ -852,6 +852,7 @@ int br_mod(struct super_block *sb, struc
22
if (!br_writable(mod->perm)) {
23
/* rw --> ro, file might be mmapped */
24
struct file *file, *hf;
28
DiMustNoWaiters(root);
29
@@ -863,7 +864,8 @@ int br_mod(struct super_block *sb, struc
30
* since BKL (and sbinfo) is locked
32
AuDebugOn(!kernel_locked());
33
- list_for_each_entry(file, &sb->s_files, f_u.fu_list) {
34
+ idx = au_rt_s_files_lock(sb);
35
+ au_rt_s_files_loop(file, sb) {
36
LKTRTrace("%.*s\n", AuDLNPair(file->f_dentry));
37
if (unlikely(!au_test_aufs_file(file)))
39
@@ -885,6 +887,7 @@ int br_mod(struct super_block *sb, struc
40
FiMustNoWaiters(file);
43
+ au_rt_s_files_unlock(sb, idx);
45
/* aufs_write_lock() calls ..._child() */
46
di_write_lock_child(root);
47
Index: fs/aufs/debug.c
48
===================================================================
49
RCS file: /cvsroot/aufs/aufs/fs/aufs/debug.c,v
50
retrieving revision 1.43
51
diff -u -p -r1.43 debug.c
52
--- fs/aufs/debug.c 12 Nov 2007 01:43:10 -0000 1.43
53
+++ fs/aufs/debug.c 14 Nov 2007 17:16:49 -0000
54
@@ -112,7 +112,7 @@ static int do_pri_inode(aufs_bindex_t bi
56
i_size_read(inode), (u64)inode->i_blocks,
57
timespec_to_ns(&inode->i_ctime) & 0x0ffff,
58
- inode->i_mapping ? inode->i_mapping->nrpages : 0,
59
+ inode->i_mapping ? au_mapping_nrpages(inode->i_mapping) : 0,
60
inode->i_state, inode->i_flags, inode->i_generation,
61
l ? ", wh " : "", l, n);
64
===================================================================
65
RCS file: /cvsroot/aufs/aufs/fs/aufs/misc.h,v
66
retrieving revision 1.38
67
diff -u -p -r1.38 misc.h
68
--- fs/aufs/misc.h 12 Nov 2007 01:40:06 -0000 1.38
69
+++ fs/aufs/misc.h 14 Nov 2007 17:16:49 -0000
71
#include <linux/version.h>
72
#include <linux/aufs_type.h>
75
+/* ---------------------------------------------------------------------- */
78
+ * support for RT patch (testing).
79
+ * it uses 'standard compat_rw_semaphore' instead of 'realtime rw_semaphore.'
80
+ * sigh, wrapper for wrapper...
83
+#ifndef CONFIG_PREEMPT_RT
85
+#define au_rw_semaphore rw_semaphore
86
+#define au_init_rwsem init_rwsem
87
+#define au_down_read down_read
88
+#define au_down_read_nested down_read_nested
89
+#define au_down_read_trylock down_read_trylock
90
+#define au_up_read up_read
91
+#define au_downgrade_write downgrade_write
92
+#define au_down_write down_write
93
+#define au_down_write_nested down_write_nested
94
+#define au_down_write_trylock down_write_trylock
95
+#define au_up_write up_write
97
+static inline int au_rt_s_files_lock(struct super_block *sb)
103
+static inline void au_rt_s_files_unlock(struct super_block *sb, int idx)
108
+#define au_rt_s_files_loop(pos, sb) \
109
+ list_for_each_entry(pos, &(sb)->s_files, f_u.fu_list)
110
+#define au_rt_s_files_loop_break(pos) do {} while (0)
112
+static inline unsigned long au_mapping_nrpages(struct address_space *mapping)
114
+ return mapping->nrpages;
117
+#else /* CONFIG_PREEMPT_RT */
119
+#define au_rw_semaphore compat_rw_semaphore
120
+#define au_init_rwsem compat_init_rwsem
121
+#define au_down_read compat_down_read
122
+#define au_down_read_nested compat_down_read_nested
123
+#define au_down_read_trylock compat_down_read_trylock
124
+#define au_up_read compat_up_read
125
+#define au_downgrade_write compat_downgrade_write
126
+#define au_down_write compat_down_write
127
+#define au_down_write_nested compat_down_write_nested
128
+#define au_down_write_trylock compat_down_write_trylock
129
+#define au_up_write compat_up_write
131
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23)
133
+static inline int au_rt_s_files_lock(struct super_block *sb)
136
+ idx = qrcu_read_lock(&sb->s_qrcu);
137
+ percpu_list_fold(&sb->s_files);
141
+static inline void au_rt_s_files_unlock(struct super_block *sb, int idx)
143
+ qrcu_read_unlock(&sb->s_qrcu, idx);
146
+#define au_rt_s_files_loop(pos, sb) \
147
+ lock_list_for_each_entry(pos, percpu_list_head(&(sb)->s_files), \
150
+#define au_rt_s_files_loop_break(pos) \
151
+ lock_list_for_each_entry_stop(pos, f_u.fu_llist);
153
+static inline unsigned long au_mapping_nrpages(struct address_space *mapping)
155
+ return mapping_nrpages(mapping);
158
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
160
+static inline int au_rt_s_files_lock(struct super_block *sb)
162
+ //barrier_lock(&sb->s_barrier);
163
+ filevec_add_drain_all();
167
+static inline void au_rt_s_files_unlock(struct super_block *sb, int idx)
169
+ //barrier_unlock(&sb->s_barrier);
172
+#define au_rt_s_files_loop(pos, sb) \
173
+ lock_list_for_each_entry(pos, &(sb)->s_files, f_u.fu_llist)
175
+#define au_rt_s_files_loop_break(pos) \
176
+ lock_list_for_each_entry_stop(pos, f_u.fu_llist);
178
+static inline unsigned long au_mapping_nrpages(struct address_space *mapping)
180
+ return mapping->nrpages;
185
+static inline int au_rt_s_files_lock(struct super_block *sb)
191
+static inline void au_rt_s_files_unlock(struct super_block *sb, int idx)
196
+#define au_rt_s_files_loop(pos, sb) \
197
+ list_for_each_entry(pos, &(sb)->s_files, f_u.fu_list)
198
+#define au_rt_s_files_loop_break(pos) do {} while (0)
200
+static inline unsigned long au_mapping_nrpages(struct address_space *mapping)
202
+ return mapping->nrpages;
205
+#endif /* LINUX_VERSION_CODE */
206
+#endif /* CONFIG_PREEMPT_RT */
208
+/* ---------------------------------------------------------------------- */
210
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
211
#define I_MUTEX_QUOTA 0
212
#define lockdep_off() do {} while (0)
213
@@ -48,7 +184,7 @@ typedef unsigned int au_gen_t;
214
/* ---------------------------------------------------------------------- */
217
- struct rw_semaphore rwsem;
218
+ struct au_rw_semaphore rwsem;
219
#ifdef CONFIG_AUFS_DEBUG
222
@@ -71,64 +207,64 @@ struct aufs_rwsem {
223
static inline void rw_init_nolock(struct aufs_rwsem *rw)
226
- init_rwsem(&rw->rwsem);
227
+ au_init_rwsem(&rw->rwsem);
230
static inline void rw_init_wlock(struct aufs_rwsem *rw)
233
- down_write(&rw->rwsem);
234
+ au_down_write(&rw->rwsem);
237
static inline void rw_init_wlock_nested(struct aufs_rwsem *rw, unsigned int lsc)
240
- down_write_nested(&rw->rwsem, lsc);
241
+ au_down_write_nested(&rw->rwsem, lsc);
244
static inline void rw_read_lock(struct aufs_rwsem *rw)
246
- down_read(&rw->rwsem);
247
+ au_down_read(&rw->rwsem);
251
static inline void rw_read_lock_nested(struct aufs_rwsem *rw, unsigned int lsc)
253
- down_read_nested(&rw->rwsem, lsc);
254
+ au_down_read_nested(&rw->rwsem, lsc);
258
static inline void rw_read_unlock(struct aufs_rwsem *rw)
261
- up_read(&rw->rwsem);
262
+ au_up_read(&rw->rwsem);
265
static inline void rw_dgrade_lock(struct aufs_rwsem *rw)
268
- downgrade_write(&rw->rwsem);
269
+ au_downgrade_write(&rw->rwsem);
272
static inline void rw_write_lock(struct aufs_rwsem *rw)
274
- down_write(&rw->rwsem);
275
+ au_down_write(&rw->rwsem);
278
static inline void rw_write_lock_nested(struct aufs_rwsem *rw, unsigned int lsc)
280
- down_write_nested(&rw->rwsem, lsc);
281
+ au_down_write_nested(&rw->rwsem, lsc);
284
static inline void rw_write_unlock(struct aufs_rwsem *rw)
286
- up_write(&rw->rwsem);
287
+ au_up_write(&rw->rwsem);
290
/* why is not _nested version defined */
291
static inline int rw_read_trylock(struct aufs_rwsem *rw)
293
- int ret = down_read_trylock(&rw->rwsem);
294
+ int ret = au_down_read_trylock(&rw->rwsem);
298
@@ -136,7 +272,7 @@ static inline int rw_read_trylock(struct
300
static inline int rw_write_trylock(struct aufs_rwsem *rw)
302
- return down_write_trylock(&rw->rwsem);
303
+ return au_down_write_trylock(&rw->rwsem);
307
@@ -145,7 +281,7 @@ static inline int rw_write_trylock(struc
309
/* to debug easier, do not make them inlined functions */
310
#define RwMustNoWaiters(rw) AuDebugOn(!list_empty(&(rw)->rwsem.wait_list))
311
-#define RwMustAnyLock(rw) AuDebugOn(down_write_trylock(&(rw)->rwsem))
312
+#define RwMustAnyLock(rw) AuDebugOn(au_down_write_trylock(&(rw)->rwsem))
313
#ifdef CONFIG_AUFS_DEBUG
314
#define RwMustReadLock(rw) do { \