aufs4.18 base patch
authorJ. R. Okajima <hooanon05@yahoo.co.jp>
Tue, 14 Aug 2018 08:10:38 +0000 (17:10 +0900)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 7 Oct 2018 20:57:06 +0000 (21:57 +0100)
Patch headers added by debian/patches/features/all/aufs4/gen-patch

SPDX-License-Identifier: GPL-2.0
aufs4.18 base patch

Gbp-Pq: Topic features/all/aufs4
Gbp-Pq: Name aufs4-base.patch

15 files changed:
MAINTAINERS
drivers/block/loop.c
fs/dcache.c
fs/fcntl.c
fs/inode.c
fs/namespace.c
fs/read_write.c
fs/splice.c
fs/sync.c
include/linux/file.h
include/linux/fs.h
include/linux/lockdep.h
include/linux/mnt_namespace.h
include/linux/splice.h
kernel/locking/lockdep.c

index 544cac829cf4495100a5e4279b4c5962530efdec..aaa1c7aeae419a11385239119a2b784b6ee00847 100644 (file)
@@ -2541,6 +2541,19 @@ F:       include/linux/audit.h
 F:     include/uapi/linux/audit.h
 F:     kernel/audit*
 
+AUFS (advanced multi layered unification filesystem) FILESYSTEM
+M:     "J. R. Okajima" <hooanon05g@gmail.com>
+L:     linux-unionfs@vger.kernel.org
+L:     aufs-users@lists.sourceforge.net (members only)
+W:     http://aufs.sourceforge.net
+T:     git://github.com/sfjro/aufs4-linux.git
+S:     Supported
+F:     Documentation/filesystems/aufs/
+F:     Documentation/ABI/testing/debugfs-aufs
+F:     Documentation/ABI/testing/sysfs-aufs
+F:     fs/aufs/
+F:     include/uapi/linux/aufs_type.h
+
 AUXILIARY DISPLAY DRIVERS
 M:     Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
 S:     Maintained
index 4cb1d1be3cfbc9c14a6129ecdc2de5368ac668c4..5678bf8e0025d4c5f9a2b31f1555c3e2c5a54fc6 100644 (file)
@@ -741,6 +741,24 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
        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,
index d19a0dc46c04c85f946ec2bd5e6bfc06b30ac6f5..52cebe832a6bc4320e79e1094770ccfd24a0114e 100644 (file)
@@ -1238,7 +1238,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;
index 12273b6ea56dbdeb2a2bff0c6846030e4fc9bcd5..545e6868d23657febc1bc54e9356035361b39eeb 100644 (file)
@@ -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)
+int setfl(int fd, struct file * filp, unsigned long arg)
 {
        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;
 
index 8c86c809ca17b30e003913e169626aa42df2e908..af894e7be92183118fd9fd6d6478153e6261c567 100644 (file)
@@ -1649,7 +1649,7 @@ EXPORT_SYMBOL(generic_update_time);
  * 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)
 {
        int (*update_time)(struct inode *, struct timespec64 *, int);
 
index 1949e0939d404a2bd011fcf2c196a34ea85e4d9b..7d5939b320b96b5d7e3b19e446894ab3f805f651 100644 (file)
@@ -856,6 +856,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
  */
index 153f8f690490771208dbff66f458caaa9ec57d22..ccc5bc8f78457668bcc464b5d40752c05c4c70c7 100644 (file)
@@ -489,6 +489,28 @@ ssize_t __vfs_write(struct file *file, const char __user *p, size_t count,
                return -EINVAL;
 }
 
+vfs_readf_t vfs_readf(struct file *file)
+{
+       const struct file_operations *fop = file->f_op;
+
+       if (fop->read)
+               return fop->read;
+       if (fop->read_iter)
+               return new_sync_read;
+       return ERR_PTR(-ENOSYS);
+}
+
+vfs_writef_t vfs_writef(struct file *file)
+{
+       const struct file_operations *fop = file->f_op;
+
+       if (fop->write)
+               return fop->write;
+       if (fop->write_iter)
+               return new_sync_write;
+       return ERR_PTR(-ENOSYS);
+}
+
 ssize_t __kernel_write(struct file *file, const void *buf, size_t count, loff_t *pos)
 {
        mm_segment_t old_fs;
index b3daa971f59771d6adf248a192db7d6e3121b015..1dd7f96b22dc4c4a32818e81d704931d3bc59d31 100644 (file)
@@ -838,8 +838,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
 /*
  * 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)
 {
        ssize_t (*splice_write)(struct pipe_inode_info *, struct file *,
                                loff_t *, size_t, unsigned int);
@@ -855,9 +855,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
 /*
  * 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)
 {
        ssize_t (*splice_read)(struct file *, loff_t *,
                               struct pipe_inode_info *, size_t, unsigned int);
index b54e0541ad89954856f6efb6d17b8a4165b8ee6b..28607828e96f2e2fae21489a1acdcd616c46f349 100644 (file)
--- 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);
index 279720db984af394c90737ed31b8ec09ef73c2ca..76e38eade2255454f923ef66b4c65d591aaed672 100644 (file)
@@ -20,6 +20,7 @@ struct dentry;
 struct path;
 extern struct file *alloc_file(const struct path *, fmode_t mode,
        const struct file_operations *fop);
+extern struct file *get_empty_filp(void);
 
 static inline void fput_light(struct file *file, int fput_needed)
 {
index 805bf22898cf23aefe2dc013bb1ee7e96b5b7685..0d0d247f53a57e3da7cd58bdde8091a3f7f490fc 100644 (file)
@@ -1273,6 +1273,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, unsigned long arg, int force);
 extern void f_delown(struct file *filp);
@@ -1733,6 +1734,7 @@ struct file_operations {
        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);
@@ -1803,6 +1805,12 @@ ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
                              struct iovec *fast_pointer,
                              struct iovec **ret_pointer);
 
+typedef ssize_t (*vfs_readf_t)(struct file *, char __user *, size_t, loff_t *);
+typedef ssize_t (*vfs_writef_t)(struct file *, const char __user *, size_t,
+                               loff_t *);
+vfs_readf_t vfs_readf(struct file *file);
+vfs_writef_t vfs_writef(struct file *file);
+
 extern ssize_t __vfs_read(struct file *, char __user *, size_t, loff_t *);
 extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *);
 extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *);
@@ -2218,6 +2226,7 @@ extern int current_umask(void);
 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;
@@ -2505,6 +2514,7 @@ static inline bool sb_is_blkdev_sb(struct super_block *sb)
        return false;
 }
 #endif
+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;
index 6fc77d4dbdcd242b40432a579c63312bb88b80b7..27e76f0c0b4d23c47dae80d593eea94c16838016 100644 (file)
@@ -313,6 +313,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.
  *
@@ -439,6 +441,7 @@ struct lockdep_map { };
 
 #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)
index 35942084cd40d56cc1bd9f7ccc08be460ad35cc9..24f5fd1a789de5a7062dc1c0ca7a2399043d2424 100644 (file)
@@ -6,11 +6,14 @@
 struct mnt_namespace;
 struct fs_struct;
 struct user_namespace;
+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 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;
index 74b4911ac16dd227921dc0a84acbe83287acba2a..19789fbea56755df030d06c3651caf4f537155c5 100644 (file)
@@ -87,4 +87,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
index 5fa4d3138bf106cd87f822636652c144e846f3aa..720f070cea64c6f977173d5179107d41d55d1a83 100644 (file)
@@ -140,7 +140,7 @@ static struct lock_list list_entries[MAX_LOCKDEP_ENTRIES];
 unsigned long nr_lock_classes;
 static struct lock_class lock_classes[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)
 {
        if (!hlock->class_idx) {
                /*
@@ -151,6 +151,7 @@ static inline struct lock_class *hlock_class(struct held_lock *hlock)
        }
        return lock_classes + hlock->class_idx - 1;
 }
+#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);