commit ffb7aa1554478a1263f4c4da6ec6807cc84be73e
Author: Jan RÄ™korajski <[email protected]>
Date:   Wed Jul 8 00:46:30 2015 +0200

    - updated aufs3 patch

 kernel-aufs3.patch | 133 +++++++++++++++++------------------------------------
 1 file changed, 43 insertions(+), 90 deletions(-)
---
diff --git a/kernel-aufs3.patch b/kernel-aufs3.patch
index 556bf98..d979407 100644
--- a/kernel-aufs3.patch
+++ b/kernel-aufs3.patch
@@ -35,19 +35,6 @@ index bdc6e87..349600c 100644
  header-y += auxvec.h
 aufs3.10 base patch
 
-diff --git a/fs/file_table.c b/fs/file_table.c
-index 485dc0e..8db8096 100644
---- a/fs/file_table.c
-+++ b/fs/file_table.c
-@@ -36,7 +36,7 @@ struct files_stat_struct files_stat = {
-       .max_files = NR_FILE
- };
- 
--DEFINE_STATIC_LGLOCK(files_lglock);
-+DEFINE_LGLOCK(files_lglock);
- 
- /* SLAB cache for file structures */
- static struct kmem_cache *filp_cachep __read_mostly;
 diff --git a/fs/inode.c b/fs/inode.c
 index 00d5fc3..f324521 100644
 --- a/fs/inode.c
@@ -118,27 +105,6 @@ index 74575cb..bfc6fb6 100644
  #endif
 aufs3.10 standalone patch
 
-diff --git a/fs/file_table.c b/fs/file_table.c
-index 8db8096..e271e28 100644
---- a/fs/file_table.c
-+++ b/fs/file_table.c
-@@ -37,6 +37,7 @@ struct files_stat_struct files_stat = {
- };
- 
- DEFINE_LGLOCK(files_lglock);
-+EXPORT_SYMBOL(files_lglock);
- 
- /* SLAB cache for file structures */
- static struct kmem_cache *filp_cachep __read_mostly;
-@@ -405,6 +406,8 @@ void file_sb_list_del(struct file *file)
-       }
- }
- 
-+EXPORT_SYMBOL(file_sb_list_del);
-+
- #ifdef CONFIG_SMP
- 
- /*
 diff --git a/fs/inode.c b/fs/inode.c
 index f324521..bff7670 100644
 --- a/fs/inode.c
@@ -1904,7 +1870,7 @@ diff -urN /usr/share/empty/fs/aufs/aufs.h 
linux/fs/aufs/aufs.h
 diff -urN /usr/share/empty/fs/aufs/branch.c linux/fs/aufs/branch.c
 --- /usr/share/empty/fs/aufs/branch.c  1970-01-01 01:00:00.000000000 +0100
 +++ linux/fs/aufs/branch.c     2013-07-30 22:42:55.839613269 +0200
-@@ -0,0 +1,1213 @@
+@@ -0,0 +1,1222 @@
 +/*
 + * Copyright (C) 2005-2013 Junjiro R. Okajima
 + *
@@ -2912,22 +2878,25 @@ diff -urN /usr/share/empty/fs/aufs/branch.c 
linux/fs/aufs/branch.c
 +{
 +      unsigned long long n;
 +      struct file **p, *f;
++      struct au_sphlhead *files;
++      struct au_finfo *finfo;
 +      struct super_block *sb = arg;
 +
 +      n = 0;
 +      p = a;
-+      lg_global_lock(&files_lglock);
-+      do_file_list_for_each_entry(sb, f) {
-+              if (au_fi(f)
-+                  && file_count(f)
++      files = &au_sbi(sb)->si_files;
++      spin_lock(&files->spin);
++      hlist_for_each_entry(finfo, &files->head, fi_hlist) {
++              f = finfo->fi_file;
++              if (file_count(f)
 +                  && !special_file(file_inode(f)->i_mode)) {
 +                      get_file(f);
 +                      *p++ = f;
 +                      n++;
 +                      AuDebugOn(n > max);
 +              }
-+      } while_file_list_for_each_entry;
-+      lg_global_unlock(&files_lglock);
++      }
++      spin_unlock(&files->spin);
 +
 +      return n;
 +}
@@ -3013,7 +2982,13 @@ diff -urN /usr/share/empty/fs/aufs/branch.c 
linux/fs/aufs/branch.c
 +                      continue;
 +
 +              /* todo: already flushed? */
-+              /* cf. fs/super.c:mark_files_ro() */
++              /*
++               * fs/super.c:mark_files_ro() is gone, but aufs keeps its
++               * approach which resets f_mode and calls mnt_drop_write() and
++               * file_release_write() for each file, because the branch
++               * attribute in aufs world is totally different from the native
++               * fs rw/ro mode.
++              */
 +              /* fi_read_lock(file); */
 +              hfile = &au_fi(file)->fi_htop;
 +              hf = hfile->hf_file;
@@ -5465,7 +5440,7 @@ diff -urN /usr/share/empty/fs/aufs/dcsub.c 
linux/fs/aufs/dcsub.c
 +              goto out;
 +
 +      /*
-+       * vfsmount_lock is unnecessary since this is a traverse in a single
++       * RCU for vfsmount is unnecessary since this is a traverse in a single
 +       * mount
 +       */
 +      while (!IS_ROOT(dentry)) {
@@ -9749,9 +9724,9 @@ diff -urN /usr/share/empty/fs/aufs/export.c 
linux/fs/aufs/export.c
 +      };
 +
 +      get_fs_root(current->fs, &root);
-+      br_read_lock(&vfsmount_lock);
++      rcu_read_lock();
 +      err = iterate_mounts(au_compare_mnt, &args, root.mnt);
-+      br_read_unlock(&vfsmount_lock);
++      rcu_read_unlock();
 +      path_put(&root);
 +      AuDebugOn(!err);
 +      AuDebugOn(!args.mnt);
@@ -10987,7 +10962,7 @@ diff -urN /usr/share/empty/fs/aufs/file.c 
linux/fs/aufs/file.c
 diff -urN /usr/share/empty/fs/aufs/file.h linux/fs/aufs/file.h
 --- /usr/share/empty/fs/aufs/file.h    1970-01-01 01:00:00.000000000 +0100
 +++ linux/fs/aufs/file.h       2013-08-23 23:59:39.634916914 +0200
-@@ -0,0 +1,310 @@
+@@ -0,0 +1,313 @@
 +/*
 + * Copyright (C) 2005-2013 Junjiro R. Okajima
 + *
@@ -11052,6 +11027,9 @@ diff -urN /usr/share/empty/fs/aufs/file.h 
linux/fs/aufs/file.h
 +              atomic_t                        fi_mmapped;
 +      };
 +      struct au_fidir         *fi_hdir;       /* for dir only */
++
++      struct hlist_node       fi_hlist;
++      struct file             *fi_file;       /* very ugly */
 +} ____cacheline_aligned_in_smp;
 +
 +/* ---------------------------------------------------------------------- */
@@ -23699,7 +23677,7 @@ diff -urN /usr/share/empty/fs/aufs/rwsem.h 
linux/fs/aufs/rwsem.h
 diff -urN /usr/share/empty/fs/aufs/sbinfo.c linux/fs/aufs/sbinfo.c
 --- /usr/share/empty/fs/aufs/sbinfo.c  1970-01-01 01:00:00.000000000 +0100
 +++ linux/fs/aufs/sbinfo.c     2013-07-06 13:20:47.753531903 +0200
-@@ -0,0 +1,346 @@
+@@ -0,0 +1,348 @@
 +/*
 + * Copyright (C) 2005-2013 Junjiro R. Okajima
 + *
@@ -23815,6 +23793,8 @@ diff -urN /usr/share/empty/fs/aufs/sbinfo.c 
linux/fs/aufs/sbinfo.c
 +      init_waitqueue_head(&sbinfo->si_plink_wq);
 +      spin_lock_init(&sbinfo->si_plink_maint_lock);
 +
++      au_sphl_init(&sbinfo->si_files);
++
 +      /* leave other members for sysaufs and si_mnt. */
 +      sbinfo->si_sb = sb;
 +      sb->s_fs_info = sbinfo;
@@ -25161,7 +25141,7 @@ diff -urN /usr/share/empty/fs/aufs/super.c 
linux/fs/aufs/super.c
 diff -urN /usr/share/empty/fs/aufs/super.h linux/fs/aufs/super.h
 --- /usr/share/empty/fs/aufs/super.h   1970-01-01 01:00:00.000000000 +0100
 +++ linux/fs/aufs/super.h      2013-08-23 23:59:39.638250372 +0200
-@@ -0,0 +1,559 @@
+@@ -0,0 +1,563 @@
 +/*
 + * Copyright (C) 2005-2013 Junjiro R. Okajima
 + *
@@ -25252,7 +25232,8 @@ diff -urN /usr/share/empty/fs/aufs/super.h 
linux/fs/aufs/super.h
 +      } au_si_pid;
 +
 +      /*
-+       * dirty approach to protect sb->sb_inodes and ->s_files from remount.
++       * dirty approach to protect sb->sb_inodes and ->s_files (gone) from
++       * remount.
 +       */
 +      atomic_long_t           si_ninodes, si_nfiles;
 +
@@ -25328,6 +25309,9 @@ diff -urN /usr/share/empty/fs/aufs/super.h 
linux/fs/aufs/super.h
 +      spinlock_t              si_plink_maint_lock;
 +      pid_t                   si_plink_maint_pid;
 +
++      /* file list */
++      struct au_sphlhead      si_files;
++
 +      /*
 +       * sysfs and lifetime management.
 +       * this is not a small structure and it may be a waste of memory in case
@@ -26202,7 +26186,7 @@ diff -urN /usr/share/empty/fs/aufs/sysfs.c 
linux/fs/aufs/sysfs.c
 diff -urN /usr/share/empty/fs/aufs/sysrq.c linux/fs/aufs/sysrq.c
 --- /usr/share/empty/fs/aufs/sysrq.c   1970-01-01 01:00:00.000000000 +0100
 +++ linux/fs/aufs/sysrq.c      2013-07-06 13:20:47.753531903 +0200
-@@ -0,0 +1,151 @@
+@@ -0,0 +1,155 @@
 +/*
 + * Copyright (C) 2005-2013 Junjiro R. Okajima
 + *
@@ -26236,6 +26220,8 @@ diff -urN /usr/share/empty/fs/aufs/sysrq.c 
linux/fs/aufs/sysrq.c
 +      char *plevel;
 +      struct au_sbinfo *sbinfo;
 +      struct file *file;
++      struct au_sphlhead *files;
++      struct au_finfo *finfo;
 +
 +      plevel = au_plevel;
 +      au_plevel = KERN_WARNING;
@@ -26291,14 +26277,16 @@ diff -urN /usr/share/empty/fs/aufs/sysrq.c 
linux/fs/aufs/sysrq.c
 +      }
 +#endif
 +      pr("files\n");
-+      lg_global_lock(&files_lglock);
-+      do_file_list_for_each_entry(sb, file) {
++      files = &au_sbi(sb)->si_files;
++      spin_lock(&files->spin);
++      hlist_for_each_entry(finfo, &files->head, fi_hlist) {
 +              umode_t mode;
++              file = finfo->fi_file;
 +              mode = file_inode(file)->i_mode;
 +              if (!special_file(mode) || au_special_file(mode))
 +                      au_dpri_file(file);
-+      } while_file_list_for_each_entry;
-+      lg_global_unlock(&files_lglock);
++      }
++      spin_unlock(&files->spin);
 +      pr("done\n");
 +
 +#undef pr
@@ -28012,7 +28000,7 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c 
linux/fs/aufs/vfsub.c
 diff -urN /usr/share/empty/fs/aufs/vfsub.h linux/fs/aufs/vfsub.h
 --- /usr/share/empty/fs/aufs/vfsub.h   1970-01-01 01:00:00.000000000 +0100
 +++ linux/fs/aufs/vfsub.h      2013-07-30 22:42:55.842946719 +0200
-@@ -0,0 +1,294 @@
+@@ -0,0 +1,259 @@
 +/*
 + * Copyright (C) 2005-2013 Junjiro R. Okajima
 + *
@@ -28041,49 +28029,14 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.h 
linux/fs/aufs/vfsub.h
 +#ifdef __KERNEL__
 +
 +#include <linux/fs.h>
-+#include <linux/lglock.h>
 +#include <linux/mount.h>
 +#include "debug.h"
 +
 +/* copied from linux/fs/internal.h */
 +/* todo: BAD approach!! */
-+extern struct lglock vfsmount_lock;
 +extern void __mnt_drop_write(struct vfsmount *);
 +extern spinlock_t inode_sb_list_lock;
 +
-+/* copied from linux/fs/file_table.c */
-+extern struct lglock files_lglock;
-+#ifdef CONFIG_SMP
-+/*
-+ * These macros iterate all files on all CPUs for a given superblock.
-+ * files_lglock must be held globally.
-+ */
-+#define do_file_list_for_each_entry(__sb, __file)             \
-+{                                                             \
-+      int i;                                                  \
-+      for_each_possible_cpu(i) {                              \
-+              struct list_head *list;                         \
-+              list = per_cpu_ptr((__sb)->s_files, i);         \
-+              list_for_each_entry((__file), list, f_u.fu_list)
-+
-+#define while_file_list_for_each_entry                                \
-+      }                                                       \
-+}
-+
-+#else
-+
-+#define do_file_list_for_each_entry(__sb, __file)             \
-+{                                                             \
-+      struct list_head *list;                                 \
-+      list = &(sb)->s_files;                                  \
-+      list_for_each_entry((__file), list, f_u.fu_list)
-+
-+#define while_file_list_for_each_entry                                \
-+}
-+#endif
-+
-+/* ---------------------------------------------------------------------- */
-+
 +/* lock subclass for lower inode */
 +/* default MAX_LOCKDEP_SUBCLASSES(8) is not enough */
 +/* reduce? gave up. */
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/kernel.git/commitdiff/ffb7aa1554478a1263f4c4da6ec6807cc84be73e

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to