~ubuntu-branches/ubuntu/quantal/aufs/quantal

« back to all changes in this revision

Viewing changes to debian/patches/06_rt.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Julian Andres Klode
  • Date: 2008-04-01 18:26:37 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080401182637-ujuqq47eiggw4y5w
Tags: 0+20080401-1
* New upstream snapshot
  - Remove bashisms in script (Closes: #471288)
* debian/conf.mk, linux-patch-aufs.kpatches.sysfs_get_dentry:
  - Remove support for this patch, no longer used
* debian/conf.mk:
  - Add hacks for arm to armel (Closes: #473767)
* debian/control:
  - Add Dm-Upload-Allowed
* debian/copyright:
  - Use http://wiki.debian.org/Proposals/CopyrightFormat
* debian/linux-patch-aufs.kpatches.{splice,put_filp}:
  - Add support for Kernel 2.6.24 (and 2.6.25)
* debian/patches:
  - 01_vserver_apparmor: Update patch
  - 06_rt: Add patch for realtime kernel
  - 07_splice_hack: Add hack to support splice operations (Closes: #473430)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## 06_rt.dpatch by Julian Andres Klode <jak@jak-linux.org>
 
3
##
 
4
## DP: Add support for RT Kernels, based on patch/rt-compat.patch
 
5
 
 
6
@DPATCH@
 
7
diff -urNad aufs-0+20080317~/fs/aufs/branch.c aufs-0+20080317/fs/aufs/branch.c
 
8
--- aufs-0+20080317~/fs/aufs/branch.c   2008-03-10 05:41:38.000000000 +0100
 
9
+++ aufs-0+20080317/fs/aufs/branch.c    2008-03-17 13:38:26.000000000 +0100
 
10
@@ -849,6 +849,7 @@
 
11
                if (!br_writable(mod->perm)) {
 
12
                        /* rw --> ro, file might be mmapped */
 
13
                        struct file *file, *hf;
 
14
+                       int idx;
 
15
 
 
16
 #if 1 // test here
 
17
                        DiMustNoWaiters(root);
 
18
@@ -860,7 +861,8 @@
 
19
                         * since BKL (and sbinfo) is locked
 
20
                         */
 
21
                        AuDebugOn(!kernel_locked());
 
22
-                       list_for_each_entry(file, &sb->s_files, f_u.fu_list) {
 
23
+                       idx = au_rt_s_files_lock(sb);
 
24
+                       au_rt_s_files_loop(file, sb) {
 
25
                                LKTRTrace("%.*s\n", AuDLNPair(file->f_dentry));
 
26
                                if (!au_test_aufs_file(file))
 
27
                                        continue;
 
28
@@ -889,6 +891,7 @@
 
29
                                FiMustNoWaiters(file);
 
30
                                fi_read_unlock(file);
 
31
                        }
 
32
+                       au_rt_s_files_unlock(sb, idx);
 
33
 
 
34
                        /* aufs_write_lock() calls ..._child() */
 
35
                        di_write_lock_child(root);
 
36
diff -urNad aufs-0+20080317~/fs/aufs/debug.c aufs-0+20080317/fs/aufs/debug.c
 
37
--- aufs-0+20080317~/fs/aufs/debug.c    2008-03-17 00:46:30.000000000 +0100
 
38
+++ aufs-0+20080317/fs/aufs/debug.c     2008-03-17 13:38:26.000000000 +0100
 
39
@@ -111,7 +111,7 @@
 
40
             ntfy,
 
41
             i_size_read(inode), (u64)inode->i_blocks,
 
42
             timespec_to_ns(&inode->i_ctime) & 0x0ffff,
 
43
-            inode->i_mapping ? inode->i_mapping->nrpages : 0,
 
44
+            inode->i_mapping ? au_mapping_nrpages(inode->i_mapping) : 0,
 
45
             inode->i_state, inode->i_flags, inode->i_generation,
 
46
             l ? ", wh " : "", l, n);
 
47
        return 0;
 
48
diff -urNad aufs-0+20080317~/fs/aufs/misc.h aufs-0+20080317/fs/aufs/misc.h
 
49
--- aufs-0+20080317~/fs/aufs/misc.h     2008-03-17 00:44:47.000000000 +0100
 
50
+++ aufs-0+20080317/fs/aufs/misc.h      2008-03-17 13:38:26.000000000 +0100
 
51
@@ -29,6 +29,142 @@
 
52
 #include <linux/version.h>
 
53
 #include <linux/aufs_type.h>
 
54
 
 
55
+
 
56
+/* ---------------------------------------------------------------------- */
 
57
+
 
58
+/*
 
59
+ * support for RT patch (testing).
 
60
+ * it uses 'standard compat_rw_semaphore' instead of 'realtime rw_semaphore.'
 
61
+ * sigh, wrapper for wrapper...
 
62
+ */
 
63
+
 
64
+#ifndef CONFIG_PREEMPT_RT
 
65
+
 
66
+#define au_rw_semaphore                rw_semaphore
 
67
+#define au_init_rwsem          init_rwsem
 
68
+#define au_down_read           down_read
 
69
+#define au_down_read_nested    down_read_nested
 
70
+#define au_down_read_trylock   down_read_trylock
 
71
+#define au_up_read             up_read
 
72
+#define au_downgrade_write     downgrade_write
 
73
+#define au_down_write          down_write
 
74
+#define au_down_write_nested   down_write_nested
 
75
+#define au_down_write_trylock  down_write_trylock
 
76
+#define au_up_write            up_write
 
77
+
 
78
+static inline int au_rt_s_files_lock(struct super_block *sb)
 
79
+{
 
80
+       /* nothing */
 
81
+       return 0;
 
82
+}
 
83
+
 
84
+static inline void au_rt_s_files_unlock(struct super_block *sb, int idx)
 
85
+{
 
86
+       /* nothing */
 
87
+}
 
88
+
 
89
+#define au_rt_s_files_loop(pos, sb) \
 
90
+       list_for_each_entry(pos, &(sb)->s_files, f_u.fu_list)
 
91
+#define au_rt_s_files_loop_break(pos)  do {} while (0)
 
92
+
 
93
+static inline unsigned long au_mapping_nrpages(struct address_space *mapping)
 
94
+{
 
95
+       return mapping->nrpages;
 
96
+}
 
97
+
 
98
+#else /* CONFIG_PREEMPT_RT */
 
99
+
 
100
+#define au_rw_semaphore                compat_rw_semaphore
 
101
+#define au_init_rwsem          compat_init_rwsem
 
102
+#define au_down_read           compat_down_read
 
103
+#define au_down_read_nested    compat_down_read_nested
 
104
+#define au_down_read_trylock   compat_down_read_trylock
 
105
+#define au_up_read             compat_up_read
 
106
+#define au_downgrade_write     compat_downgrade_write
 
107
+#define au_down_write          compat_down_write
 
108
+#define au_down_write_nested   compat_down_write_nested
 
109
+#define au_down_write_trylock  compat_down_write_trylock
 
110
+#define au_up_write            compat_up_write
 
111
+
 
112
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23)
 
113
+
 
114
+static inline int au_rt_s_files_lock(struct super_block *sb)
 
115
+{
 
116
+       int idx;
 
117
+       idx = qrcu_read_lock(&sb->s_qrcu);
 
118
+       percpu_list_fold(&sb->s_files);
 
119
+       return idx;
 
120
+}
 
121
+
 
122
+static inline void au_rt_s_files_unlock(struct super_block *sb, int idx)
 
123
+{
 
124
+       qrcu_read_unlock(&sb->s_qrcu, idx);
 
125
+}
 
126
+
 
127
+#define au_rt_s_files_loop(pos, sb) \
 
128
+       lock_list_for_each_entry(pos, percpu_list_head(&(sb)->s_files), \
 
129
+                                f_u.fu_llist)
 
130
+
 
131
+#define au_rt_s_files_loop_break(pos) \
 
132
+       lock_list_for_each_entry_stop(pos, f_u.fu_llist);
 
133
+
 
134
+static inline unsigned long au_mapping_nrpages(struct address_space *mapping)
 
135
+{
 
136
+       return mapping_nrpages(mapping);
 
137
+}
 
138
+
 
139
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
 
140
+
 
141
+static inline int au_rt_s_files_lock(struct super_block *sb)
 
142
+{
 
143
+       //barrier_lock(&sb->s_barrier);
 
144
+       filevec_add_drain_all();
 
145
+       return 0;
 
146
+}
 
147
+
 
148
+static inline void au_rt_s_files_unlock(struct super_block *sb, int idx)
 
149
+{
 
150
+       //barrier_unlock(&sb->s_barrier);
 
151
+}
 
152
+
 
153
+#define au_rt_s_files_loop(pos, sb) \
 
154
+       lock_list_for_each_entry(pos, &(sb)->s_files, f_u.fu_llist)
 
155
+
 
156
+#define au_rt_s_files_loop_break(pos) \
 
157
+       lock_list_for_each_entry_stop(pos, f_u.fu_llist);
 
158
+
 
159
+static inline unsigned long au_mapping_nrpages(struct address_space *mapping)
 
160
+{
 
161
+       return mapping->nrpages;
 
162
+}
 
163
+
 
164
+#else
 
165
+
 
166
+static inline int au_rt_s_files_lock(struct super_block *sb)
 
167
+{
 
168
+       /* nothing */
 
169
+       return 0;
 
170
+}
 
171
+
 
172
+static inline void au_rt_s_files_unlock(struct super_block *sb, int idx)
 
173
+{
 
174
+       /* nothing */
 
175
+}
 
176
+
 
177
+#define au_rt_s_files_loop(pos, sb) \
 
178
+       list_for_each_entry(pos, &(sb)->s_files, f_u.fu_list)
 
179
+#define au_rt_s_files_loop_break(pos)  do {} while (0)
 
180
+
 
181
+static inline unsigned long au_mapping_nrpages(struct address_space *mapping)
 
182
+{
 
183
+       return mapping->nrpages;
 
184
+}
 
185
+
 
186
+#endif /* LINUX_VERSION_CODE */
 
187
+#endif /* CONFIG_PREEMPT_RT */
 
188
+
 
189
+/* ---------------------------------------------------------------------- */
 
190
+
 
191
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
 
192
 #define I_MUTEX_QUOTA                  0
 
193
 #define lockdep_off()                  do {} while (0)
 
194
@@ -48,7 +184,7 @@
 
195
 /* ---------------------------------------------------------------------- */
 
196
 
 
197
 struct aufs_rwsem {
 
198
-       struct rw_semaphore     rwsem;
 
199
+       struct au_rw_semaphore  rwsem;
 
200
 #ifdef CONFIG_AUFS_DEBUG
 
201
        atomic_t                rcnt;
 
202
 #endif
 
203
@@ -71,64 +207,64 @@
 
204
 static inline void rw_init_nolock(struct aufs_rwsem *rw)
 
205
 {
 
206
        DbgRcntInit(rw);
 
207
-       init_rwsem(&rw->rwsem);
 
208
+       au_init_rwsem(&rw->rwsem);
 
209
 }
 
210
 
 
211
 static inline void rw_init_wlock(struct aufs_rwsem *rw)
 
212
 {
 
213
        rw_init_nolock(rw);
 
214
-       down_write(&rw->rwsem);
 
215
+       au_down_write(&rw->rwsem);
 
216
 }
 
217
 
 
218
 static inline void rw_init_wlock_nested(struct aufs_rwsem *rw, unsigned int lsc)
 
219
 {
 
220
        rw_init_nolock(rw);
 
221
-       down_write_nested(&rw->rwsem, lsc);
 
222
+       au_down_write_nested(&rw->rwsem, lsc);
 
223
 }
 
224
 
 
225
 static inline void rw_read_lock(struct aufs_rwsem *rw)
 
226
 {
 
227
-       down_read(&rw->rwsem);
 
228
+       au_down_read(&rw->rwsem);
 
229
        DbgRcntInc(rw);
 
230
 }
 
231
 
 
232
 static inline void rw_read_lock_nested(struct aufs_rwsem *rw, unsigned int lsc)
 
233
 {
 
234
-       down_read_nested(&rw->rwsem, lsc);
 
235
+       au_down_read_nested(&rw->rwsem, lsc);
 
236
        DbgRcntInc(rw);
 
237
 }
 
238
 
 
239
 static inline void rw_read_unlock(struct aufs_rwsem *rw)
 
240
 {
 
241
        DbgRcntDec(rw);
 
242
-       up_read(&rw->rwsem);
 
243
+       au_up_read(&rw->rwsem);
 
244
 }
 
245
 
 
246
 static inline void rw_dgrade_lock(struct aufs_rwsem *rw)
 
247
 {
 
248
        DbgRcntInc(rw);
 
249
-       downgrade_write(&rw->rwsem);
 
250
+       au_downgrade_write(&rw->rwsem);
 
251
 }
 
252
 
 
253
 static inline void rw_write_lock(struct aufs_rwsem *rw)
 
254
 {
 
255
-       down_write(&rw->rwsem);
 
256
+       au_down_write(&rw->rwsem);
 
257
 }
 
258
 
 
259
 static inline void rw_write_lock_nested(struct aufs_rwsem *rw, unsigned int lsc)
 
260
 {
 
261
-       down_write_nested(&rw->rwsem, lsc);
 
262
+       au_down_write_nested(&rw->rwsem, lsc);
 
263
 }
 
264
 
 
265
 static inline void rw_write_unlock(struct aufs_rwsem *rw)
 
266
 {
 
267
-       up_write(&rw->rwsem);
 
268
+       au_up_write(&rw->rwsem);
 
269
 }
 
270
 
 
271
 /* why is not _nested version defined */
 
272
 static inline int rw_read_trylock(struct aufs_rwsem *rw)
 
273
 {
 
274
-       int ret = down_read_trylock(&rw->rwsem);
 
275
+       int ret = au_down_read_trylock(&rw->rwsem);
 
276
        if (ret)
 
277
                DbgRcntInc(rw);
 
278
        return ret;
 
279
@@ -136,7 +272,7 @@
 
280
 
 
281
 static inline int rw_write_trylock(struct aufs_rwsem *rw)
 
282
 {
 
283
-       return down_write_trylock(&rw->rwsem);
 
284
+       return au_down_write_trylock(&rw->rwsem);
 
285
 }
 
286
 
 
287
 #undef DbgRcntInit
 
288
@@ -145,7 +281,7 @@
 
289
 
 
290
 /* to debug easier, do not make them inlined functions */
 
291
 #define RwMustNoWaiters(rw)    AuDebugOn(!list_empty(&(rw)->rwsem.wait_list))
 
292
-#define RwMustAnyLock(rw)      AuDebugOn(down_write_trylock(&(rw)->rwsem))
 
293
+#define RwMustAnyLock(rw)      AuDebugOn(au_down_write_trylock(&(rw)->rwsem))
 
294
 #ifdef CONFIG_AUFS_DEBUG
 
295
 #define RwMustReadLock(rw) do { \
 
296
        RwMustAnyLock(rw); \