aufs5-base.patch 9.51 KB
Newer Older
J. R. Okajima's avatar
J. R. Okajima committed
1
2
3
4
SPDX-License-Identifier: GPL-2.0
aufs5.x-rcN base patch

diff --git a/MAINTAINERS b/MAINTAINERS
J. R. Okajima's avatar
J. R. Okajima committed
5
index 281de213ef478..ffc3c1c539ea2 100644
J. R. Okajima's avatar
J. R. Okajima committed
6
7
--- a/MAINTAINERS
+++ b/MAINTAINERS
J. R. Okajima's avatar
J. R. Okajima committed
8
@@ -3009,6 +3009,19 @@ F:	include/linux/audit.h
J. R. Okajima's avatar
J. R. Okajima committed
9
10
11
12
13
14
15
 F:	include/uapi/linux/audit.h
 F:	kernel/audit*
 
+AUFS (advanced multi layered unification filesystem) FILESYSTEM
+M:	"J. R. Okajima" <hooanon05g@gmail.com>
+L:	aufs-users@lists.sourceforge.net (members only)
+L:	linux-unionfs@vger.kernel.org
J. R. Okajima's avatar
J. R. Okajima committed
16
+S:	Supported
J. R. Okajima's avatar
J. R. Okajima committed
17
18
19
20
+W:	http://aufs.sourceforge.net
+T:	git://github.com/sfjro/aufs4-linux.git
+F:	Documentation/ABI/testing/debugfs-aufs
+F:	Documentation/ABI/testing/sysfs-aufs
J. R. Okajima's avatar
J. R. Okajima committed
21
+F:	Documentation/filesystems/aufs/
J. R. Okajima's avatar
J. R. Okajima committed
22
23
24
25
26
27
28
+F:	fs/aufs/
+F:	include/uapi/linux/aufs_type.h
+
 AUXILIARY DISPLAY DRIVERS
 M:	Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
 S:	Maintained
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
J. R. Okajima's avatar
J. R. Okajima committed
29
index a58084c2ed7ce..7be7ca3f54547 100644
J. R. Okajima's avatar
J. R. Okajima committed
30
31
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
J. R. Okajima's avatar
J. R. Okajima committed
32
@@ -765,6 +765,24 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
J. R. Okajima's avatar
J. R. Okajima committed
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
 	return error;
 }
 
+/*
+ * for AUFS
+ * no get/put for file.
+ */
+struct file *loop_backing_file(struct super_block *sb)
+{
+	struct file *ret;
+	struct loop_device *l;
+
+	ret = NULL;
+	if (MAJOR(sb->s_dev) == LOOP_MAJOR) {
+		l = sb->s_bdev->bd_disk->private_data;
+		ret = l->lo_backing_file;
+	}
+	return ret;
+}
+EXPORT_SYMBOL_GPL(loop_backing_file);
+
 /* loop sysfs attributes */
 
 static ssize_t loop_attr_show(struct device *dev, char *page,
diff --git a/fs/dcache.c b/fs/dcache.c
J. R. Okajima's avatar
J. R. Okajima committed
58
index ea0485861d937..ddca6240e0db4 100644
J. R. Okajima's avatar
J. R. Okajima committed
59
60
--- a/fs/dcache.c
+++ b/fs/dcache.c
J. R. Okajima's avatar
J. R. Okajima committed
61
@@ -1285,7 +1285,7 @@ enum d_walk_ret {
J. R. Okajima's avatar
J. R. Okajima committed
62
63
64
65
66
67
68
69
70
  *
  * The @enter() callbacks are called with d_lock held.
  */
-static void d_walk(struct dentry *parent, void *data,
+void d_walk(struct dentry *parent, void *data,
 		   enum d_walk_ret (*enter)(void *, struct dentry *))
 {
 	struct dentry *this_parent;
diff --git a/fs/fcntl.c b/fs/fcntl.c
J. R. Okajima's avatar
J. R. Okajima committed
71
index 19ac5baad50fd..073ca6af500f3 100644
J. R. Okajima's avatar
J. R. Okajima committed
72
73
74
75
76
77
78
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -32,7 +32,7 @@
 
 #define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | O_DIRECT | O_NOATIME)
 
-static int setfl(int fd, struct file * filp, unsigned long arg)
J. R. Okajima's avatar
J. R. Okajima committed
79
+int setfl(int fd, struct file *filp, unsigned long arg)
J. R. Okajima's avatar
J. R. Okajima committed
80
81
82
83
84
85
86
87
88
89
90
91
92
 {
 	struct inode * inode = file_inode(filp);
 	int error = 0;
@@ -63,6 +63,8 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
 
 	if (filp->f_op->check_flags)
 		error = filp->f_op->check_flags(arg);
+	if (!error && filp->f_op->setfl)
+		error = filp->f_op->setfl(filp, arg);
 	if (error)
 		return error;
 
diff --git a/fs/inode.c b/fs/inode.c
J. R. Okajima's avatar
J. R. Okajima committed
93
index 9d78c37b00b81..e7f0c614a58f3 100644
J. R. Okajima's avatar
J. R. Okajima committed
94
95
--- a/fs/inode.c
+++ b/fs/inode.c
J. R. Okajima's avatar
J. R. Okajima committed
96
@@ -1770,7 +1770,7 @@ EXPORT_SYMBOL(generic_update_time);
J. R. Okajima's avatar
J. R. Okajima committed
97
98
99
100
101
102
  * This does the actual work of updating an inodes time or version.  Must have
  * had called mnt_want_write() before calling this.
  */
-static int update_time(struct inode *inode, struct timespec64 *time, int flags)
+int update_time(struct inode *inode, struct timespec64 *time, int flags)
 {
J. R. Okajima's avatar
J. R. Okajima committed
103
104
 	if (inode->i_op->update_time)
 		return inode->i_op->update_time(inode, time, flags);
J. R. Okajima's avatar
J. R. Okajima committed
105
diff --git a/fs/namespace.c b/fs/namespace.c
J. R. Okajima's avatar
J. R. Okajima committed
106
index cebaa3e817940..451dee24a546a 100644
J. R. Okajima's avatar
J. R. Okajima committed
107
108
--- a/fs/namespace.c
+++ b/fs/namespace.c
J. R. Okajima's avatar
J. R. Okajima committed
109
@@ -792,6 +792,12 @@ static inline int check_mnt(struct mount *mnt)
J. R. Okajima's avatar
J. R. Okajima committed
110
111
112
113
114
115
116
117
118
119
120
121
122
 	return mnt->mnt_ns == current->nsproxy->mnt_ns;
 }
 
+/* for aufs, CONFIG_AUFS_BR_FUSE */
+int is_current_mnt_ns(struct vfsmount *mnt)
+{
+	return check_mnt(real_mount(mnt));
+}
+
 /*
  * vfsmount lock must be held for write
  */
diff --git a/fs/splice.c b/fs/splice.c
J. R. Okajima's avatar
J. R. Okajima committed
123
index 866d5c2367b23..55b5356262085 100644
J. R. Okajima's avatar
J. R. Okajima committed
124
125
--- a/fs/splice.c
+++ b/fs/splice.c
J. R. Okajima's avatar
J. R. Okajima committed
126
@@ -756,8 +756,8 @@ static int warn_unsupported(struct file *file, const char *op)
J. R. Okajima's avatar
J. R. Okajima committed
127
128
129
130
131
132
133
134
 /*
  * Attempt to initiate a splice from pipe to file.
  */
-static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
-			   loff_t *ppos, size_t len, unsigned int flags)
+long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+		    loff_t *ppos, size_t len, unsigned int flags)
 {
J. R. Okajima's avatar
J. R. Okajima committed
135
136
137
 	if (unlikely(!out->f_op->splice_write))
 		return warn_unsupported(out, "write");
@@ -767,9 +767,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
J. R. Okajima's avatar
J. R. Okajima committed
138
139
140
141
142
143
144
145
146
147
 /*
  * Attempt to initiate a splice from a file to a pipe.
  */
-static long do_splice_to(struct file *in, loff_t *ppos,
-			 struct pipe_inode_info *pipe, size_t len,
-			 unsigned int flags)
+long do_splice_to(struct file *in, loff_t *ppos,
+		  struct pipe_inode_info *pipe, size_t len,
+		  unsigned int flags)
 {
J. R. Okajima's avatar
J. R. Okajima committed
148
149
 	int ret;
 
J. R. Okajima's avatar
J. R. Okajima committed
150
diff --git a/fs/sync.c b/fs/sync.c
J. R. Okajima's avatar
J. R. Okajima committed
151
index 1373a610dc784..b7b5a0a0df6ff 100644
J. R. Okajima's avatar
J. R. Okajima committed
152
153
154
155
156
157
158
159
160
161
162
163
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -28,7 +28,7 @@
  * wait == 1 case since in that case write_inode() functions do
  * sync_dirty_buffer() and thus effectively write one block at a time.
  */
-static int __sync_filesystem(struct super_block *sb, int wait)
+int __sync_filesystem(struct super_block *sb, int wait)
 {
 	if (wait)
 		sync_inodes_sb(sb);
diff --git a/include/linux/fs.h b/include/linux/fs.h
J. R. Okajima's avatar
J. R. Okajima committed
164
index 8667d0cdc71e7..837dd6e727e45 100644
J. R. Okajima's avatar
J. R. Okajima committed
165
166
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
J. R. Okajima's avatar
J. R. Okajima committed
167
@@ -1332,6 +1332,7 @@ extern void fasync_free(struct fasync_struct *);
J. R. Okajima's avatar
J. R. Okajima committed
168
169
170
 /* can be called from interrupts */
 extern void kill_fasync(struct fasync_struct **, int, int);
 
J. R. Okajima's avatar
J. R. Okajima committed
171
+extern int setfl(int fd, struct file *filp, unsigned long arg);
J. R. Okajima's avatar
J. R. Okajima committed
172
173
174
 extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
 extern int f_setown(struct file *filp, unsigned long arg, int force);
 extern void f_delown(struct file *filp);
J. R. Okajima's avatar
J. R. Okajima committed
175
@@ -1843,6 +1844,7 @@ struct file_operations {
J. R. Okajima's avatar
J. R. Okajima committed
176
177
178
179
180
181
182
 	ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
 	unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
 	int (*check_flags)(int);
+	int (*setfl)(struct file *, unsigned long);
 	int (*flock) (struct file *, int, struct file_lock *);
 	ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
 	ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
J. R. Okajima's avatar
J. R. Okajima committed
183
@@ -2328,6 +2330,7 @@ extern int current_umask(void);
J. R. Okajima's avatar
J. R. Okajima committed
184
185
186
187
188
189
190
 extern void ihold(struct inode * inode);
 extern void iput(struct inode *);
 extern int generic_update_time(struct inode *, struct timespec64 *, int);
+extern int update_time(struct inode *, struct timespec64 *, int);
 
 /* /sys/fs */
 extern struct kobject *fs_kobj;
J. R. Okajima's avatar
J. R. Okajima committed
191
@@ -2564,6 +2567,7 @@ static inline bool sb_is_blkdev_sb(struct super_block *sb)
J. R. Okajima's avatar
J. R. Okajima committed
192
 }
J. R. Okajima's avatar
J. R. Okajima committed
193
194
 
 void emergency_thaw_all(void);
J. R. Okajima's avatar
J. R. Okajima committed
195
196
197
198
199
+extern int __sync_filesystem(struct super_block *, int);
 extern int sync_filesystem(struct super_block *);
 extern const struct file_operations def_blk_fops;
 extern const struct file_operations def_chr_fops;
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
J. R. Okajima's avatar
J. R. Okajima committed
200
index f5594879175a6..93bb861981675 100644
J. R. Okajima's avatar
J. R. Okajima committed
201
202
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
J. R. Okajima's avatar
J. R. Okajima committed
203
@@ -241,6 +241,8 @@ static inline int lockdep_match_key(struct lockdep_map *lock,
J. R. Okajima's avatar
J. R. Okajima committed
204
205
206
207
208
209
210
211
 	return lock->key == key;
 }
 
+struct lock_class *lockdep_hlock_class(struct held_lock *hlock);
+
 /*
  * Acquire a lock.
  *
J. R. Okajima's avatar
J. R. Okajima committed
212
@@ -375,6 +377,7 @@ static inline void lockdep_unregister_key(struct lock_class_key *key)
J. R. Okajima's avatar
J. R. Okajima committed
213
214
215
216
217
218
219
220
 
 #define lockdep_depth(tsk)	(0)
 
+#define lockdep_is_held(lock)			(1)
 #define lockdep_is_held_type(l, r)		(1)
 
 #define lockdep_assert_held(l)			do { (void)(l); } while (0)
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h
J. R. Okajima's avatar
J. R. Okajima committed
221
index 8f882f5881e87..6b9808f098435 100644
J. R. Okajima's avatar
J. R. Okajima committed
222
223
--- a/include/linux/mnt_namespace.h
+++ b/include/linux/mnt_namespace.h
J. R. Okajima's avatar
J. R. Okajima committed
224
@@ -7,12 +7,15 @@ struct mnt_namespace;
J. R. Okajima's avatar
J. R. Okajima committed
225
226
 struct fs_struct;
 struct user_namespace;
J. R. Okajima's avatar
J. R. Okajima committed
227
 struct ns_common;
J. R. Okajima's avatar
J. R. Okajima committed
228
229
230
231
232
+struct vfsmount;
 
 extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *,
 		struct user_namespace *, struct fs_struct *);
 extern void put_mnt_ns(struct mnt_namespace *ns);
J. R. Okajima's avatar
J. R. Okajima committed
233
 extern struct ns_common *from_mnt_ns(struct mnt_namespace *);
J. R. Okajima's avatar
J. R. Okajima committed
234
235
236
237
238
239
240
 
+extern int is_current_mnt_ns(struct vfsmount *mnt);
+
 extern const struct file_operations proc_mounts_operations;
 extern const struct file_operations proc_mountinfo_operations;
 extern const struct file_operations proc_mountstats_operations;
diff --git a/include/linux/splice.h b/include/linux/splice.h
J. R. Okajima's avatar
J. R. Okajima committed
241
index a55179fd60fc3..8e21c53cf8831 100644
J. R. Okajima's avatar
J. R. Okajima committed
242
243
--- a/include/linux/splice.h
+++ b/include/linux/splice.h
J. R. Okajima's avatar
J. R. Okajima committed
244
@@ -93,4 +93,10 @@ extern void splice_shrink_spd(struct splice_pipe_desc *);
J. R. Okajima's avatar
J. R. Okajima committed
245
246
247
248
249
250
251
252
253
254
255
 
 extern const struct pipe_buf_operations page_cache_pipe_buf_ops;
 extern const struct pipe_buf_operations default_pipe_buf_ops;
+
+extern long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+			   loff_t *ppos, size_t len, unsigned int flags);
+extern long do_splice_to(struct file *in, loff_t *ppos,
+			 struct pipe_inode_info *pipe, size_t len,
+			 unsigned int flags);
 #endif
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
J. R. Okajima's avatar
J. R. Okajima committed
256
index c1418b47f625a..7f006a47790cf 100644
J. R. Okajima's avatar
J. R. Okajima committed
257
258
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
J. R. Okajima's avatar
J. R. Okajima committed
259
@@ -188,7 +188,7 @@ static
J. R. Okajima's avatar
J. R. Okajima committed
260
 struct lock_class lock_classes[MAX_LOCKDEP_KEYS];
J. R. Okajima's avatar
J. R. Okajima committed
261
 static DECLARE_BITMAP(lock_classes_in_use, MAX_LOCKDEP_KEYS);
J. R. Okajima's avatar
J. R. Okajima committed
262
263
264
265
 
-static inline struct lock_class *hlock_class(struct held_lock *hlock)
+inline struct lock_class *lockdep_hlock_class(struct held_lock *hlock)
 {
J. R. Okajima's avatar
J. R. Okajima committed
266
267
 	unsigned int class_idx = hlock->class_idx;
 
J. R. Okajima's avatar
J. R. Okajima committed
268
@@ -209,6 +209,7 @@ static inline struct lock_class *hlock_class(struct held_lock *hlock)
J. R. Okajima's avatar
J. R. Okajima committed
269
270
 	 */
 	return lock_classes + class_idx;
J. R. Okajima's avatar
J. R. Okajima committed
271
272
273
274
275
 }
+#define hlock_class(hlock) lockdep_hlock_class(hlock)
 
 #ifdef CONFIG_LOCK_STAT
 static DEFINE_PER_CPU(struct lock_class_stats[MAX_LOCKDEP_KEYS], cpu_lock_stats);