aufs6-base.patch 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. SPDX-License-Identifier: GPL-2.0
  2. aufs6.6.63 base patch
  3. diff --git a/MAINTAINERS b/MAINTAINERS
  4. index ae4c0cec5073..2b5edd2836a7 100644
  5. --- a/MAINTAINERS
  6. +++ b/MAINTAINERS
  7. @@ -3334,6 +3334,19 @@ F: include/uapi/linux/audit.h
  8. F: kernel/audit*
  9. F: lib/*audit.c
  10. +AUFS (advanced multi layered unification filesystem) FILESYSTEM
  11. +M: "J. R. Okajima" <hooanon05g@gmail.com>
  12. +L: aufs-users@lists.sourceforge.net (members only)
  13. +L: linux-unionfs@vger.kernel.org
  14. +S: Supported
  15. +W: http://aufs.sourceforge.net
  16. +T: git://github.com/sfjro/aufs4-linux.git
  17. +F: Documentation/ABI/testing/debugfs-aufs
  18. +F: Documentation/ABI/testing/sysfs-aufs
  19. +F: Documentation/filesystems/aufs/
  20. +F: fs/aufs/
  21. +F: include/uapi/linux/aufs_type.h
  22. +
  23. AUXILIARY BUS DRIVER
  24. M: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  25. R: Dave Ertman <david.m.ertman@intel.com>
  26. diff --git a/drivers/block/loop.c b/drivers/block/loop.c
  27. index 886c63599037..73dae3b1bd4e 100644
  28. --- a/drivers/block/loop.c
  29. +++ b/drivers/block/loop.c
  30. @@ -640,6 +640,24 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
  31. goto done;
  32. }
  33. +/*
  34. + * for AUFS
  35. + * no get/put for file.
  36. + */
  37. +struct file *loop_backing_file(struct super_block *sb)
  38. +{
  39. + struct file *ret;
  40. + struct loop_device *l;
  41. +
  42. + ret = NULL;
  43. + if (MAJOR(sb->s_dev) == LOOP_MAJOR) {
  44. + l = sb->s_bdev->bd_disk->private_data;
  45. + ret = l->lo_backing_file;
  46. + }
  47. + return ret;
  48. +}
  49. +EXPORT_SYMBOL_GPL(loop_backing_file);
  50. +
  51. /* loop sysfs attributes */
  52. static ssize_t loop_attr_show(struct device *dev, char *page,
  53. diff --git a/fs/dcache.c b/fs/dcache.c
  54. index 4030c010a768..e2877ac9a1e6 100644
  55. --- a/fs/dcache.c
  56. +++ b/fs/dcache.c
  57. @@ -1350,7 +1350,7 @@ enum d_walk_ret {
  58. *
  59. * The @enter() callbacks are called with d_lock held.
  60. */
  61. -static void d_walk(struct dentry *parent, void *data,
  62. +void d_walk(struct dentry *parent, void *data,
  63. enum d_walk_ret (*enter)(void *, struct dentry *))
  64. {
  65. struct dentry *this_parent;
  66. diff --git a/fs/fcntl.c b/fs/fcntl.c
  67. index 1484f062ee65..1e44fc9b0f70 100644
  68. --- a/fs/fcntl.c
  69. +++ b/fs/fcntl.c
  70. @@ -34,7 +34,7 @@
  71. #define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | O_DIRECT | O_NOATIME)
  72. -static int setfl(int fd, struct file * filp, unsigned int arg)
  73. +int setfl(int fd, struct file * filp, unsigned int arg)
  74. {
  75. struct inode * inode = file_inode(filp);
  76. int error = 0;
  77. @@ -64,6 +64,8 @@ static int setfl(int fd, struct file * filp, unsigned int arg)
  78. if (filp->f_op->check_flags)
  79. error = filp->f_op->check_flags(arg);
  80. + if (!error && filp->f_op->setfl)
  81. + error = filp->f_op->setfl(filp, arg);
  82. if (error)
  83. return error;
  84. diff --git a/fs/namespace.c b/fs/namespace.c
  85. index b4385e2413d5..c9347fc5e14a 100644
  86. --- a/fs/namespace.c
  87. +++ b/fs/namespace.c
  88. @@ -872,6 +872,12 @@ static inline int check_mnt(struct mount *mnt)
  89. return mnt->mnt_ns == current->nsproxy->mnt_ns;
  90. }
  91. +/* for aufs, CONFIG_AUFS_BR_FUSE */
  92. +int is_current_mnt_ns(struct vfsmount *mnt)
  93. +{
  94. + return check_mnt(real_mount(mnt));
  95. +}
  96. +
  97. /*
  98. * vfsmount lock must be held for write
  99. */
  100. diff --git a/fs/splice.c b/fs/splice.c
  101. index d983d375ff11..7216ef993b5f 100644
  102. --- a/fs/splice.c
  103. +++ b/fs/splice.c
  104. @@ -925,8 +925,8 @@ static int warn_unsupported(struct file *file, const char *op)
  105. /*
  106. * Attempt to initiate a splice from pipe to file.
  107. */
  108. -static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
  109. - loff_t *ppos, size_t len, unsigned int flags)
  110. +long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
  111. + loff_t *ppos, size_t len, unsigned int flags)
  112. {
  113. if (unlikely(!out->f_op->splice_write))
  114. return warn_unsupported(out, "write");
  115. diff --git a/include/linux/fs.h b/include/linux/fs.h
  116. index 6c3d86532e3f..c572420129a5 100644
  117. --- a/include/linux/fs.h
  118. +++ b/include/linux/fs.h
  119. @@ -1101,6 +1101,7 @@ extern void fasync_free(struct fasync_struct *);
  120. /* can be called from interrupts */
  121. extern void kill_fasync(struct fasync_struct **, int, int);
  122. +extern int setfl(int fd, struct file *filp, unsigned int arg);
  123. extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
  124. extern int f_setown(struct file *filp, int who, int force);
  125. extern void f_delown(struct file *filp);
  126. @@ -1934,6 +1935,7 @@ struct file_operations {
  127. int (*lock) (struct file *, int, struct file_lock *);
  128. unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
  129. int (*check_flags)(int);
  130. + int (*setfl)(struct file *, unsigned long);
  131. int (*flock) (struct file *, int, struct file_lock *);
  132. ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
  133. ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
  134. diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
  135. index dc2844b071c2..069ffb776c2c 100644
  136. --- a/include/linux/lockdep.h
  137. +++ b/include/linux/lockdep.h
  138. @@ -249,6 +249,8 @@ static inline int lockdep_match_key(struct lockdep_map *lock,
  139. return lock->key == key;
  140. }
  141. +struct lock_class *lockdep_hlock_class(struct held_lock *hlock);
  142. +
  143. /*
  144. * Acquire a lock.
  145. *
  146. diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h
  147. index 8f882f5881e8..6b9808f09843 100644
  148. --- a/include/linux/mnt_namespace.h
  149. +++ b/include/linux/mnt_namespace.h
  150. @@ -7,12 +7,15 @@ struct mnt_namespace;
  151. struct fs_struct;
  152. struct user_namespace;
  153. struct ns_common;
  154. +struct vfsmount;
  155. extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *,
  156. struct user_namespace *, struct fs_struct *);
  157. extern void put_mnt_ns(struct mnt_namespace *ns);
  158. extern struct ns_common *from_mnt_ns(struct mnt_namespace *);
  159. +extern int is_current_mnt_ns(struct vfsmount *mnt);
  160. +
  161. extern const struct file_operations proc_mounts_operations;
  162. extern const struct file_operations proc_mountinfo_operations;
  163. extern const struct file_operations proc_mountstats_operations;
  164. diff --git a/include/linux/splice.h b/include/linux/splice.h
  165. index 6c461573434d..f08de3775987 100644
  166. --- a/include/linux/splice.h
  167. +++ b/include/linux/splice.h
  168. @@ -99,4 +99,7 @@ extern void splice_shrink_spd(struct splice_pipe_desc *);
  169. extern const struct pipe_buf_operations page_cache_pipe_buf_ops;
  170. extern const struct pipe_buf_operations default_pipe_buf_ops;
  171. +
  172. +extern long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
  173. + loff_t *ppos, size_t len, unsigned int flags);
  174. #endif
  175. diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
  176. index 3468d8230e5f..64b9aedbe941 100644
  177. --- a/kernel/locking/lockdep.c
  178. +++ b/kernel/locking/lockdep.c
  179. @@ -218,7 +218,7 @@ unsigned long max_lock_class_idx;
  180. struct lock_class lock_classes[MAX_LOCKDEP_KEYS];
  181. DECLARE_BITMAP(lock_classes_in_use, MAX_LOCKDEP_KEYS);
  182. -static inline struct lock_class *hlock_class(struct held_lock *hlock)
  183. +inline struct lock_class *lockdep_hlock_class(struct held_lock *hlock)
  184. {
  185. unsigned int class_idx = hlock->class_idx;
  186. @@ -239,6 +239,7 @@ static inline struct lock_class *hlock_class(struct held_lock *hlock)
  187. */
  188. return lock_classes + class_idx;
  189. }
  190. +#define hlock_class(hlock) lockdep_hlock_class(hlock)
  191. #ifdef CONFIG_LOCK_STAT
  192. static DEFINE_PER_CPU(struct lock_class_stats[MAX_LOCKDEP_KEYS], cpu_lock_stats);