wok-current view linux/stuff/aufs4-base.patch @ rev 25698

Fix ntfs-3g receipt
author Stanislas Leduc <shann@slitaz.org>
date Tue Apr 16 19:01:01 2024 +0000 (2 months ago)
parents
children
line source
1 SPDX-License-Identifier: GPL-2.0
2 aufs4.19 base patch
4 diff --git a/MAINTAINERS b/MAINTAINERS
5 index b2f710eee67a7..8449c695ba0b1 100644
6 --- a/MAINTAINERS
7 +++ b/MAINTAINERS
8 @@ -2605,6 +2605,19 @@ F: include/linux/audit.h
9 F: include/uapi/linux/audit.h
10 F: kernel/audit*
12 +AUFS (advanced multi layered unification filesystem) FILESYSTEM
13 +M: "J. R. Okajima" <hooanon05g@gmail.com>
14 +L: aufs-users@lists.sourceforge.net (members only)
15 +L: linux-unionfs@vger.kernel.org
16 +W: http://aufs.sourceforge.net
17 +T: git://github.com/sfjro/aufs4-linux.git
18 +S: Supported
19 +F: Documentation/filesystems/aufs/
20 +F: Documentation/ABI/testing/debugfs-aufs
21 +F: Documentation/ABI/testing/sysfs-aufs
22 +F: fs/aufs/
23 +F: include/uapi/linux/aufs_type.h
24 +
25 AUXILIARY DISPLAY DRIVERS
26 M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
27 S: Maintained
28 diff --git a/drivers/block/loop.c b/drivers/block/loop.c
29 index ea9debf59b225..9e534a36c5941 100644
30 --- a/drivers/block/loop.c
31 +++ b/drivers/block/loop.c
32 @@ -739,6 +739,24 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
33 return error;
34 }
36 +/*
37 + * for AUFS
38 + * no get/put for file.
39 + */
40 +struct file *loop_backing_file(struct super_block *sb)
41 +{
42 + struct file *ret;
43 + struct loop_device *l;
44 +
45 + ret = NULL;
46 + if (MAJOR(sb->s_dev) == LOOP_MAJOR) {
47 + l = sb->s_bdev->bd_disk->private_data;
48 + ret = l->lo_backing_file;
49 + }
50 + return ret;
51 +}
52 +EXPORT_SYMBOL_GPL(loop_backing_file);
53 +
54 /* loop sysfs attributes */
56 static ssize_t loop_attr_show(struct device *dev, char *page,
57 diff --git a/fs/dcache.c b/fs/dcache.c
58 index 2e7e8d85e9b40..9f57bd87bce5a 100644
59 --- a/fs/dcache.c
60 +++ b/fs/dcache.c
61 @@ -1238,7 +1238,7 @@ enum d_walk_ret {
62 *
63 * The @enter() callbacks are called with d_lock held.
64 */
65 -static void d_walk(struct dentry *parent, void *data,
66 +void d_walk(struct dentry *parent, void *data,
67 enum d_walk_ret (*enter)(void *, struct dentry *))
68 {
69 struct dentry *this_parent;
70 diff --git a/fs/fcntl.c b/fs/fcntl.c
71 index 4137d96534a6c..d4da10be555c9 100644
72 --- a/fs/fcntl.c
73 +++ b/fs/fcntl.c
74 @@ -32,7 +32,7 @@
76 #define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | O_DIRECT | O_NOATIME)
78 -static int setfl(int fd, struct file * filp, unsigned long arg)
79 +int setfl(int fd, struct file *filp, unsigned long arg)
80 {
81 struct inode * inode = file_inode(filp);
82 int error = 0;
83 @@ -63,6 +63,8 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
85 if (filp->f_op->check_flags)
86 error = filp->f_op->check_flags(arg);
87 + if (!error && filp->f_op->setfl)
88 + error = filp->f_op->setfl(filp, arg);
89 if (error)
90 return error;
92 diff --git a/fs/inode.c b/fs/inode.c
93 index 42f6d25f32a52..fa6ae6a217fbd 100644
94 --- a/fs/inode.c
95 +++ b/fs/inode.c
96 @@ -1657,7 +1657,7 @@ EXPORT_SYMBOL(generic_update_time);
97 * This does the actual work of updating an inodes time or version. Must have
98 * had called mnt_want_write() before calling this.
99 */
100 -static int update_time(struct inode *inode, struct timespec64 *time, int flags)
101 +int update_time(struct inode *inode, struct timespec64 *time, int flags)
102 {
103 int (*update_time)(struct inode *, struct timespec64 *, int);
105 diff --git a/fs/namespace.c b/fs/namespace.c
106 index 99186556f8d34..72c93f3e86478 100644
107 --- a/fs/namespace.c
108 +++ b/fs/namespace.c
109 @@ -770,6 +770,12 @@ static inline int check_mnt(struct mount *mnt)
110 return mnt->mnt_ns == current->nsproxy->mnt_ns;
111 }
113 +/* for aufs, CONFIG_AUFS_BR_FUSE */
114 +int is_current_mnt_ns(struct vfsmount *mnt)
115 +{
116 + return check_mnt(real_mount(mnt));
117 +}
118 +
119 /*
120 * vfsmount lock must be held for write
121 */
122 diff --git a/fs/read_write.c b/fs/read_write.c
123 index 8a2737f0d61d3..45e3e7a0d4e64 100644
124 --- a/fs/read_write.c
125 +++ b/fs/read_write.c
126 @@ -489,6 +489,28 @@ ssize_t __vfs_write(struct file *file, const char __user *p, size_t count,
127 return -EINVAL;
128 }
130 +vfs_readf_t vfs_readf(struct file *file)
131 +{
132 + const struct file_operations *fop = file->f_op;
133 +
134 + if (fop->read)
135 + return fop->read;
136 + if (fop->read_iter)
137 + return new_sync_read;
138 + return ERR_PTR(-ENOSYS); /* doesn't have ->read(|_iter)() op */
139 +}
140 +
141 +vfs_writef_t vfs_writef(struct file *file)
142 +{
143 + const struct file_operations *fop = file->f_op;
144 +
145 + if (fop->write)
146 + return fop->write;
147 + if (fop->write_iter)
148 + return new_sync_write;
149 + return ERR_PTR(-ENOSYS); /* doesn't have ->write(|_iter)() op */
150 +}
151 +
152 ssize_t __kernel_write(struct file *file, const void *buf, size_t count, loff_t *pos)
153 {
154 mm_segment_t old_fs;
155 diff --git a/fs/splice.c b/fs/splice.c
156 index b3daa971f5977..1dd7f96b22dc4 100644
157 --- a/fs/splice.c
158 +++ b/fs/splice.c
159 @@ -838,8 +838,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
160 /*
161 * Attempt to initiate a splice from pipe to file.
162 */
163 -static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
164 - loff_t *ppos, size_t len, unsigned int flags)
165 +long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
166 + loff_t *ppos, size_t len, unsigned int flags)
167 {
168 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *,
169 loff_t *, size_t, unsigned int);
170 @@ -855,9 +855,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
171 /*
172 * Attempt to initiate a splice from a file to a pipe.
173 */
174 -static long do_splice_to(struct file *in, loff_t *ppos,
175 - struct pipe_inode_info *pipe, size_t len,
176 - unsigned int flags)
177 +long do_splice_to(struct file *in, loff_t *ppos,
178 + struct pipe_inode_info *pipe, size_t len,
179 + unsigned int flags)
180 {
181 ssize_t (*splice_read)(struct file *, loff_t *,
182 struct pipe_inode_info *, size_t, unsigned int);
183 diff --git a/fs/sync.c b/fs/sync.c
184 index b54e0541ad899..28607828e96f2 100644
185 --- a/fs/sync.c
186 +++ b/fs/sync.c
187 @@ -28,7 +28,7 @@
188 * wait == 1 case since in that case write_inode() functions do
189 * sync_dirty_buffer() and thus effectively write one block at a time.
190 */
191 -static int __sync_filesystem(struct super_block *sb, int wait)
192 +int __sync_filesystem(struct super_block *sb, int wait)
193 {
194 if (wait)
195 sync_inodes_sb(sb);
196 diff --git a/include/linux/fs.h b/include/linux/fs.h
197 index 897eae8faee1b..41da4219febfe 100644
198 --- a/include/linux/fs.h
199 +++ b/include/linux/fs.h
200 @@ -1286,6 +1286,7 @@ extern void fasync_free(struct fasync_struct *);
201 /* can be called from interrupts */
202 extern void kill_fasync(struct fasync_struct **, int, int);
204 +extern int setfl(int fd, struct file *filp, unsigned long arg);
205 extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
206 extern int f_setown(struct file *filp, unsigned long arg, int force);
207 extern void f_delown(struct file *filp);
208 @@ -1747,6 +1748,7 @@ struct file_operations {
209 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
210 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
211 int (*check_flags)(int);
212 + int (*setfl)(struct file *, unsigned long);
213 int (*flock) (struct file *, int, struct file_lock *);
214 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
215 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
216 @@ -1818,6 +1820,12 @@ ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
217 struct iovec *fast_pointer,
218 struct iovec **ret_pointer);
220 +typedef ssize_t (*vfs_readf_t)(struct file *, char __user *, size_t, loff_t *);
221 +typedef ssize_t (*vfs_writef_t)(struct file *, const char __user *, size_t,
222 + loff_t *);
223 +vfs_readf_t vfs_readf(struct file *file);
224 +vfs_writef_t vfs_writef(struct file *file);
225 +
226 extern ssize_t __vfs_read(struct file *, char __user *, size_t, loff_t *);
227 extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);
228 extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *);
229 @@ -2243,6 +2251,7 @@ extern int current_umask(void);
230 extern void ihold(struct inode * inode);
231 extern void iput(struct inode *);
232 extern int generic_update_time(struct inode *, struct timespec64 *, int);
233 +extern int update_time(struct inode *, struct timespec64 *, int);
235 /* /sys/fs */
236 extern struct kobject *fs_kobj;
237 @@ -2530,6 +2539,7 @@ static inline bool sb_is_blkdev_sb(struct super_block *sb)
238 return false;
239 }
240 #endif
241 +extern int __sync_filesystem(struct super_block *, int);
242 extern int sync_filesystem(struct super_block *);
243 extern const struct file_operations def_blk_fops;
244 extern const struct file_operations def_chr_fops;
245 diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
246 index b0d0b51c4d850..f73ffaa0199ee 100644
247 --- a/include/linux/lockdep.h
248 +++ b/include/linux/lockdep.h
249 @@ -313,6 +313,8 @@ static inline int lockdep_match_key(struct lockdep_map *lock,
250 return lock->key == key;
251 }
253 +struct lock_class *lockdep_hlock_class(struct held_lock *hlock);
254 +
255 /*
256 * Acquire a lock.
257 *
258 @@ -439,6 +441,7 @@ struct lockdep_map { };
260 #define lockdep_depth(tsk) (0)
262 +#define lockdep_is_held(lock) (1)
263 #define lockdep_is_held_type(l, r) (1)
265 #define lockdep_assert_held(l) do { (void)(l); } while (0)
266 diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h
267 index 35942084cd40d..24f5fd1a789de 100644
268 --- a/include/linux/mnt_namespace.h
269 +++ b/include/linux/mnt_namespace.h
270 @@ -6,11 +6,14 @@
271 struct mnt_namespace;
272 struct fs_struct;
273 struct user_namespace;
274 +struct vfsmount;
276 extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *,
277 struct user_namespace *, struct fs_struct *);
278 extern void put_mnt_ns(struct mnt_namespace *ns);
280 +extern int is_current_mnt_ns(struct vfsmount *mnt);
281 +
282 extern const struct file_operations proc_mounts_operations;
283 extern const struct file_operations proc_mountinfo_operations;
284 extern const struct file_operations proc_mountstats_operations;
285 diff --git a/include/linux/splice.h b/include/linux/splice.h
286 index 74b4911ac16dd..19789fbea5675 100644
287 --- a/include/linux/splice.h
288 +++ b/include/linux/splice.h
289 @@ -87,4 +87,10 @@ extern void splice_shrink_spd(struct splice_pipe_desc *);
291 extern const struct pipe_buf_operations page_cache_pipe_buf_ops;
292 extern const struct pipe_buf_operations default_pipe_buf_ops;
293 +
294 +extern long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
295 + loff_t *ppos, size_t len, unsigned int flags);
296 +extern long do_splice_to(struct file *in, loff_t *ppos,
297 + struct pipe_inode_info *pipe, size_t len,
298 + unsigned int flags);
299 #endif
300 diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
301 index dd13f865ad40e..fa6f5599a2a5e 100644
302 --- a/kernel/locking/lockdep.c
303 +++ b/kernel/locking/lockdep.c
304 @@ -140,7 +140,7 @@ static struct lock_list list_entries[MAX_LOCKDEP_ENTRIES];
305 unsigned long nr_lock_classes;
306 static struct lock_class lock_classes[MAX_LOCKDEP_KEYS];
308 -static inline struct lock_class *hlock_class(struct held_lock *hlock)
309 +inline struct lock_class *lockdep_hlock_class(struct held_lock *hlock)
310 {
311 if (!hlock->class_idx) {
312 /*
313 @@ -151,6 +151,7 @@ static inline struct lock_class *hlock_class(struct held_lock *hlock)
314 }
315 return lock_classes + hlock->class_idx - 1;
316 }
317 +#define hlock_class(hlock) lockdep_hlock_class(hlock)
319 #ifdef CONFIG_LOCK_STAT
320 static DEFINE_PER_CPU(struct lock_class_stats[MAX_LOCKDEP_KEYS], cpu_lock_stats);