aufs5-base.patch 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. SPDX-License-Identifier: GPL-2.0
  2. aufs5.15.41 base patch
  3. diff --git a/MAINTAINERS b/MAINTAINERS
  4. index c8103e57a70b..e1b9eaca78fd 100644
  5. --- a/MAINTAINERS
  6. +++ b/MAINTAINERS
  7. @@ -3122,6 +3122,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 DISPLAY DRIVERS
  24. M: Miguel Ojeda <ojeda@kernel.org>
  25. S: Maintained
  26. diff --git a/drivers/block/loop.c b/drivers/block/loop.c
  27. index 8cba10aafadb..7a9e40b97831 100644
  28. --- a/drivers/block/loop.c
  29. +++ b/drivers/block/loop.c
  30. @@ -799,6 +799,24 @@ static int loop_change_fd(struct loop_device *lo, struct block_device *bdev,
  31. return error;
  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 cf871a81f4fd..bc5095b734f5 100644
  55. --- a/fs/dcache.c
  56. +++ b/fs/dcache.c
  57. @@ -1320,7 +1320,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 9c6c6a3e2de5..02382fa9bd34 100644
  68. --- a/fs/fcntl.c
  69. +++ b/fs/fcntl.c
  70. @@ -33,7 +33,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 long arg)
  73. +int setfl(int fd, struct file *filp, unsigned long 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 long 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 b696543adab8..c45740054bc7 100644
  86. --- a/fs/namespace.c
  87. +++ b/fs/namespace.c
  88. @@ -808,6 +808,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 5dbce4dcc1a7..3e6ba363b777 100644
  102. --- a/fs/splice.c
  103. +++ b/fs/splice.c
  104. @@ -759,8 +759,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. @@ -770,9 +770,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
  116. /*
  117. * Attempt to initiate a splice from a file to a pipe.
  118. */
  119. -static long do_splice_to(struct file *in, loff_t *ppos,
  120. - struct pipe_inode_info *pipe, size_t len,
  121. - unsigned int flags)
  122. +long do_splice_to(struct file *in, loff_t *ppos,
  123. + struct pipe_inode_info *pipe, size_t len,
  124. + unsigned int flags)
  125. {
  126. unsigned int p_space;
  127. int ret;
  128. diff --git a/include/linux/fs.h b/include/linux/fs.h
  129. index 56eba723477e..e60d8ad85400 100644
  130. --- a/include/linux/fs.h
  131. +++ b/include/linux/fs.h
  132. @@ -1381,6 +1381,7 @@ extern void fasync_free(struct fasync_struct *);
  133. /* can be called from interrupts */
  134. extern void kill_fasync(struct fasync_struct **, int, int);
  135. +extern int setfl(int fd, struct file *filp, unsigned long arg);
  136. extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
  137. extern int f_setown(struct file *filp, unsigned long arg, int force);
  138. extern void f_delown(struct file *filp);
  139. @@ -2092,6 +2093,7 @@ struct file_operations {
  140. ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
  141. unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
  142. int (*check_flags)(int);
  143. + int (*setfl)(struct file *, unsigned long);
  144. int (*flock) (struct file *, int, struct file_lock *);
  145. ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
  146. ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
  147. @@ -2615,6 +2617,7 @@ extern int current_umask(void);
  148. extern void ihold(struct inode * inode);
  149. extern void iput(struct inode *);
  150. extern int generic_update_time(struct inode *, struct timespec64 *, int);
  151. +extern int update_time(struct inode *, struct timespec64 *, int);
  152. /* /sys/fs */
  153. extern struct kobject *fs_kobj;
  154. @@ -2778,6 +2781,7 @@ static inline bool sb_is_blkdev_sb(struct super_block *sb)
  155. }
  156. void emergency_thaw_all(void);
  157. +extern int __sync_filesystem(struct super_block *, int);
  158. extern int sync_filesystem(struct super_block *);
  159. extern const struct file_operations def_blk_fops;
  160. extern const struct file_operations def_chr_fops;
  161. diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
  162. index 9fe165beb0f9..e47f7e15eeaf 100644
  163. --- a/include/linux/lockdep.h
  164. +++ b/include/linux/lockdep.h
  165. @@ -248,6 +248,8 @@ static inline int lockdep_match_key(struct lockdep_map *lock,
  166. return lock->key == key;
  167. }
  168. +struct lock_class *lockdep_hlock_class(struct held_lock *hlock);
  169. +
  170. /*
  171. * Acquire a lock.
  172. *
  173. diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h
  174. index 8f882f5881e8..6b9808f09843 100644
  175. --- a/include/linux/mnt_namespace.h
  176. +++ b/include/linux/mnt_namespace.h
  177. @@ -7,12 +7,15 @@ struct mnt_namespace;
  178. struct fs_struct;
  179. struct user_namespace;
  180. struct ns_common;
  181. +struct vfsmount;
  182. extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *,
  183. struct user_namespace *, struct fs_struct *);
  184. extern void put_mnt_ns(struct mnt_namespace *ns);
  185. extern struct ns_common *from_mnt_ns(struct mnt_namespace *);
  186. +extern int is_current_mnt_ns(struct vfsmount *mnt);
  187. +
  188. extern const struct file_operations proc_mounts_operations;
  189. extern const struct file_operations proc_mountinfo_operations;
  190. extern const struct file_operations proc_mountstats_operations;
  191. diff --git a/include/linux/splice.h b/include/linux/splice.h
  192. index a55179fd60fc..8e21c53cf883 100644
  193. --- a/include/linux/splice.h
  194. +++ b/include/linux/splice.h
  195. @@ -93,4 +93,10 @@ extern void splice_shrink_spd(struct splice_pipe_desc *);
  196. extern const struct pipe_buf_operations page_cache_pipe_buf_ops;
  197. extern const struct pipe_buf_operations default_pipe_buf_ops;
  198. +
  199. +extern long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
  200. + loff_t *ppos, size_t len, unsigned int flags);
  201. +extern long do_splice_to(struct file *in, loff_t *ppos,
  202. + struct pipe_inode_info *pipe, size_t len,
  203. + unsigned int flags);
  204. #endif
  205. diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
  206. index a30702b847ba..ce380d0abdf0 100644
  207. --- a/kernel/locking/lockdep.c
  208. +++ b/kernel/locking/lockdep.c
  209. @@ -187,7 +187,7 @@ unsigned long max_lock_class_idx;
  210. struct lock_class lock_classes[MAX_LOCKDEP_KEYS];
  211. DECLARE_BITMAP(lock_classes_in_use, MAX_LOCKDEP_KEYS);
  212. -static inline struct lock_class *hlock_class(struct held_lock *hlock)
  213. +inline struct lock_class *lockdep_hlock_class(struct held_lock *hlock)
  214. {
  215. unsigned int class_idx = hlock->class_idx;
  216. @@ -208,6 +208,7 @@ static inline struct lock_class *hlock_class(struct held_lock *hlock)
  217. */
  218. return lock_classes + class_idx;
  219. }
  220. +#define hlock_class(hlock) lockdep_hlock_class(hlock)
  221. #ifdef CONFIG_LOCK_STAT
  222. static DEFINE_PER_CPU(struct lock_class_stats[MAX_LOCKDEP_KEYS], cpu_lock_stats);