-aufs3.x-rcN kbuild patch
+aufs3.4 kbuild patch
diff --git a/fs/Kconfig b/fs/Kconfig
-index 5f4c45d..357a8a6 100644
+index f95ae3a..6d8a9a5 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
-@@ -215,6 +215,7 @@ source "fs/pstore/Kconfig"
+@@ -220,6 +220,7 @@ source "fs/pstore/Kconfig"
source "fs/sysv/Kconfig"
source "fs/ufs/Kconfig"
source "fs/exofs/Kconfig"
endif # MISC_FILESYSTEMS
diff --git a/fs/Makefile b/fs/Makefile
-index d2c3353..680ad8a 100644
+index 2fb9779..abefac5 100644
--- a/fs/Makefile
+++ b/fs/Makefile
-@@ -123,3 +123,4 @@ obj-$(CONFIG_GFS2_FS) += gfs2/
+@@ -125,3 +125,4 @@ obj-$(CONFIG_GFS2_FS) += gfs2/
obj-y += exofs/ # Multiple modules
obj-$(CONFIG_CEPH_FS) += ceph/
obj-$(CONFIG_PSTORE) += pstore/
+obj-$(CONFIG_AUFS_FS) += aufs/
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
-index 619b565..29f386b 100644
+index 3c9b616..8704efa 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
-@@ -65,6 +65,7 @@ header-y += atmppp.h
+@@ -66,6 +66,7 @@ header-y += atmppp.h
header-y += atmsap.h
header-y += atmsvc.h
header-y += audit.h
header-y += auto_fs.h
header-y += auto_fs4.h
header-y += auxvec.h
-aufs3.x-rcN base patch
+aufs3.4 base patch
diff --git a/fs/namei.c b/fs/namei.c
-index 5008f01..4cc94cf 100644
+index c427919..7ff959b 100644
--- a/fs/namei.c
+++ b/fs/namei.c
-@@ -1753,7 +1753,7 @@ static struct dentry *__lookup_hash(struct qstr *name,
+@@ -1831,7 +1831,7 @@ int vfs_path_lookup(struct dentry *dentry, struct vfsmount *mnt,
* needs parent already locked. Doesn't follow mounts.
* SMP-safe.
*/
return __lookup_hash(&nd->last, nd->path.dentry, nd);
}
diff --git a/fs/splice.c b/fs/splice.c
-index fa2defa..e3569b0 100644
+index f847684..f871233 100644
--- a/fs/splice.c
+++ b/fs/splice.c
-@@ -1085,8 +1085,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
+@@ -1084,8 +1084,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
/*
* Attempt to initiate a splice from pipe to file.
*/
{
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *,
loff_t *, size_t, unsigned int);
-@@ -1113,9 +1113,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+@@ -1112,9 +1112,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.
*/
+ struct pipe_inode_info *pipe, size_t len,
+ unsigned int flags);
#endif
-aufs3.x-rcN standalone patch
+aufs3.4 standalone patch
diff --git a/fs/file_table.c b/fs/file_table.c
-index c322794..2aad244 100644
+index 70f2a0f..146a3d7 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
-@@ -443,6 +443,8 @@ void file_sb_list_del(struct file *file)
+@@ -442,6 +442,8 @@ void file_sb_list_del(struct file *file)
}
}
/*
diff --git a/fs/inode.c b/fs/inode.c
-index ee4e66b..728042b 100644
+index 9f4f5fe..bb0f3ba 100644
--- a/fs/inode.c
+++ b/fs/inode.c
-@@ -65,6 +65,7 @@ static struct hlist_head *inode_hashtable __read_mostly;
+@@ -56,6 +56,7 @@ static struct hlist_head *inode_hashtable __read_mostly;
static __cacheline_aligned_in_smp DEFINE_SPINLOCK(inode_hash_lock);
__cacheline_aligned_in_smp DEFINE_SPINLOCK(inode_sb_list_lock);
/*
* Empty aops. Can be used for the cases where the user does not
diff --git a/fs/namei.c b/fs/namei.c
-index 4cc94cf..af19e30 100644
+index 7ff959b..b170167 100644
--- a/fs/namei.c
+++ b/fs/namei.c
-@@ -1757,6 +1757,7 @@ struct dentry *lookup_hash(struct nameidata *nd)
+@@ -1835,6 +1835,7 @@ struct dentry *lookup_hash(struct nameidata *nd)
{
return __lookup_hash(&nd->last, nd->path.dentry, nd);
}
/**
* lookup_one_len - filesystem helper to lookup single pathname component
diff --git a/fs/namespace.c b/fs/namespace.c
-index 6d3a196..d832654 100644
+index e608199..38fcc2e 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
-@@ -1509,6 +1509,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
+@@ -1339,6 +1339,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
}
return 0;
}
+EXPORT_SYMBOL(iterate_mounts);
- static void cleanup_group_ids(struct vfsmount *mnt, struct vfsmount *end)
+ static void cleanup_group_ids(struct mount *mnt, struct mount *end)
{
diff --git a/fs/notify/group.c b/fs/notify/group.c
index 63fc294..6f4adca 100644
}
+EXPORT_SYMBOL(fsnotify_alloc_group);
diff --git a/fs/notify/mark.c b/fs/notify/mark.c
-index e14587d..be6533b 100644
+index f104d56..54f36db 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -112,6 +112,7 @@ void fsnotify_put_mark(struct fsnotify_mark *mark)
/*
* Any time a mark is getting freed we end up here.
-@@ -189,6 +190,7 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark)
+@@ -191,6 +192,7 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark)
if (unlikely(atomic_dec_and_test(&group->num_marks)))
fsnotify_final_destroy_group(group);
}
void fsnotify_set_mark_mask_locked(struct fsnotify_mark *mark, __u32 mask)
{
-@@ -276,6 +278,7 @@ err:
+@@ -278,6 +280,7 @@ err:
return ret;
}
/*
* clear any marks in a group in which mark->flags & flags is true
-@@ -331,6 +334,7 @@ void fsnotify_init_mark(struct fsnotify_mark *mark,
+@@ -333,6 +336,7 @@ void fsnotify_init_mark(struct fsnotify_mark *mark,
atomic_set(&mark->refcnt, 1);
mark->free_mark = free_mark;
}
static int fsnotify_mark_destroy(void *ignored)
{
diff --git a/fs/open.c b/fs/open.c
-index 22c41b5..33b4033 100644
+index 5720854..ec59242 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -60,6 +60,7 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
static long do_sys_truncate(const char __user *pathname, loff_t length)
{
diff --git a/fs/splice.c b/fs/splice.c
-index e3569b0..9dc07b7 100644
+index f871233..70f5481 100644
--- a/fs/splice.c
+++ b/fs/splice.c
-@@ -1109,6 +1109,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+@@ -1108,6 +1108,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
return splice_write(pipe, out, ppos, len, flags);
}
/*
* Attempt to initiate a splice from a file to a pipe.
-@@ -1135,6 +1136,7 @@ long do_splice_to(struct file *in, loff_t *ppos,
+@@ -1134,6 +1135,7 @@ long do_splice_to(struct file *in, loff_t *ppos,
return splice_read(in, ppos, pipe, len, flags);
}
/**
* splice_direct_to_actor - splices data directly between two non-pipes
diff --git a/security/commoncap.c b/security/commoncap.c
-index ee4f848..611fd70 100644
+index 71a166a..5d63aac 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
-@@ -975,3 +975,4 @@ int cap_file_mmap(struct file *file, unsigned long reqprot,
+@@ -972,3 +972,4 @@ int cap_file_mmap(struct file *file, unsigned long reqprot,
}
return ret;
}
+EXPORT_SYMBOL(cap_file_mmap);
diff --git a/security/device_cgroup.c b/security/device_cgroup.c
-index 4450fbe..2c437e5 100644
+index c43a332..0c37289 100644
--- a/security/device_cgroup.c
+++ b/security/device_cgroup.c
-@@ -500,6 +500,7 @@ found:
+@@ -7,6 +7,7 @@
+ #include <linux/device_cgroup.h>
+ #include <linux/cgroup.h>
+ #include <linux/ctype.h>
++#include <linux/export.h>
+ #include <linux/list.h>
+ #include <linux/uaccess.h>
+ #include <linux/seq_file.h>
+@@ -499,6 +500,7 @@ found:
return -EPERM;
}
int devcgroup_inode_mknod(int mode, dev_t dev)
{
diff --git a/security/security.c b/security/security.c
-index 0c6cc69..d58ba1b 100644
+index bf619ff..60b996a 100644
--- a/security/security.c
+++ b/security/security.c
-@@ -411,6 +411,7 @@ int security_path_rmdir(struct path *dir, struct dentry *dentry)
+@@ -380,6 +380,7 @@ int security_path_rmdir(struct path *dir, struct dentry *dentry)
return 0;
return security_ops->path_rmdir(dir, dentry);
}
int security_path_unlink(struct path *dir, struct dentry *dentry)
{
-@@ -427,6 +428,7 @@ int security_path_symlink(struct path *dir, struct dentry *dentry,
+@@ -396,6 +397,7 @@ int security_path_symlink(struct path *dir, struct dentry *dentry,
return 0;
return security_ops->path_symlink(dir, dentry, old_name);
}
int security_path_link(struct dentry *old_dentry, struct path *new_dir,
struct dentry *new_dentry)
-@@ -435,6 +437,7 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir,
+@@ -404,6 +406,7 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir,
return 0;
return security_ops->path_link(old_dentry, new_dir, new_dentry);
}
int security_path_rename(struct path *old_dir, struct dentry *old_dentry,
struct path *new_dir, struct dentry *new_dentry)
-@@ -453,6 +456,7 @@ int security_path_truncate(struct path *path)
+@@ -422,6 +425,7 @@ int security_path_truncate(struct path *path)
return 0;
return security_ops->path_truncate(path);
}
+EXPORT_SYMBOL(security_path_truncate);
- int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt,
- mode_t mode)
-@@ -461,6 +465,7 @@ int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt,
+ int security_path_chmod(struct path *path, umode_t mode)
+ {
+@@ -429,6 +433,7 @@ int security_path_chmod(struct path *path, umode_t mode)
return 0;
- return security_ops->path_chmod(dentry, mnt, mode);
+ return security_ops->path_chmod(path, mode);
}
+EXPORT_SYMBOL(security_path_chmod);
int security_path_chown(struct path *path, uid_t uid, gid_t gid)
{
-@@ -468,6 +473,7 @@ int security_path_chown(struct path *path, uid_t uid, gid_t gid)
+@@ -436,6 +441,7 @@ int security_path_chown(struct path *path, uid_t uid, gid_t gid)
return 0;
return security_ops->path_chown(path, uid, gid);
}
int security_path_chroot(struct path *path)
{
-@@ -544,6 +550,7 @@ int security_inode_readlink(struct dentry *dentry)
+@@ -512,6 +518,7 @@ int security_inode_readlink(struct dentry *dentry)
return 0;
return security_ops->inode_readlink(dentry);
}
int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd)
{
-@@ -558,6 +565,7 @@ int security_inode_permission(struct inode *inode, int mask)
+@@ -526,6 +533,7 @@ int security_inode_permission(struct inode *inode, int mask)
return 0;
return security_ops->inode_permission(inode, mask);
}
int security_inode_setattr(struct dentry *dentry, struct iattr *attr)
{
-@@ -673,6 +681,7 @@ int security_file_permission(struct file *file, int mask)
+@@ -641,6 +649,7 @@ int security_file_permission(struct file *file, int mask)
return fsnotify_perm(file, mask);
}
int security_file_alloc(struct file *file)
{
-@@ -700,6 +709,7 @@ int security_file_mmap(struct file *file, unsigned long reqprot,
+@@ -668,6 +677,7 @@ int security_file_mmap(struct file *file, unsigned long reqprot,
return ret;
return ima_file_mmap(file, prot);
}
unsigned long prot)
diff -urN /usr/share/empty/Documentation/ABI/testing/debugfs-aufs linux/Documentation/ABI/testing/debugfs-aufs
--- /usr/share/empty/Documentation/ABI/testing/debugfs-aufs 1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/ABI/testing/debugfs-aufs 2011-08-24 13:30:24.727980364 +0200
++++ linux/Documentation/ABI/testing/debugfs-aufs 2012-05-22 09:06:08.864125478 +0200
@@ -0,0 +1,37 @@
+What: /debug/aufs/si_<id>/
+Date: March 2009
+ will be empty. About XINO files, see the aufs manual.
diff -urN /usr/share/empty/Documentation/ABI/testing/sysfs-aufs linux/Documentation/ABI/testing/sysfs-aufs
--- /usr/share/empty/Documentation/ABI/testing/sysfs-aufs 1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/ABI/testing/sysfs-aufs 2011-08-24 13:30:24.727980364 +0200
++++ linux/Documentation/ABI/testing/sysfs-aufs 2012-05-22 09:06:08.864125478 +0200
@@ -0,0 +1,24 @@
+What: /sys/fs/aufs/si_<id>/
+Date: March 2009
+ will be empty. About XINO files, see the aufs manual.
diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/01intro.txt linux/Documentation/filesystems/aufs/design/01intro.txt
--- /usr/share/empty/Documentation/filesystems/aufs/design/01intro.txt 1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/01intro.txt 2011-08-24 13:30:24.727980364 +0200
++++ linux/Documentation/filesystems/aufs/design/01intro.txt 2012-05-22 09:06:08.864125478 +0200
@@ -0,0 +1,162 @@
+
+# Copyright (C) 2005-2011 Junjiro R. Okajima
+about it. But currently I have implemented it in kernel space.
diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/02struct.txt linux/Documentation/filesystems/aufs/design/02struct.txt
--- /usr/share/empty/Documentation/filesystems/aufs/design/02struct.txt 1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/02struct.txt 2011-08-24 13:30:24.727980364 +0200
++++ linux/Documentation/filesystems/aufs/design/02struct.txt 2012-05-22 09:06:08.864125478 +0200
@@ -0,0 +1,226 @@
+
+# Copyright (C) 2005-2011 Junjiro R. Okajima
+dir, aufs reverts it after copy-up.
diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/03lookup.txt linux/Documentation/filesystems/aufs/design/03lookup.txt
--- /usr/share/empty/Documentation/filesystems/aufs/design/03lookup.txt 1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/03lookup.txt 2011-08-24 13:30:24.727980364 +0200
++++ linux/Documentation/filesystems/aufs/design/03lookup.txt 2012-05-22 09:06:08.864125478 +0200
@@ -0,0 +1,106 @@
+
+# Copyright (C) 2005-2011 Junjiro R. Okajima
+ by over-mounting something (or another method).
diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/04branch.txt linux/Documentation/filesystems/aufs/design/04branch.txt
--- /usr/share/empty/Documentation/filesystems/aufs/design/04branch.txt 1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/04branch.txt 2011-08-24 13:30:24.727980364 +0200
++++ linux/Documentation/filesystems/aufs/design/04branch.txt 2012-05-22 09:06:08.864125478 +0200
@@ -0,0 +1,76 @@
+
+# Copyright (C) 2005-2011 Junjiro R. Okajima
+ same named entry on the upper branch.
diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/05wbr_policy.txt linux/Documentation/filesystems/aufs/design/05wbr_policy.txt
--- /usr/share/empty/Documentation/filesystems/aufs/design/05wbr_policy.txt 1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/05wbr_policy.txt 2011-08-24 13:30:24.727980364 +0200
++++ linux/Documentation/filesystems/aufs/design/05wbr_policy.txt 2012-05-22 09:06:08.864125478 +0200
@@ -0,0 +1,65 @@
+
+# Copyright (C) 2005-2011 Junjiro R. Okajima
+ copyup policy.
diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06mmap.txt linux/Documentation/filesystems/aufs/design/06mmap.txt
--- /usr/share/empty/Documentation/filesystems/aufs/design/06mmap.txt 1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/06mmap.txt 2011-08-24 13:30:24.727980364 +0200
++++ linux/Documentation/filesystems/aufs/design/06mmap.txt 2012-05-22 09:06:08.864125478 +0200
@@ -0,0 +1,47 @@
+
+# Copyright (C) 2005-2011 Junjiro R. Okajima
+switching the approach.
diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/07export.txt linux/Documentation/filesystems/aufs/design/07export.txt
--- /usr/share/empty/Documentation/filesystems/aufs/design/07export.txt 1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/07export.txt 2011-08-24 13:30:24.727980364 +0200
++++ linux/Documentation/filesystems/aufs/design/07export.txt 2012-05-22 09:06:08.864125478 +0200
@@ -0,0 +1,59 @@
+
+# Copyright (C) 2005-2011 Junjiro R. Okajima
+ lookup_one_len(), vfs_getattr(), encode_fh() and others.
diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/08shwh.txt linux/Documentation/filesystems/aufs/design/08shwh.txt
--- /usr/share/empty/Documentation/filesystems/aufs/design/08shwh.txt 1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/08shwh.txt 2011-08-24 13:30:24.727980364 +0200
++++ linux/Documentation/filesystems/aufs/design/08shwh.txt 2012-05-22 09:06:08.864125478 +0200
@@ -0,0 +1,53 @@
+
+# Copyright (C) 2005-2011 Junjiro R. Okajima
+initramfs will use it to replace the old one at the next boot.
diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/10dynop.txt linux/Documentation/filesystems/aufs/design/10dynop.txt
--- /usr/share/empty/Documentation/filesystems/aufs/design/10dynop.txt 1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/10dynop.txt 2011-08-24 13:30:24.727980364 +0200
++++ linux/Documentation/filesystems/aufs/design/10dynop.txt 2012-05-22 09:06:08.864125478 +0200
@@ -0,0 +1,47 @@
+
+# Copyright (C) 2010-2011 Junjiro R. Okajima
+vm_operations_struct for regular files only.
diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/99plan.txt linux/Documentation/filesystems/aufs/design/99plan.txt
--- /usr/share/empty/Documentation/filesystems/aufs/design/99plan.txt 1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/99plan.txt 2011-08-24 13:30:24.727980364 +0200
++++ linux/Documentation/filesystems/aufs/design/99plan.txt 2012-05-22 09:06:08.864125478 +0200
@@ -0,0 +1,96 @@
+
+# Copyright (C) 2005-2011 Junjiro R. Okajima
+Otherwise from /new.
diff -urN /usr/share/empty/Documentation/filesystems/aufs/README linux/Documentation/filesystems/aufs/README
--- /usr/share/empty/Documentation/filesystems/aufs/README 1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/README 2012-01-05 11:00:59.215501779 +0100
-@@ -0,0 +1,328 @@
++++ linux/Documentation/filesystems/aufs/README 2012-05-22 09:06:08.864125478 +0200
+@@ -0,0 +1,330 @@
+
+Aufs3 -- advanced multi layered unification filesystem version 3.x
+http://aufs.sf.net
+
+For (an unreleased) example:
+If you are using "linux-3.10" and the "aufs3.10" branch
-+does not exit in aufs-util repository, then "aufs3.9", "aufs3.8"
++does not exist in aufs-util repository, then "aufs3.9", "aufs3.8"
+or something numerically smaller is the branch for your kernel.
+
+Also you can view all branches by
+ =m or =y.
+- and build your kernel as usual.
+- install the built kernel.
-+- install the header files too by "make headers_install".
++- install the header files too by "make headers_install" to the
++ directory where you specify. By default, it is $PWD/usr.
+- and reboot your system.
+
+2.
+ ./aufs.ko to /lib/modules/... and run depmod -a (or reboot simply).
+ + run "make headers_install" to install the aufs header file (you can
+ specify DESTDIR), or copty ./usr/include/linux/aufs_type.h to
-+ /usr/include/linux or wherever you like.
++ /usr/include/linux or wherever you like. By default, the target
++ directory is $PWD/usr.
+- no need to apply aufs3-kbuild.patch, nor copying source files to your
+ kernel source tree.
+
+Pavel Pronskiy made a donation (2011/2).
+Iridium and Inmarsat satellite phone retailer (www.mailasail.com), Nippy
+ Networks (Ed Wildgoose) made a donation for hardware (2011/3).
-+Max Lekomcev (DOM-TV project) made a donation (2011/7).
++Max Lekomcev (DOM-TV project) made a donation (2011/7, 12 and 2012/3).
+Sam Liddicott made a donation (2011/9).
+
+Thank you very much.
+# End: ;
diff -urN /usr/share/empty/fs/aufs/aufs.h linux/fs/aufs/aufs.h
--- /usr/share/empty/fs/aufs/aufs.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/aufs.h 2011-08-24 13:30:24.731313534 +0200
++++ linux/fs/aufs/aufs.h 2012-05-22 09:06:08.864125478 +0200
@@ -0,0 +1,60 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+#endif /* __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 2011-08-24 13:30:24.731313534 +0200
-@@ -0,0 +1,1170 @@
++++ linux/fs/aufs/branch.c 2012-05-22 09:06:08.864125478 +0200
+@@ -0,0 +1,1169 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ */
+
+#include <linux/compat.h>
-+#include <linux/file.h>
+#include <linux/statfs.h>
+#include "aufs.h"
+
+}
diff -urN /usr/share/empty/fs/aufs/branch.h linux/fs/aufs/branch.h
--- /usr/share/empty/fs/aufs/branch.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/branch.h 2011-10-24 20:51:51.580466925 +0200
-@@ -0,0 +1,232 @@
++++ linux/fs/aufs/branch.h 2012-05-22 09:06:08.864125478 +0200
+@@ -0,0 +1,230 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+
+#ifdef __KERNEL__
+
-+#include <linux/fs.h>
+#include <linux/mount.h>
-+#include <linux/aufs_type.h>
+#include "dynop.h"
+#include "rwsem.h"
+#include "super.h"
+#endif /* __AUFS_BRANCH_H__ */
diff -urN /usr/share/empty/fs/aufs/conf.mk linux/fs/aufs/conf.mk
--- /usr/share/empty/fs/aufs/conf.mk 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/conf.mk 2011-08-24 13:30:24.731313534 +0200
++++ linux/fs/aufs/conf.mk 2012-05-22 09:06:08.864125478 +0200
@@ -0,0 +1,38 @@
+
+AuConfStr = CONFIG_AUFS_FS=${CONFIG_AUFS_FS}
+-include ${srctree}/${src}/conf_priv.mk
diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
--- /usr/share/empty/fs/aufs/cpup.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/cpup.c 2012-01-05 11:00:59.215501779 +0100
-@@ -0,0 +1,1081 @@
++++ linux/fs/aufs/cpup.c 2012-05-22 09:06:08.864125478 +0200
+@@ -0,0 +1,1084 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * copy-up functions, see wbr_policy.c for copy-down
+ */
+
-+#include <linux/file.h>
+#include <linux/fs_stack.h>
+#include <linux/mm.h>
-+#include <linux/uaccess.h>
+#include "aufs.h"
+
+void au_cpup_attr_flags(struct inode *dst, struct inode *src)
+ && au_plink_test(inode))
+ return;
+
++ /*
++ * 0 can happen in revalidating.
++ * h_inode->i_mutex is not held, but it is harmless since once i_nlink
++ * reaches 0, it will never become positive.
++ */
+ set_nlink(inode, h_inode->i_nlink);
+
+ /*
+}
diff -urN /usr/share/empty/fs/aufs/cpup.h linux/fs/aufs/cpup.h
--- /usr/share/empty/fs/aufs/cpup.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/cpup.h 2011-08-24 13:30:24.731313534 +0200
-@@ -0,0 +1,83 @@
++++ linux/fs/aufs/cpup.h 2012-05-22 09:06:08.867458905 +0200
+@@ -0,0 +1,81 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+#ifdef __KERNEL__
+
+#include <linux/path.h>
-+#include <linux/time.h>
-+#include <linux/aufs_type.h>
+
+struct inode;
+struct file;
+#endif /* __AUFS_CPUP_H__ */
diff -urN /usr/share/empty/fs/aufs/dbgaufs.c linux/fs/aufs/dbgaufs.c
--- /usr/share/empty/fs/aufs/dbgaufs.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dbgaufs.c 2012-01-05 11:00:59.215501779 +0100
++++ linux/fs/aufs/dbgaufs.c 2012-05-22 09:06:08.867458905 +0200
@@ -0,0 +1,334 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+}
diff -urN /usr/share/empty/fs/aufs/dbgaufs.h linux/fs/aufs/dbgaufs.h
--- /usr/share/empty/fs/aufs/dbgaufs.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dbgaufs.h 2011-08-24 13:30:24.731313534 +0200
-@@ -0,0 +1,52 @@
++++ linux/fs/aufs/dbgaufs.h 2012-05-22 09:06:08.867458905 +0200
+@@ -0,0 +1,49 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+
+#ifdef __KERNEL__
+
-+#include <linux/init.h>
-+#include <linux/aufs_type.h>
-+
+struct super_block;
+struct au_sbinfo;
+
+#endif /* __DBGAUFS_H__ */
diff -urN /usr/share/empty/fs/aufs/dcsub.c linux/fs/aufs/dcsub.c
--- /usr/share/empty/fs/aufs/dcsub.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dcsub.c 2011-08-24 13:30:24.731313534 +0200
++++ linux/fs/aufs/dcsub.c 2012-05-22 09:06:08.867458905 +0200
@@ -0,0 +1,243 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+}
diff -urN /usr/share/empty/fs/aufs/dcsub.h linux/fs/aufs/dcsub.h
--- /usr/share/empty/fs/aufs/dcsub.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dcsub.h 2011-08-24 13:30:24.731313534 +0200
-@@ -0,0 +1,95 @@
++++ linux/fs/aufs/dcsub.h 2012-05-22 09:06:08.867458905 +0200
+@@ -0,0 +1,94 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+
+#include <linux/dcache.h>
+#include <linux/fs.h>
-+#include <linux/types.h>
+
+struct dentry;
+
+#endif /* __AUFS_DCSUB_H__ */
diff -urN /usr/share/empty/fs/aufs/debug.c linux/fs/aufs/debug.c
--- /usr/share/empty/fs/aufs/debug.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/debug.c 2011-10-24 20:51:51.580466925 +0200
-@@ -0,0 +1,490 @@
++++ linux/fs/aufs/debug.c 2012-05-22 09:06:08.867458905 +0200
+@@ -0,0 +1,489 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * debug print functions
+ */
+
-+#include <linux/module.h>
+#include <linux/vt_kern.h>
+#include "aufs.h"
+
+}
diff -urN /usr/share/empty/fs/aufs/debug.h linux/fs/aufs/debug.h
--- /usr/share/empty/fs/aufs/debug.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/debug.h 2011-08-24 13:30:24.731313534 +0200
-@@ -0,0 +1,252 @@
++++ linux/fs/aufs/debug.h 2012-05-22 09:06:08.867458905 +0200
+@@ -0,0 +1,242 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+
+#ifdef __KERNEL__
+
-+#include <asm/system.h>
-+#include <linux/bug.h>
-+/* #include <linux/err.h> */
-+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/kallsyms.h>
-+/* #include <linux/kernel.h> */
-+#include <linux/delay.h>
-+/* #include <linux/kd.h> */
+#include <linux/sysrq.h>
-+#include <linux/aufs_type.h>
-+
-+#include <asm/system.h>
+
+#ifdef CONFIG_AUFS_DEBUG
+#define AuDebugOn(a) BUG_ON(a)
+#endif /* __AUFS_DEBUG_H__ */
diff -urN /usr/share/empty/fs/aufs/dentry.c linux/fs/aufs/dentry.c
--- /usr/share/empty/fs/aufs/dentry.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dentry.c 2011-08-24 13:30:24.731313534 +0200
++++ linux/fs/aufs/dentry.c 2012-05-22 09:06:08.867458905 +0200
@@ -0,0 +1,1140 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+};
diff -urN /usr/share/empty/fs/aufs/dentry.h linux/fs/aufs/dentry.h
--- /usr/share/empty/fs/aufs/dentry.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dentry.h 2011-08-24 13:30:24.731313534 +0200
-@@ -0,0 +1,238 @@
++++ linux/fs/aufs/dentry.h 2012-05-22 09:06:08.867458905 +0200
+@@ -0,0 +1,237 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+#ifdef __KERNEL__
+
+#include <linux/dcache.h>
-+#include <linux/aufs_type.h>
+#include "rwsem.h"
+
+struct au_hdentry {
+#endif /* __AUFS_DENTRY_H__ */
diff -urN /usr/share/empty/fs/aufs/dinfo.c linux/fs/aufs/dinfo.c
--- /usr/share/empty/fs/aufs/dinfo.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dinfo.c 2011-08-24 13:30:24.731313534 +0200
++++ linux/fs/aufs/dinfo.c 2012-05-22 09:06:08.867458905 +0200
@@ -0,0 +1,543 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+}
diff -urN /usr/share/empty/fs/aufs/dir.c linux/fs/aufs/dir.c
--- /usr/share/empty/fs/aufs/dir.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dir.c 2012-01-05 11:00:59.215501779 +0100
-@@ -0,0 +1,635 @@
++++ linux/fs/aufs/dir.c 2012-05-22 09:06:08.867458905 +0200
+@@ -0,0 +1,636 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * directory operations
+ */
+
-+#include <linux/file.h>
+#include <linux/fs_stack.h>
+#include "aufs.h"
+
+ nlink += h_dir->i_nlink - 2;
+ if (h_dir->i_nlink < 2)
+ nlink += 2;
++ /* 0 can happen in revaliding */
+ set_nlink(dir, nlink);
+}
+
+ nlink -= h_dir->i_nlink - 2;
+ if (h_dir->i_nlink < 2)
+ nlink -= 2;
++ /* nlink == 0 means the branch-fs is broken */
+ set_nlink(dir, nlink);
+}
+
+};
diff -urN /usr/share/empty/fs/aufs/dir.h linux/fs/aufs/dir.h
--- /usr/share/empty/fs/aufs/dir.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dir.h 2011-08-24 13:30:24.731313534 +0200
-@@ -0,0 +1,138 @@
++++ linux/fs/aufs/dir.h 2012-05-22 09:06:08.867458905 +0200
+@@ -0,0 +1,137 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+#ifdef __KERNEL__
+
+#include <linux/fs.h>
-+#include <linux/aufs_type.h>
+
+/* ---------------------------------------------------------------------- */
+
+#endif /* __AUFS_DIR_H__ */
diff -urN /usr/share/empty/fs/aufs/dynop.c linux/fs/aufs/dynop.c
--- /usr/share/empty/fs/aufs/dynop.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dynop.c 2011-08-24 13:30:24.731313534 +0200
++++ linux/fs/aufs/dynop.c 2012-05-22 09:06:08.867458905 +0200
@@ -0,0 +1,377 @@
+/*
-+ * Copyright (C) 2010-2011 Junjiro R. Okajima
++ * Copyright (C) 2010-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+}
diff -urN /usr/share/empty/fs/aufs/dynop.h linux/fs/aufs/dynop.h
--- /usr/share/empty/fs/aufs/dynop.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dynop.h 2011-08-24 13:30:24.731313534 +0200
-@@ -0,0 +1,80 @@
++++ linux/fs/aufs/dynop.h 2012-05-22 09:06:08.867458905 +0200
+@@ -0,0 +1,76 @@
+/*
-+ * Copyright (C) 2010-2011 Junjiro R. Okajima
++ * Copyright (C) 2010-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+
+#ifdef __KERNEL__
+
-+#include <linux/fs.h>
-+#include <linux/mm.h>
-+#include <linux/rcupdate.h>
-+#include <linux/aufs_type.h>
+#include "inode.h"
+
+enum {AuDy_AOP, AuDyLast};
+#endif /* __AUFS_DYNOP_H__ */
diff -urN /usr/share/empty/fs/aufs/export.c linux/fs/aufs/export.c
--- /usr/share/empty/fs/aufs/export.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/export.c 2011-08-24 13:30:24.731313534 +0200
-@@ -0,0 +1,805 @@
++++ linux/fs/aufs/export.c 2012-05-22 09:06:08.867458905 +0200
+@@ -0,0 +1,803 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ */
+
+#include <linux/exportfs.h>
-+#include <linux/file.h>
-+#include <linux/mnt_namespace.h>
++#include <linux/fs_struct.h>
+#include <linux/namei.h>
+#include <linux/nsproxy.h>
+#include <linux/random.h>
+#include <linux/writeback.h>
++#include "../fs/mount.h"
+#include "aufs.h"
+
+union conv {
+static struct vfsmount *au_mnt_get(struct super_block *sb)
+{
+ int err;
++ struct path root;
+ struct au_compare_mnt_args args = {
+ .sb = sb
+ };
-+ struct mnt_namespace *ns;
+
++ get_fs_root(current->fs, &root);
+ br_read_lock(vfsmount_lock);
-+ /* no get/put ?? */
-+ AuDebugOn(!current->nsproxy);
-+ ns = current->nsproxy->mnt_ns;
-+ AuDebugOn(!ns);
-+ err = iterate_mounts(au_compare_mnt, &args, ns->root);
++ err = iterate_mounts(au_compare_mnt, &args, root.mnt);
+ br_read_unlock(vfsmount_lock);
++ path_put(&root);
+ AuDebugOn(!err);
+ AuDebugOn(!args.mnt);
+ return args.mnt;
+}
diff -urN /usr/share/empty/fs/aufs/file.c linux/fs/aufs/file.c
--- /usr/share/empty/fs/aufs/file.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/file.c 2011-08-24 13:30:24.731313534 +0200
++++ linux/fs/aufs/file.c 2012-05-22 09:06:08.867458905 +0200
@@ -0,0 +1,676 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * handling file/dir, and address_space operation
+ */
+
-+#include <linux/file.h>
-+#include <linux/fsnotify.h>
-+#include <linux/namei.h>
++#ifdef CONFIG_AUFS_DEBUG
++#include <linux/migrate.h>
++#endif
+#include <linux/pagemap.h>
+#include "aufs.h"
+
+static int aufs_releasepage(struct page *page, gfp_t gfp)
+{ AuUnsupport(); return 0; }
+static int aufs_migratepage(struct address_space *mapping, struct page *newpage,
-+ struct page *page)
++ struct page *page, enum migrate_mode mode)
+{ AuUnsupport(); return 0; }
+static int aufs_launder_page(struct page *page)
+{ AuUnsupport(); return 0; }
+};
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 2011-08-24 13:30:24.731313534 +0200
-@@ -0,0 +1,299 @@
++++ linux/fs/aufs/file.h 2012-05-22 09:06:08.867458905 +0200
+@@ -0,0 +1,298 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+#include <linux/file.h>
+#include <linux/fs.h>
+#include <linux/poll.h>
-+#include <linux/aufs_type.h>
+#include "rwsem.h"
+
+struct au_branch;
+#endif /* __AUFS_FILE_H__ */
diff -urN /usr/share/empty/fs/aufs/finfo.c linux/fs/aufs/finfo.c
--- /usr/share/empty/fs/aufs/finfo.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/finfo.c 2012-01-05 11:00:59.215501779 +0100
-@@ -0,0 +1,157 @@
++++ linux/fs/aufs/finfo.c 2012-05-22 09:06:08.867458905 +0200
+@@ -0,0 +1,156 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * file private data
+ */
+
-+#include <linux/file.h>
+#include "aufs.h"
+
+void au_hfput(struct au_hfile *hf, struct file *file)
+}
diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
--- /usr/share/empty/fs/aufs/f_op.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/f_op.c 2012-01-05 11:00:59.215501779 +0100
-@@ -0,0 +1,731 @@
++++ linux/fs/aufs/f_op.c 2012-05-22 09:06:08.867458905 +0200
+@@ -0,0 +1,729 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * file and vm operations
+ */
+
-+#include <linux/file.h>
+#include <linux/fs_stack.h>
+#include <linux/mman.h>
-+#include <linux/mm.h>
+#include <linux/security.h>
+#include "aufs.h"
+
+};
diff -urN /usr/share/empty/fs/aufs/f_op_sp.c linux/fs/aufs/f_op_sp.c
--- /usr/share/empty/fs/aufs/f_op_sp.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/f_op_sp.c 2011-08-24 13:30:24.731313534 +0200
-@@ -0,0 +1,299 @@
++++ linux/fs/aufs/f_op_sp.c 2012-05-22 09:06:08.867458905 +0200
+@@ -0,0 +1,298 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * their file I/O is handled out of aufs.
+ */
+
-+#include <linux/fs_stack.h>
+#include "aufs.h"
+
+static ssize_t aufs_aio_read_sp(struct kiocb *kio, const struct iovec *iov,
+}
diff -urN /usr/share/empty/fs/aufs/fstype.h linux/fs/aufs/fstype.h
--- /usr/share/empty/fs/aufs/fstype.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/fstype.h 2011-08-24 13:30:24.731313534 +0200
-@@ -0,0 +1,497 @@
++++ linux/fs/aufs/fstype.h 2012-05-22 09:06:08.867458905 +0200
+@@ -0,0 +1,496 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+#include <linux/fs.h>
+#include <linux/magic.h>
+#include <linux/romfs_fs.h>
-+#include <linux/aufs_type.h>
+
+static inline int au_test_aufs(struct super_block *sb)
+{
+#endif /* __AUFS_FSTYPE_H__ */
diff -urN /usr/share/empty/fs/aufs/hfsnotify.c linux/fs/aufs/hfsnotify.c
--- /usr/share/empty/fs/aufs/hfsnotify.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/hfsnotify.c 2011-08-24 13:30:24.731313534 +0200
-@@ -0,0 +1,247 @@
++++ linux/fs/aufs/hfsnotify.c 2012-05-22 09:06:08.867458905 +0200
+@@ -0,0 +1,260 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+static const __u32 AuHfsnMask = (FS_MOVED_TO | FS_MOVED_FROM | FS_DELETE
+ | FS_CREATE | FS_EVENT_ON_CHILD);
+static DECLARE_WAIT_QUEUE_HEAD(au_hfsn_wq);
++static __cacheline_aligned_in_smp atomic64_t au_hfsn_ifree = ATOMIC64_INIT(0);
+
+static void au_hfsn_free_mark(struct fsnotify_mark *mark)
+{
+ struct au_hnotify *hn = container_of(mark, struct au_hnotify,
+ hn_mark);
+ AuDbg("here\n");
-+ hn->hn_mark_dead = 1;
-+ smp_mb();
-+ wake_up_all(&au_hfsn_wq);
++ au_cache_free_hnotify(hn);
++ smp_mb__before_atomic_dec();
++ atomic64_dec(&au_hfsn_ifree);
++ wake_up(&au_hfsn_wq);
+}
+
+static int au_hfsn_alloc(struct au_hinode *hinode)
+ sb = hn->hn_aufs_inode->i_sb;
+ bindex = au_br_index(sb, hinode->hi_id);
+ br = au_sbr(sb, bindex);
-+ hn->hn_mark_dead = 0;
+ mark = &hn->hn_mark;
+ fsnotify_init_mark(mark, au_hfsn_free_mark);
+ mark->mask = AuHfsnMask;
+ /*mnt*/NULL, /*allow_dups*/1);
+}
+
-+static void au_hfsn_free(struct au_hinode *hinode)
++static int au_hfsn_free(struct au_hinode *hinode, struct au_hnotify *hn)
+{
-+ struct au_hnotify *hn;
+ struct fsnotify_mark *mark;
++ unsigned long long ull;
++
++ ull = atomic64_inc_return(&au_hfsn_ifree);
++ BUG_ON(!ull);
+
-+ hn = hinode->hi_notify;
+ mark = &hn->hn_mark;
+ fsnotify_destroy_mark(mark);
+ fsnotify_put_mark(mark);
+
-+ /* TODO: bad approach */
-+ wait_event(au_hfsn_wq, hn->hn_mark_dead);
++ /* free hn by myself */
++ return 0;
+}
+
+/* ---------------------------------------------------------------------- */
+ return err;
+}
+
++/* ---------------------------------------------------------------------- */
++
++static void au_hfsn_fin(void)
++{
++ AuDbg("au_hfsn_ifree %lld\n", (long long)atomic64_read(&au_hfsn_ifree));
++ wait_event(au_hfsn_wq, !atomic64_read(&au_hfsn_ifree));
++}
++
+const struct au_hnotify_op au_hnotify_op = {
+ .ctl = au_hfsn_ctl,
+ .alloc = au_hfsn_alloc,
+ .free = au_hfsn_free,
+
++ .fin = au_hfsn_fin,
++
+ .reset_br = au_hfsn_reset_br,
+ .fin_br = au_hfsn_fin_br,
+ .init_br = au_hfsn_init_br
+};
diff -urN /usr/share/empty/fs/aufs/hfsplus.c linux/fs/aufs/hfsplus.c
--- /usr/share/empty/fs/aufs/hfsplus.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/hfsplus.c 2011-08-24 13:30:24.731313534 +0200
-@@ -0,0 +1,58 @@
++++ linux/fs/aufs/hfsplus.c 2012-05-22 09:06:08.867458905 +0200
+@@ -0,0 +1,57 @@
+/*
-+ * Copyright (C) 2010-2011 Junjiro R. Okajima
++ * Copyright (C) 2010-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * and au_h_open_post() after releasing it.
+ */
+
-+#include <linux/file.h>
+#include "aufs.h"
+
+struct file *au_h_open_pre(struct dentry *dentry, aufs_bindex_t bindex)
+}
diff -urN /usr/share/empty/fs/aufs/hnotify.c linux/fs/aufs/hnotify.c
--- /usr/share/empty/fs/aufs/hnotify.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/hnotify.c 2011-08-24 13:30:24.731313534 +0200
++++ linux/fs/aufs/hnotify.c 2012-05-22 09:06:08.867458905 +0200
@@ -0,0 +1,712 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+
+ hn = hinode->hi_notify;
+ if (hn) {
-+ au_hnotify_op.free(hinode);
-+ au_cache_free_hnotify(hn);
+ hinode->hi_notify = NULL;
++ if (au_hnotify_op.free(hinode, hn))
++ au_cache_free_hnotify(hn);
+ }
+}
+
+}
diff -urN /usr/share/empty/fs/aufs/iinfo.c linux/fs/aufs/iinfo.c
--- /usr/share/empty/fs/aufs/iinfo.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/iinfo.c 2011-08-24 13:30:24.734646739 +0200
++++ linux/fs/aufs/iinfo.c 2012-05-22 09:06:08.867458905 +0200
@@ -0,0 +1,264 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+}
diff -urN /usr/share/empty/fs/aufs/inode.c linux/fs/aufs/inode.c
--- /usr/share/empty/fs/aufs/inode.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/inode.c 2011-08-24 13:30:24.734646739 +0200
++++ linux/fs/aufs/inode.c 2012-05-22 09:06:08.870792417 +0200
@@ -0,0 +1,471 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+}
diff -urN /usr/share/empty/fs/aufs/inode.h linux/fs/aufs/inode.h
--- /usr/share/empty/fs/aufs/inode.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/inode.h 2011-08-24 13:30:24.734646739 +0200
-@@ -0,0 +1,556 @@
++++ linux/fs/aufs/inode.h 2012-05-22 09:06:08.870792417 +0200
+@@ -0,0 +1,560 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+
+#ifdef __KERNEL__
+
-+#include <linux/fs.h>
+#include <linux/fsnotify.h>
-+#include <linux/aufs_type.h>
+#include "rwsem.h"
+
+struct vfsmount;
+#ifdef CONFIG_AUFS_HFSNOTIFY
+ /* never use fsnotify_add_vfsmount_mark() */
+ struct fsnotify_mark hn_mark;
-+ int hn_mark_dead;
+#endif
+ struct inode *hn_aufs_inode; /* no get/put */
+#endif
+/* i_op_add.c */
+int au_may_add(struct dentry *dentry, aufs_bindex_t bindex,
+ struct dentry *h_parent, int isdir);
-+int aufs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev);
++int aufs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode,
++ dev_t dev);
+int aufs_symlink(struct inode *dir, struct dentry *dentry, const char *symname);
-+int aufs_create(struct inode *dir, struct dentry *dentry, int mode,
++int aufs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
+ struct nameidata *nd);
+int aufs_link(struct dentry *src_dentry, struct inode *dir,
+ struct dentry *dentry);
-+int aufs_mkdir(struct inode *dir, struct dentry *dentry, int mode);
++int aufs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode);
+
+/* i_op_del.c */
+int au_wr_dir_need_wh(struct dentry *dentry, int isdir, aufs_bindex_t *bcpup);
+struct au_hnotify_op {
+ void (*ctl)(struct au_hinode *hinode, int do_set);
+ int (*alloc)(struct au_hinode *hinode);
-+ void (*free)(struct au_hinode *hinode);
++
++ /*
++ * if it returns true, the the caller should free hinode->hi_notify,
++ * otherwise ->free() frees it.
++ */
++ int (*free)(struct au_hinode *hinode,
++ struct au_hnotify *hn) __must_check;
+
+ void (*fin)(void);
+ int (*init)(void);
+#endif /* __AUFS_INODE_H__ */
diff -urN /usr/share/empty/fs/aufs/ioctl.c linux/fs/aufs/ioctl.c
--- /usr/share/empty/fs/aufs/ioctl.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/ioctl.c 2011-10-24 20:51:51.580466925 +0200
-@@ -0,0 +1,197 @@
++++ linux/fs/aufs/ioctl.c 2012-05-22 09:06:08.870792417 +0200
+@@ -0,0 +1,196 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * assist the pathconf(3) wrapper library.
+ */
+
-+#include <linux/file.h>
+#include "aufs.h"
+
+static int au_wbr_fd(struct path *path, struct aufs_wbr_fd __user *arg)
+#endif
diff -urN /usr/share/empty/fs/aufs/i_op_add.c linux/fs/aufs/i_op_add.c
--- /usr/share/empty/fs/aufs/i_op_add.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/i_op_add.c 2011-10-24 20:51:51.580466925 +0200
-@@ -0,0 +1,711 @@
++++ linux/fs/aufs/i_op_add.c 2012-05-22 09:06:08.867458905 +0200
+@@ -0,0 +1,712 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ int type;
+ union {
+ struct {
-+ int mode;
++ umode_t mode;
+ struct nameidata *nd;
+ } c;
+ struct {
+ const char *symname;
+ } s;
+ struct {
-+ int mode;
++ umode_t mode;
+ dev_t dev;
+ } m;
+ } u;
+ return err;
+}
+
-+int aufs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
++int aufs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode,
++ dev_t dev)
+{
+ struct simple_arg arg = {
+ .type = Mknod,
+ return add_simple(dir, dentry, &arg);
+}
+
-+int aufs_create(struct inode *dir, struct dentry *dentry, int mode,
++int aufs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
+ struct nameidata *nd)
+{
+ struct simple_arg arg = {
+ return err;
+}
+
-+int aufs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
++int aufs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
+{
+ int err, rerr;
+ aufs_bindex_t bindex;
+}
diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
--- /usr/share/empty/fs/aufs/i_op.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/i_op.c 2012-01-05 11:00:59.215501779 +0100
-@@ -0,0 +1,994 @@
++++ linux/fs/aufs/i_op.c 2012-05-22 09:06:08.867458905 +0200
+@@ -0,0 +1,993 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+#include <linux/mm.h>
+#include <linux/namei.h>
+#include <linux/security.h>
-+#include <linux/uaccess.h>
+#include "aufs.h"
+
+static int h_permission(struct inode *h_inode, int mask,
+ a->h_path.mnt = au_sbr_mnt(sb, a->btgt);
+ if ((ia->ia_valid & (ATTR_MODE | ATTR_CTIME))
+ == (ATTR_MODE | ATTR_CTIME)) {
-+ err = security_path_chmod(a->h_path.dentry, a->h_path.mnt,
-+ ia->ia_mode);
++ err = security_path_chmod(&a->h_path, ia->ia_mode);
+ if (unlikely(err))
+ goto out_unlock;
+ } else if ((ia->ia_valid & (ATTR_UID | ATTR_GID))
+ n = inode->i_nlink;
+ n -= nlink;
+ n += st->nlink;
++ /* 0 can happen */
+ set_nlink(inode, n);
+ }
+
+};
diff -urN /usr/share/empty/fs/aufs/i_op_del.c linux/fs/aufs/i_op_del.c
--- /usr/share/empty/fs/aufs/i_op_del.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/i_op_del.c 2011-08-24 13:30:24.731313534 +0200
++++ linux/fs/aufs/i_op_del.c 2012-05-22 09:06:08.867458905 +0200
@@ -0,0 +1,478 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+}
diff -urN /usr/share/empty/fs/aufs/i_op_ren.c linux/fs/aufs/i_op_ren.c
--- /usr/share/empty/fs/aufs/i_op_ren.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/i_op_ren.c 2011-08-24 13:30:24.734646739 +0200
-@@ -0,0 +1,1017 @@
++++ linux/fs/aufs/i_op_ren.c 2012-05-22 09:06:08.867458905 +0200
+@@ -0,0 +1,1026 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ } else if (unlikely(d_unhashed(a->dst_dentry)))
+ goto out_unlock;
+
++ /*
++ * is it possible?
++ * yes, it happend (in linux-3.3-rcN) but I don't know why.
++ * there may exist a problem somewhere else.
++ */
++ err = -EINVAL;
++ if (unlikely(a->dst_parent->d_inode == a->src_dentry->d_inode))
++ goto out_unlock;
++
+ au_fset_ren(a->flags, ISSAMEDIR); /* temporary */
+ di_write_lock_parent(a->dst_parent);
+
+}
diff -urN /usr/share/empty/fs/aufs/Kconfig linux/fs/aufs/Kconfig
--- /usr/share/empty/fs/aufs/Kconfig 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/Kconfig 2011-08-24 13:30:24.727980364 +0200
++++ linux/fs/aufs/Kconfig 2012-05-22 09:06:08.864125478 +0200
@@ -0,0 +1,203 @@
+config AUFS_FS
+ tristate "Aufs (Advanced multi layered unification filesystem) support"
+endif
diff -urN /usr/share/empty/fs/aufs/loop.c linux/fs/aufs/loop.c
--- /usr/share/empty/fs/aufs/loop.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/loop.c 2011-08-24 13:30:24.734646739 +0200
++++ linux/fs/aufs/loop.c 2012-05-22 09:06:08.870792417 +0200
@@ -0,0 +1,133 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+}
diff -urN /usr/share/empty/fs/aufs/loop.h linux/fs/aufs/loop.h
--- /usr/share/empty/fs/aufs/loop.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/loop.h 2011-08-24 13:30:24.734646739 +0200
++++ linux/fs/aufs/loop.h 2012-05-22 09:06:08.870792417 +0200
@@ -0,0 +1,50 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+#endif /* __AUFS_LOOP_H__ */
diff -urN /usr/share/empty/fs/aufs/magic.mk linux/fs/aufs/magic.mk
--- /usr/share/empty/fs/aufs/magic.mk 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/magic.mk 2011-08-24 13:30:24.734646739 +0200
++++ linux/fs/aufs/magic.mk 2012-05-22 09:06:08.870792417 +0200
@@ -0,0 +1,54 @@
+
+# defined in ${srctree}/fs/fuse/inode.c
+endif
diff -urN /usr/share/empty/fs/aufs/Makefile linux/fs/aufs/Makefile
--- /usr/share/empty/fs/aufs/Makefile 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/Makefile 2011-08-24 13:30:24.727980364 +0200
-@@ -0,0 +1,38 @@
++++ linux/fs/aufs/Makefile 2012-05-22 09:06:08.864125478 +0200
+@@ -0,0 +1,42 @@
+
+include ${src}/magic.mk
+ifeq (${CONFIG_AUFS_FS},m)
+# cf. include/linux/kernel.h
+# enable pr_debug
+ccflags-y += -DDEBUG
-+# sparse doesn't allow spaces
-+ccflags-y += -D'pr_fmt(fmt)=AUFS_NAME"\040%s:%d:%s[%d]:\040"fmt,__func__,__LINE__,current->comm,current->pid'
++# sparse requires the full pathname
++ifdef M
++ccflags-y += -include ${M}/../../include/linux/aufs_type.h
++else
++ccflags-y += -include ${srctree}/include/linux/aufs_type.h
++endif
+
+obj-$(CONFIG_AUFS_FS) += aufs.o
+aufs-y := module.o sbinfo.o super.o branch.o xino.o sysaufs.o opts.o \
+aufs-$(CONFIG_AUFS_MAGIC_SYSRQ) += sysrq.o
diff -urN /usr/share/empty/fs/aufs/module.c linux/fs/aufs/module.c
--- /usr/share/empty/fs/aufs/module.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/module.c 2012-01-05 11:00:59.218835185 +0100
-@@ -0,0 +1,195 @@
++++ linux/fs/aufs/module.c 2012-05-22 09:06:08.870792417 +0200
+@@ -0,0 +1,196 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+{
+ int i;
+
-+ /* including AuCache_HNOTIFY */
-+ for (i = 0; i < AuCache_Last; i++)
++ /* excluding AuCache_HNOTIFY */
++ BUILD_BUG_ON(AuCache_HNOTIFY + 1 != AuCache_Last);
++ for (i = 0; i < AuCache_HNOTIFY; i++)
+ if (au_cachep[i]) {
+ kmem_cache_destroy(au_cachep[i]);
+ au_cachep[i] = NULL;
+module_exit(aufs_exit);
diff -urN /usr/share/empty/fs/aufs/module.h linux/fs/aufs/module.h
--- /usr/share/empty/fs/aufs/module.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/module.h 2012-01-05 11:00:59.218835185 +0100
-@@ -0,0 +1,107 @@
++++ linux/fs/aufs/module.h 2012-05-22 09:06:08.870792417 +0200
+@@ -0,0 +1,105 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ AuCache_FINFO,
+ AuCache_VDIR,
+ AuCache_DEHSTR,
-+#ifdef CONFIG_AUFS_HNOTIFY
-+ AuCache_HNOTIFY,
-+#endif
++ AuCache_HNOTIFY, /* must be last */
+ AuCache_Last
+};
+
+#endif /* __AUFS_MODULE_H__ */
diff -urN /usr/share/empty/fs/aufs/opts.c linux/fs/aufs/opts.c
--- /usr/share/empty/fs/aufs/opts.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/opts.c 2012-01-05 11:00:59.218835185 +0100
-@@ -0,0 +1,1679 @@
++++ linux/fs/aufs/opts.c 2012-05-22 09:06:08.870792417 +0200
+@@ -0,0 +1,1677 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * mount options/flags
+ */
+
-+#include <linux/file.h>
-+#include <linux/jiffies.h>
+#include <linux/namei.h>
+#include <linux/types.h> /* a distribution requires */
+#include <linux/parser.h>
+}
diff -urN /usr/share/empty/fs/aufs/opts.h linux/fs/aufs/opts.h
--- /usr/share/empty/fs/aufs/opts.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/opts.h 2011-10-24 20:51:51.580466925 +0200
-@@ -0,0 +1,210 @@
++++ linux/fs/aufs/opts.h 2012-05-22 09:06:08.870792417 +0200
+@@ -0,0 +1,209 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+#ifdef __KERNEL__
+
+#include <linux/path.h>
-+#include <linux/aufs_type.h>
+
+struct file;
+struct super_block;
+#endif /* __AUFS_OPTS_H__ */
diff -urN /usr/share/empty/fs/aufs/plink.c linux/fs/aufs/plink.c
--- /usr/share/empty/fs/aufs/plink.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/plink.c 2011-08-24 13:30:24.734646739 +0200
++++ linux/fs/aufs/plink.c 2012-05-22 09:06:08.870792417 +0200
@@ -0,0 +1,515 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+}
diff -urN /usr/share/empty/fs/aufs/poll.c linux/fs/aufs/poll.c
--- /usr/share/empty/fs/aufs/poll.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/poll.c 2011-08-24 13:30:24.734646739 +0200
++++ linux/fs/aufs/poll.c 2012-05-22 09:06:08.870792417 +0200
@@ -0,0 +1,56 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+}
diff -urN /usr/share/empty/fs/aufs/procfs.c linux/fs/aufs/procfs.c
--- /usr/share/empty/fs/aufs/procfs.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/procfs.c 2012-01-05 11:00:59.218835185 +0100
++++ linux/fs/aufs/procfs.c 2012-05-22 09:06:08.870792417 +0200
@@ -0,0 +1,170 @@
+/*
-+ * Copyright (C) 2010-2011 Junjiro R. Okajima
++ * Copyright (C) 2010-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+}
diff -urN /usr/share/empty/fs/aufs/rdu.c linux/fs/aufs/rdu.c
--- /usr/share/empty/fs/aufs/rdu.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/rdu.c 2012-01-05 11:00:59.218835185 +0100
-@@ -0,0 +1,385 @@
++++ linux/fs/aufs/rdu.c 2012-05-22 09:06:08.870792417 +0200
+@@ -0,0 +1,384 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+#include <linux/compat.h>
+#include <linux/fs_stack.h>
+#include <linux/security.h>
-+#include <linux/uaccess.h>
-+#include <linux/aufs_type.h>
+#include "aufs.h"
+
+/* bits for struct aufs_rdu.flags */
+ loff_t offset;
+ struct au_rdu_cookie *cookie = &arg->rdu->cookie;
+
++ /* we don't have to care (FMODE_32BITHASH | FMODE_64BITHASH) for ext4 */
+ offset = vfsub_llseek(h_file, cookie->h_pos, SEEK_SET);
+ err = offset;
+ if (unlikely(offset != cookie->h_pos))
+#endif
diff -urN /usr/share/empty/fs/aufs/rwsem.h linux/fs/aufs/rwsem.h
--- /usr/share/empty/fs/aufs/rwsem.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/rwsem.h 2011-08-24 13:30:24.734646739 +0200
-@@ -0,0 +1,189 @@
++++ linux/fs/aufs/rwsem.h 2012-05-22 09:06:08.870792417 +0200
+@@ -0,0 +1,188 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+
+#ifdef __KERNEL__
+
-+#include <linux/rwsem.h>
+#include "debug.h"
+
+struct au_rwsem {
+#endif /* __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 2011-08-24 13:30:24.734646739 +0200
-@@ -0,0 +1,344 @@
++++ linux/fs/aufs/sbinfo.c 2012-05-22 09:06:08.870792417 +0200
+@@ -0,0 +1,343 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * superblock private data
+ */
+
-+#include <linux/jiffies.h>
+#include "aufs.h"
+
+/*
+}
diff -urN /usr/share/empty/fs/aufs/spl.h linux/fs/aufs/spl.h
--- /usr/share/empty/fs/aufs/spl.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/spl.h 2011-08-24 13:30:24.734646739 +0200
-@@ -0,0 +1,66 @@
++++ linux/fs/aufs/spl.h 2012-05-22 09:06:08.870792417 +0200
+@@ -0,0 +1,62 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+
+#ifdef __KERNEL__
+
-+#include <linux/spinlock.h>
-+#include <linux/list.h>
-+#include <linux/rculist.h>
-+
+struct au_splhead {
+ spinlock_t spin;
+ struct list_head head;
+#endif /* __AUFS_SPL_H__ */
diff -urN /usr/share/empty/fs/aufs/super.c linux/fs/aufs/super.c
--- /usr/share/empty/fs/aufs/super.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/super.c 2012-01-05 11:00:59.218835185 +0100
-@@ -0,0 +1,939 @@
++++ linux/fs/aufs/super.c 2012-05-22 09:06:08.870792417 +0200
+@@ -0,0 +1,962 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * mount and super_block operations
+ */
+
-+#include <linux/buffer_head.h>
-+#include <linux/jiffies.h>
++#include <linux/mm.h>
+#include <linux/module.h>
+#include <linux/seq_file.h>
+#include <linux/statfs.h>
+ }
+}
+
-+static int au_show_xino(struct seq_file *seq, struct vfsmount *mnt)
++static int au_show_xino(struct seq_file *seq, struct super_block *sb)
+{
+#ifdef CONFIG_SYSFS
+ return 0;
+ int err;
+ const int len = sizeof(AUFS_XINO_FNAME) - 1;
+ aufs_bindex_t bindex, brid;
-+ struct super_block *sb;
+ struct qstr *name;
+ struct file *f;
+ struct dentry *d, *h_root;
+ AuRwMustAnyLock(&sbinfo->si_rwsem);
+
+ err = 0;
-+ sb = mnt->mnt_sb;
+ f = au_sbi(sb)->si_xib;
+ if (!f)
+ goto out;
+}
+
+/* seq_file will re-call me in case of too long string */
-+static int aufs_show_options(struct seq_file *m, struct vfsmount *mnt)
++static int aufs_show_options(struct seq_file *m, struct dentry *dentry)
+{
+ int err;
+ unsigned int mnt_flags, v;
+} while (0)
+
+ /* lock free root dinfo */
-+ sb = mnt->mnt_sb;
++ sb = dentry->d_sb;
+ si_noflush_read_lock(sb);
+ sbinfo = au_sbi(sb);
+ seq_printf(m, ",si=%lx", sysaufs_si_id(sbinfo));
+
+ mnt_flags = au_mntflags(sb);
+ if (au_opt_test(mnt_flags, XINO)) {
-+ err = au_show_xino(m, mnt);
++ err = au_show_xino(m, sb);
+ if (unlikely(err))
+ goto out;
+ } else
+
+ old = a;
+ a += b;
-+ if (old < a)
++ if (old <= a)
++ return a;
++ return ULLONG_MAX;
++}
++
++static u64 au_mul_till_max(u64 a, long mul)
++{
++ u64 old;
++
++ old = a;
++ a *= mul;
++ if (old <= a)
+ return a;
+ return ULLONG_MAX;
+}
+static int au_statfs_sum(struct super_block *sb, struct kstatfs *buf)
+{
+ int err;
++ long bsize, factor;
+ u64 blocks, bfree, bavail, files, ffree;
+ aufs_bindex_t bend, bindex, i;
+ unsigned char shared;
+ struct path h_path;
+ struct super_block *h_sb;
+
++ err = 0;
++ bsize = LONG_MAX;
++ files = 0;
++ ffree = 0;
+ blocks = 0;
+ bfree = 0;
+ bavail = 0;
-+ files = 0;
-+ ffree = 0;
-+
-+ err = 0;
+ bend = au_sbend(sb);
-+ for (bindex = bend; bindex >= 0; bindex--) {
++ for (bindex = 0; bindex <= bend; bindex++) {
+ h_path.mnt = au_sbr_mnt(sb, bindex);
+ h_sb = h_path.mnt->mnt_sb;
+ shared = 0;
-+ for (i = bindex + 1; !shared && i <= bend; i++)
++ for (i = 0; !shared && i < bindex; i++)
+ shared = (au_sbr_sb(sb, i) == h_sb);
+ if (shared)
+ continue;
+ if (unlikely(err))
+ goto out;
+
-+ blocks = au_add_till_max(blocks, buf->f_blocks);
-+ bfree = au_add_till_max(bfree, buf->f_bfree);
-+ bavail = au_add_till_max(bavail, buf->f_bavail);
++ if (bsize > buf->f_bsize) {
++ /*
++ * we will reduce bsize, so we have to expand blocks
++ * etc. to match them again
++ */
++ factor = (bsize / buf->f_bsize);
++ blocks = au_mul_till_max(blocks, factor);
++ bfree = au_mul_till_max(bfree, factor);
++ bavail = au_mul_till_max(bavail, factor);
++ bsize = buf->f_bsize;
++ }
++
++ factor = (buf->f_bsize / bsize);
++ blocks = au_add_till_max(blocks,
++ au_mul_till_max(buf->f_blocks, factor));
++ bfree = au_add_till_max(bfree,
++ au_mul_till_max(buf->f_bfree, factor));
++ bavail = au_add_till_max(bavail,
++ au_mul_till_max(buf->f_bavail, factor));
+ files = au_add_till_max(files, buf->f_files);
+ ffree = au_add_till_max(ffree, buf->f_ffree);
+ }
+
++ buf->f_bsize = bsize;
+ buf->f_blocks = blocks;
+ buf->f_bfree = bfree;
+ buf->f_bavail = bavail;
+ buf->f_files = files;
+ buf->f_ffree = ffree;
++ buf->f_frsize = 0;
+
+out:
+ return err;
+ set_nlink(inode, 2);
+ unlock_new_inode(inode);
+
-+ root = d_alloc_root(inode);
++ root = d_make_root(inode);
+ if (unlikely(!root))
-+ goto out_iput;
++ goto out;
+ err = PTR_ERR(root);
+ if (IS_ERR(root))
-+ goto out_iput;
++ goto out;
+
+ err = au_di_init(root);
+ if (!err) {
+ return 0; /* success */
+ }
+ dput(root);
-+ goto out; /* do not iput */
+
-+out_iput:
-+ iget_failed(inode);
+out:
+ return err;
-+
+}
+
+static int aufs_fill_super(struct super_block *sb, void *raw_data,
+};
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 2011-08-24 13:30:24.734646739 +0200
-@@ -0,0 +1,547 @@
++++ linux/fs/aufs/super.h 2012-05-22 09:06:08.870792417 +0200
+@@ -0,0 +1,546 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+#ifdef __KERNEL__
+
+#include <linux/fs.h>
-+#include <linux/aufs_type.h>
+#include "rwsem.h"
+#include "spl.h"
+#include "wkq.h"
+#endif /* __AUFS_SUPER_H__ */
diff -urN /usr/share/empty/fs/aufs/sysaufs.c linux/fs/aufs/sysaufs.c
--- /usr/share/empty/fs/aufs/sysaufs.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/sysaufs.c 2011-08-24 13:30:24.734646739 +0200
-@@ -0,0 +1,107 @@
++++ linux/fs/aufs/sysaufs.c 2012-05-22 09:06:08.870792417 +0200
+@@ -0,0 +1,105 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * they are necessary regardless sysfs is disabled.
+ */
+
-+#include <linux/fs.h>
+#include <linux/random.h>
-+#include <linux/sysfs.h>
+#include "aufs.h"
+
+unsigned long sysaufs_si_mask;
+}
diff -urN /usr/share/empty/fs/aufs/sysaufs.h linux/fs/aufs/sysaufs.h
--- /usr/share/empty/fs/aufs/sysaufs.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/sysaufs.h 2011-08-24 13:30:24.734646739 +0200
-@@ -0,0 +1,105 @@
++++ linux/fs/aufs/sysaufs.h 2012-05-22 09:06:08.870792417 +0200
+@@ -0,0 +1,104 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+#ifdef __KERNEL__
+
+#include <linux/sysfs.h>
-+#include <linux/aufs_type.h>
+#include "module.h"
+
+struct super_block;
+#endif /* __SYSAUFS_H__ */
diff -urN /usr/share/empty/fs/aufs/sysfs.c linux/fs/aufs/sysfs.c
--- /usr/share/empty/fs/aufs/sysfs.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/sysfs.c 2012-01-05 11:00:59.218835185 +0100
-@@ -0,0 +1,260 @@
++++ linux/fs/aufs/sysfs.c 2012-05-22 09:06:08.870792417 +0200
+@@ -0,0 +1,257 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * sysfs interface
+ */
+
-+#include <linux/fs.h>
-+#include <linux/module.h>
+#include <linux/seq_file.h>
-+#include <linux/sysfs.h>
+#include "aufs.h"
+
+#ifdef CONFIG_AUFS_FS_MODULE
+}
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 2011-08-24 13:30:24.734646739 +0200
-@@ -0,0 +1,151 @@
++++ linux/fs/aufs/sysrq.c 2012-05-22 09:06:08.870792417 +0200
+@@ -0,0 +1,148 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * magic sysrq hanlder
+ */
+
-+#include <linux/fs.h>
-+#include <linux/module.h>
-+#include <linux/moduleparam.h>
+/* #include <linux/sysrq.h> */
+#include <linux/writeback.h>
+#include "aufs.h"
+}
diff -urN /usr/share/empty/fs/aufs/vdir.c linux/fs/aufs/vdir.c
--- /usr/share/empty/fs/aufs/vdir.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/vdir.c 2011-08-24 13:30:24.734646739 +0200
-@@ -0,0 +1,886 @@
++++ linux/fs/aufs/vdir.c 2012-05-22 09:06:08.870792417 +0200
+@@ -0,0 +1,885 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * virtual or vertical directory
+ */
+
-+#include <linux/hash.h>
+#include "aufs.h"
+
+static unsigned int calc_size(int nlen)
+}
diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
--- /usr/share/empty/fs/aufs/vfsub.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/vfsub.c 2012-01-05 11:00:59.218835185 +0100
-@@ -0,0 +1,837 @@
++++ linux/fs/aufs/vfsub.c 2012-05-22 09:06:08.870792417 +0200
+@@ -0,0 +1,832 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * sub-routines for VFS
+ */
+
-+#include <linux/file.h>
+#include <linux/ima.h>
+#include <linux/namei.h>
+#include <linux/security.h>
+#include <linux/splice.h>
-+#include <linux/uaccess.h>
+#include "aufs.h"
+
+int vfsub_update_h_iattr(struct path *h_path, int *did)
+ */
+int vfsub_name_hash(const char *name, struct qstr *this, int len)
+{
-+ unsigned long hash;
+ unsigned int c;
+
+ this->name = name;
+ this->len = len;
++ this->hash = full_name_hash(name, len);
+ if (!len)
+ return -EACCES;
+
-+ hash = init_name_hash();
+ while (len--) {
+ c = *(const unsigned char *)name++;
+ if (c == '/' || c == '\0')
+ return -EACCES;
-+ hash = partial_name_hash(c, hash);
+ }
-+ this->hash = end_name_hash(hash);
+ return 0;
+}
+
+}
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 2011-08-24 13:30:24.734646739 +0200
++++ linux/fs/aufs/vfsub.h 2012-05-22 09:06:08.870792417 +0200
@@ -0,0 +1,232 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ .dentry = h_dentry,
+ .mnt = h_mnt
+ };
-+ touch_atime(h_mnt, h_dentry);
++ touch_atime(&h_path);
+ vfsub_update_h_iattr(&h_path, /*did*/NULL); /*ignore*/
+}
+
+#endif /* __AUFS_VFSUB_H__ */
diff -urN /usr/share/empty/fs/aufs/wbr_policy.c linux/fs/aufs/wbr_policy.c
--- /usr/share/empty/fs/aufs/wbr_policy.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/wbr_policy.c 2011-08-24 13:30:24.734646739 +0200
++++ linux/fs/aufs/wbr_policy.c 2012-05-22 09:06:08.870792417 +0200
@@ -0,0 +1,700 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+};
diff -urN /usr/share/empty/fs/aufs/whout.c linux/fs/aufs/whout.c
--- /usr/share/empty/fs/aufs/whout.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/whout.c 2011-10-24 20:51:51.583800333 +0200
-@@ -0,0 +1,1050 @@
++++ linux/fs/aufs/whout.c 2012-05-22 09:06:08.870792417 +0200
+@@ -0,0 +1,1049 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * whiteout for logical deletion and opaque directory
+ */
+
-+#include <linux/fs.h>
+#include "aufs.h"
+
+#define WH_MASK S_IRUGO
+}
diff -urN /usr/share/empty/fs/aufs/whout.h linux/fs/aufs/whout.h
--- /usr/share/empty/fs/aufs/whout.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/whout.h 2011-08-24 13:30:24.734646739 +0200
-@@ -0,0 +1,89 @@
++++ linux/fs/aufs/whout.h 2012-05-22 09:06:08.870792417 +0200
+@@ -0,0 +1,88 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+
+#ifdef __KERNEL__
+
-+#include <linux/aufs_type.h>
+#include "dir.h"
+
+/* whout.c */
+#endif /* __AUFS_WHOUT_H__ */
diff -urN /usr/share/empty/fs/aufs/wkq.c linux/fs/aufs/wkq.c
--- /usr/share/empty/fs/aufs/wkq.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/wkq.c 2012-01-05 11:00:59.218835185 +0100
++++ linux/fs/aufs/wkq.c 2012-05-22 09:06:08.870792417 +0200
@@ -0,0 +1,214 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+}
diff -urN /usr/share/empty/fs/aufs/wkq.h linux/fs/aufs/wkq.h
--- /usr/share/empty/fs/aufs/wkq.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/wkq.h 2012-01-05 11:00:59.218835185 +0100
-@@ -0,0 +1,96 @@
++++ linux/fs/aufs/wkq.h 2012-05-22 09:06:08.870792417 +0200
+@@ -0,0 +1,92 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+
+#ifdef __KERNEL__
+
-+#include <linux/sched.h>
-+#include <linux/wait.h>
-+#include <linux/aufs_type.h>
-+
+struct super_block;
+
+/* ---------------------------------------------------------------------- */
+#endif /* __AUFS_WKQ_H__ */
diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
--- /usr/share/empty/fs/aufs/xino.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/xino.c 2012-01-05 11:00:59.218835185 +0100
-@@ -0,0 +1,1266 @@
++++ linux/fs/aufs/xino.c 2012-05-22 09:06:08.874125894 +0200
+@@ -0,0 +1,1264 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * external inode number translation table and bitmap
+ */
+
-+#include <linux/file.h>
+#include <linux/seq_file.h>
-+#include <linux/uaccess.h>
+#include "aufs.h"
+
+/* todo: unnecessary to support mmap_sem since kernel-space? */
+}
diff -urN /usr/share/empty/include/linux/aufs_type.h linux/include/linux/aufs_type.h
--- /usr/share/empty/include/linux/aufs_type.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux/include/linux/aufs_type.h 2012-01-05 11:00:59.218835185 +0100
-@@ -0,0 +1,224 @@
++++ linux/include/linux/aufs_type.h 2012-05-23 12:07:43.277739181 +0200
+@@ -0,0 +1,233 @@
+/*
-+ * Copyright (C) 2005-2011 Junjiro R. Okajima
++ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+#ifndef __AUFS_TYPE_H__
+#define __AUFS_TYPE_H__
+
-+#include <linux/ioctl.h>
-+#include <linux/kernel.h>
-+#include <linux/limits.h>
++#define AUFS_NAME "aufs"
++
+#ifdef __KERNEL__
-+#include <linux/types.h>
++/*
++ * define it before including all other headers.
++ * sched.h may use pr_* macros before defining "current", so define the
++ * no-current version first, and re-define later.
++ */
++#define pr_fmt(fmt) AUFS_NAME " %s:%d: " fmt, __func__, __LINE__
++#include <linux/sched.h>
++#undef pr_fmt
++#define pr_fmt(fmt) AUFS_NAME " %s:%d:%s[%d]: " fmt, \
++ __func__, __LINE__, current->comm, current->pid
+#else
+#include <stdint.h>
+#include <sys/types.h>
-+#endif
++#endif /* __KERNEL__ */
+
-+#define AUFS_VERSION "3.x-rcN-20111205"
++#include <linux/limits.h>
++
++#define AUFS_VERSION "3.4-20120521"
+
+/* todo? move this to linux-2.6.19/include/magic.h */
+#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's')
+
+/* ---------------------------------------------------------------------- */
+
-+#define AUFS_NAME "aufs"
+#define AUFS_FSTYPE AUFS_NAME
+
+#define AUFS_ROOT_INO 2
+
+#endif /* __AUFS_TYPE_H__ */
---- linux-3.2/security/device_cgroup.c~ 2012-01-05 13:48:24.000000000 +0100
-+++ linux-3.2/security/device_cgroup.c 2012-01-05 14:02:48.910843473 +0100
-@@ -13,6 +13,7 @@
- #include <linux/slab.h>
- #include <linux/rcupdate.h>
- #include <linux/mutex.h>
-+#include <linux/module.h>
-
- #define ACC_MKNOD 1
- #define ACC_READ 2