aboutsummaryrefslogtreecommitdiffstats
path: root/features/aufs/aufs6-base.patch
diff options
context:
space:
mode:
Diffstat (limited to 'features/aufs/aufs6-base.patch')
-rw-r--r--features/aufs/aufs6-base.patch230
1 files changed, 230 insertions, 0 deletions
diff --git a/features/aufs/aufs6-base.patch b/features/aufs/aufs6-base.patch
new file mode 100644
index 00000000..186a7cee
--- /dev/null
+++ b/features/aufs/aufs6-base.patch
@@ -0,0 +1,230 @@
+From 884f46eed2730a238e0bf9c9a885f777a612e3ab Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@gmail.com>
+Date: Thu, 21 Sep 2023 17:48:58 -0400
+Subject: [PATCH] aufs6: base
+
+Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
+---
+ MAINTAINERS | 13 +++++++++++++
+ drivers/block/loop.c | 18 ++++++++++++++++++
+ fs/dcache.c | 2 +-
+ fs/fcntl.c | 4 +++-
+ fs/namespace.c | 6 ++++++
+ fs/splice.c | 2 +-
+ include/linux/fs.h | 2 ++
+ include/linux/lockdep.h | 2 ++
+ include/linux/mnt_namespace.h | 3 +++
+ include/linux/splice.h | 6 ++++++
+ kernel/locking/lockdep.c | 3 ++-
+ 11 files changed, 57 insertions(+), 4 deletions(-)
+
+diff --git a/MAINTAINERS b/MAINTAINERS
+index 8d1052fa6a69..39ec86cca0ff 100644
+--- a/MAINTAINERS
++++ b/MAINTAINERS
+@@ -3365,6 +3365,19 @@ F: kernel/audit*
+ F: lib/*audit.c
+ K: \baudit_[a-z_0-9]\+\b
+
++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
++S: Supported
++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
++F: Documentation/filesystems/aufs/
++F: fs/aufs/
++F: include/uapi/linux/aufs_type.h
++
+ AUXILIARY BUS DRIVER
+ M: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+ R: Dave Ertman <david.m.ertman@intel.com>
+diff --git a/drivers/block/loop.c b/drivers/block/loop.c
+index f8145499da38..333b3915fe86 100644
+--- a/drivers/block/loop.c
++++ b/drivers/block/loop.c
+@@ -641,6 +641,24 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
+ goto done;
+ }
+
++/*
++ * 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
+index b813528fb147..78e322b59b8d 100644
+--- a/fs/dcache.c
++++ b/fs/dcache.c
+@@ -1219,7 +1219,7 @@ enum d_walk_ret {
+ *
+ * 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, *dentry;
+diff --git a/fs/fcntl.c b/fs/fcntl.c
+index c80a6acad742..d64817808e40 100644
+--- a/fs/fcntl.c
++++ b/fs/fcntl.c
+@@ -34,7 +34,7 @@
+
+ #define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | O_DIRECT | O_NOATIME)
+
+-static int setfl(int fd, struct file * filp, unsigned int arg)
++int setfl(int fd, struct file *filp, unsigned int arg)
+ {
+ struct inode * inode = file_inode(filp);
+ int error = 0;
+@@ -64,6 +64,8 @@ static int setfl(int fd, struct file * filp, unsigned int 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/namespace.c b/fs/namespace.c
+index 437f60e96d40..4c5eb92d2bef 100644
+--- a/fs/namespace.c
++++ b/fs/namespace.c
+@@ -860,6 +860,12 @@ static inline int check_mnt(struct mount *mnt)
+ 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
+index 218e24b1ac40..7210ddc5aa81 100644
+--- a/fs/splice.c
++++ b/fs/splice.c
+@@ -933,7 +933,7 @@ static int warn_unsupported(struct file *file, const char *op)
+ /*
+ * Attempt to initiate a splice from pipe to file.
+ */
+-static ssize_t do_splice_from(struct pipe_inode_info *pipe, struct file *out,
++ssize_t do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+ loff_t *ppos, size_t len, unsigned int flags)
+ {
+ if (unlikely(!out->f_op->splice_write))
+diff --git a/include/linux/fs.h b/include/linux/fs.h
+index ed5966a70495..2f2919192af6 100644
+--- a/include/linux/fs.h
++++ b/include/linux/fs.h
+@@ -1104,6 +1104,7 @@ extern void fasync_free(struct fasync_struct *);
+ /* can be called from interrupts */
+ extern void kill_fasync(struct fasync_struct **, int, int);
+
++extern int setfl(int fd, struct file *filp, unsigned long arg);
+ extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
+ extern int f_setown(struct file *filp, int who, int force);
+ extern void f_delown(struct file *filp);
+@@ -2001,6 +2002,7 @@ struct file_operations {
+ int (*lock) (struct file *, int, struct file_lock *);
+ 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);
+diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
+index 08b0d1d9d78b..009f69c4e09d 100644
+--- a/include/linux/lockdep.h
++++ b/include/linux/lockdep.h
+@@ -192,6 +192,8 @@ static inline int lockdep_match_key(struct lockdep_map *lock,
+ return lock->key == key;
+ }
+
++struct lock_class *lockdep_hlock_class(struct held_lock *hlock);
++
+ /*
+ * Acquire a lock.
+ *
+diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h
+index 8f882f5881e8..6b9808f09843 100644
+--- a/include/linux/mnt_namespace.h
++++ b/include/linux/mnt_namespace.h
+@@ -7,12 +7,15 @@ struct mnt_namespace;
+ struct fs_struct;
+ struct user_namespace;
+ struct ns_common;
++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);
+ extern struct ns_common *from_mnt_ns(struct mnt_namespace *);
+
++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
+index 9dec4861d09f..8024911403e9 100644
+--- a/include/linux/splice.h
++++ b/include/linux/splice.h
+@@ -108,4 +108,10 @@ extern void splice_shrink_spd(struct splice_pipe_desc *);
+
+ 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
+index 151bd3de5936..2223ee909c10 100644
+--- a/kernel/locking/lockdep.c
++++ b/kernel/locking/lockdep.c
+@@ -218,7 +218,7 @@ unsigned long max_lock_class_idx;
+ struct lock_class lock_classes[MAX_LOCKDEP_KEYS];
+ DECLARE_BITMAP(lock_classes_in_use, MAX_LOCKDEP_KEYS);
+
+-static inline struct lock_class *hlock_class(struct held_lock *hlock)
++inline struct lock_class *lockdep_hlock_class(struct held_lock *hlock)
+ {
+ unsigned int class_idx = hlock->class_idx;
+
+@@ -239,6 +239,7 @@ static inline struct lock_class *hlock_class(struct held_lock *hlock)
+ */
+ return lock_classes + class_idx;
+ }
++#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);
+--
+2.39.2
+