aufs3.x-rcN kbuild patch
diff --git a/fs/Kconfig b/fs/Kconfig
-index d621f02..9b9694c 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 93804d4..cf3dcb9 100644
+index 2fb9779..abefac5 100644
--- a/fs/Makefile
+++ b/fs/Makefile
-@@ -124,3 +124,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 c94e717..fccb9df 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
aufs3.x-rcN base patch
diff --git a/fs/namei.c b/fs/namei.c
-index e2ba628..fde8ea2 100644
+index 0062dd1..80bb0b9 100644
--- a/fs/namei.c
+++ b/fs/namei.c
-@@ -1781,7 +1781,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 1ec0493..c599f73 100644
+index f847684..f871233 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -1084,8 +1084,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
aufs3.x-rcN standalone patch
diff --git a/fs/file_table.c b/fs/file_table.c
-index 20002e3..6d792ad 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 d3ebdbe..6db6251 100644
+index 9f4f5fe..bb0f3ba 100644
--- a/fs/inode.c
+++ b/fs/inode.c
-@@ -66,6 +66,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 fde8ea2..62f2302 100644
+index 80bb0b9..3430ad3 100644
--- a/fs/namei.c
+++ b/fs/namei.c
-@@ -1785,6 +1785,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);
}
static int fsnotify_mark_destroy(void *ignored)
{
diff --git a/fs/open.c b/fs/open.c
-index 77becc0..f634f02 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 c599f73..00303ba 100644
+index f871233..70f5481 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -1108,6 +1108,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
/**
* splice_direct_to_actor - splices data directly between two non-pipes
diff --git a/security/commoncap.c b/security/commoncap.c
-index 7ce191e..19a95be 100644
+index 71a166a..5d63aac 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
-@@ -965,3 +965,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 8b5b5d8..911850c 100644
+index c43a332..0c37289 100644
--- a/security/device_cgroup.c
+++ b/security/device_cgroup.c
@@ -7,6 +7,7 @@
#include <linux/list.h>
#include <linux/uaccess.h>
#include <linux/seq_file.h>
-@@ -501,6 +502,7 @@ found:
+@@ -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 d754249..1aa6154 100644
+index bf619ff..60b996a 100644
--- a/security/security.c
+++ b/security/security.c
-@@ -392,6 +392,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)
{
-@@ -408,6 +409,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)
-@@ -416,6 +418,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)
-@@ -434,6 +437,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);
}
int security_path_chmod(struct path *path, umode_t mode)
{
-@@ -441,6 +445,7 @@ 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(path, mode);
}
int security_path_chown(struct path *path, uid_t uid, gid_t gid)
{
-@@ -448,6 +453,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)
{
-@@ -524,6 +530,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)
{
-@@ -538,6 +545,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)
{
-@@ -653,6 +661,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)
{
-@@ -680,6 +689,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);
}
+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-03-19 12:24:13.676467669 +0100
++++ linux/Documentation/filesystems/aufs/README 2012-05-21 09:17:41.615986107 +0200
@@ -0,0 +1,330 @@
+
+Aufs3 -- advanced multi layered unification filesystem version 3.x
+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 and 12).
++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.
+-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-03-19 12:24:13.679801090 +0100
++++ linux/fs/aufs/cpup.c 2012-05-21 09:17:41.662653844 +0200
@@ -0,0 +1,1084 @@
+/*
+ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ * h_inode->i_mutex is not held, but it is harmless since once i_nlink
+ * reaches 0, it will never become positive.
+ */
-+ vfsub_set_nlink(inode, h_inode->i_nlink);
++ set_nlink(inode, h_inode->i_nlink);
+
+ /*
+ * fewer nlink makes find(1) noisy, but larger nlink doesn't.
+}
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 2012-03-19 12:24:13.679801090 +0100
-@@ -0,0 +1,243 @@
++++ linux/fs/aufs/debug.h 2012-05-21 09:17:41.662653844 +0200
+@@ -0,0 +1,242 @@
+/*
+ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+
+#ifdef __KERNEL__
+
-+#include <asm/system.h>
+#include <linux/module.h>
+#include <linux/kallsyms.h>
+#include <linux/sysrq.h>
+}
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-03-19 12:24:13.679801090 +0100
++++ linux/fs/aufs/dir.c 2012-05-21 09:17:41.662653844 +0200
@@ -0,0 +1,636 @@
+/*
+ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ if (h_dir->i_nlink < 2)
+ nlink += 2;
+ /* 0 can happen in revaliding */
-+ vfsub_set_nlink(dir, nlink);
++ set_nlink(dir, nlink);
+}
+
+void au_sub_nlink(struct inode *dir, struct inode *h_dir)
+ nlink -= h_dir->i_nlink - 2;
+ if (h_dir->i_nlink < 2)
+ nlink -= 2;
-+ /* no vfsub version. nlink == 0 means the branch-fs is broken */
++ /* nlink == 0 means the branch-fs is broken */
+ set_nlink(dir, nlink);
+}
+
+}
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-03-19 12:24:13.683134508 +0100
-@@ -0,0 +1,992 @@
++++ linux/fs/aufs/i_op.c 2012-05-21 09:17:41.662653844 +0200
+@@ -0,0 +1,993 @@
+/*
+ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+
+#include <linux/device_cgroup.h>
+#include <linux/fs_stack.h>
++#include <linux/mm.h>
+#include <linux/namei.h>
+#include <linux/security.h>
+#include "aufs.h"
+ n -= nlink;
+ n += st->nlink;
+ /* 0 can happen */
-+ vfsub_set_nlink(inode, n);
++ set_nlink(inode, n);
+ }
+
+ spin_lock(&inode->i_lock);
+}
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-03-19 12:24:13.683134508 +0100
-@@ -0,0 +1,383 @@
++++ linux/fs/aufs/rdu.c 2012-05-21 09:17:41.662653844 +0200
+@@ -0,0 +1,384 @@
+/*
+ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ 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 /* __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-03-19 12:24:13.683134508 +0100
-@@ -0,0 +1,936 @@
++++ linux/fs/aufs/super.c 2012-05-21 09:17:41.662653844 +0200
+@@ -0,0 +1,962 @@
+/*
+ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+
+ 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/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 2012-03-19 12:24:13.686467926 +0100
-@@ -0,0 +1,240 @@
++++ linux/fs/aufs/vfsub.h 2012-05-21 09:17:41.662653844 +0200
+@@ -0,0 +1,232 @@
+/*
+ * Copyright (C) 2005-2012 Junjiro R. Okajima
+ *
+ clear_nlink(inode);
+}
+
-+static inline void vfsub_set_nlink(struct inode *inode, unsigned int nlink)
-+{
-+ if (nlink)
-+ set_nlink(inode, nlink);
-+ else
-+ clear_nlink(inode);
-+}
-+
+/* ---------------------------------------------------------------------- */
+
+int vfsub_update_h_iattr(struct path *h_path, int *did);
+ .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*/
+}
+
+}
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-03-19 12:24:13.686467926 +0100
++++ linux/include/linux/aufs_type.h 2012-05-21 09:17:41.662653844 +0200
@@ -0,0 +1,233 @@
+/*
+ * Copyright (C) 2005-2012 Junjiro R. Okajima
+
+#include <linux/limits.h>
+
-+#define AUFS_VERSION "3.x-rcN-20120312"
++#define AUFS_VERSION "3.x-rcN-20120430"
+
+/* todo? move this to linux-2.6.19/include/magic.h */
+#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's')
+
+For more information, see <http://unionfs.filesystems.org/>.
diff --git a/MAINTAINERS b/MAINTAINERS
-index f986e7d..d162994 100644
+index 9a648eb..81b24a8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
-@@ -6755,6 +6755,14 @@ F: Documentation/cdrom/
+@@ -6765,6 +6765,14 @@ F: Documentation/cdrom/
F: drivers/cdrom/cdrom.c
F: include/linux/cdrom.h
M: Artem Bityutskiy <dedekind1@gmail.com>
W: http://www.linux-mtd.infradead.org/
diff --git a/fs/Kconfig b/fs/Kconfig
-index 6ad58a5..4699ff1 100644
+index d621f02..c12677d 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -194,6 +194,7 @@ if MISC_FILESYSTEMS
source "fs/hfsplus/Kconfig"
source "fs/befs/Kconfig"
diff --git a/fs/Makefile b/fs/Makefile
-index d2c3353..6fb7641 100644
+index 93804d4..3ff10bb 100644
--- a/fs/Makefile
+++ b/fs/Makefile
-@@ -82,6 +82,7 @@ obj-$(CONFIG_ISO9660_FS) += isofs/
+@@ -83,6 +83,7 @@ obj-$(CONFIG_ISO9660_FS) += isofs/
obj-$(CONFIG_HFSPLUS_FS) += hfsplus/ # Before hfs to find wrapped HFS+
obj-$(CONFIG_HFS_FS) += hfs/
obj-$(CONFIG_ECRYPT_FS) += ecryptfs/
obj-$(CONFIG_NFS_FS) += nfs/
obj-$(CONFIG_EXPORTFS) += exportfs/
diff --git a/fs/namei.c b/fs/namei.c
-index 5008f01..411dbaa 100644
+index 208c6aa..050eded 100644
--- a/fs/namei.c
+++ b/fs/namei.c
-@@ -492,6 +492,7 @@ void release_open_intent(struct nameidata *nd)
+@@ -491,6 +491,7 @@ void release_open_intent(struct nameidata *nd)
fput(file);
}
}
static inline int d_revalidate(struct dentry *dentry, struct nameidata *nd)
{
-@@ -1803,6 +1804,42 @@ struct dentry *lookup_one_len(const char *name, struct dentry *base, int len)
+@@ -1804,6 +1805,42 @@ struct dentry *lookup_one_len(const char *name, struct dentry *base, int len)
return __lookup_hash(&this, base, NULL);
}
int user_path_at_empty(int dfd, const char __user *name, unsigned flags,
struct path *path, int *empty)
{
-@@ -3383,6 +3420,7 @@ EXPORT_SYMBOL(get_write_access); /* binfmt_aout */
+@@ -3384,6 +3421,7 @@ EXPORT_SYMBOL(get_write_access); /* binfmt_aout */
EXPORT_SYMBOL(getname);
EXPORT_SYMBOL(lock_rename);
EXPORT_SYMBOL(lookup_one_len);
EXPORT_SYMBOL(page_put_link);
EXPORT_SYMBOL(page_readlink);
diff --git a/fs/splice.c b/fs/splice.c
-index fa2defa..ba17a96 100644
+index 1ec0493..3215728 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);
-@@ -1109,13 +1109,14 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+@@ -1108,13 +1108,14 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
return splice_write(pipe, out, ppos, len, flags);
}
{
ssize_t (*splice_read)(struct file *, loff_t *,
struct pipe_inode_info *, size_t, unsigned int);
-@@ -1135,6 +1136,7 @@ static long do_splice_to(struct file *in, loff_t *ppos,
+@@ -1134,6 +1135,7 @@ static 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
-@@ -1204,7 +1206,7 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
+@@ -1203,7 +1205,7 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
size_t read_len;
loff_t pos = sd->pos, prev_pos = pos;
if (unlikely(ret <= 0))
goto out_release;
-@@ -1263,8 +1265,8 @@ static int direct_splice_actor(struct pipe_inode_info *pipe,
+@@ -1262,8 +1264,8 @@ static int direct_splice_actor(struct pipe_inode_info *pipe,
{
struct file *file = sd->u.file;
}
/**
-@@ -1349,7 +1351,7 @@ static long do_splice(struct file *in, loff_t __user *off_in,
+@@ -1348,7 +1350,7 @@ static long do_splice(struct file *in, loff_t __user *off_in,
} else
off = &out->f_pos;
if (off_out && copy_to_user(off_out, off, sizeof(loff_t)))
ret = -EFAULT;
-@@ -1369,7 +1371,7 @@ static long do_splice(struct file *in, loff_t __user *off_in,
+@@ -1368,7 +1370,7 @@ static long do_splice(struct file *in, loff_t __user *off_in,
} else
off = &in->f_pos;
if (off_in && copy_to_user(off_in, off, sizeof(loff_t)))
ret = -EFAULT;
-diff --git a/fs/stack.c b/fs/stack.c
-index 9c11519..9e7dbfe 100644
---- a/fs/stack.c
-+++ b/fs/stack.c
-@@ -1,8 +1,20 @@
-+/*
-+ * Copyright (c) 2006-2009 Erez Zadok
-+ * Copyright (c) 2006-2007 Josef 'Jeff' Sipek
-+ * Copyright (c) 2006-2009 Stony Brook University
-+ * Copyright (c) 2006-2009 The Research Foundation of SUNY
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+ */
-+
- #include <linux/module.h>
- #include <linux/fs.h>
- #include <linux/fs_stack.h>
-
--/* does _NOT_ require i_mutex to be held.
-+/*
-+ * does _NOT_ require i_mutex to be held.
- *
- * This function cannot be inlined since i_size_{read,write} is rather
- * heavy-weight on 32-bit systems
diff --git a/fs/unionfs/Kconfig b/fs/unionfs/Kconfig
new file mode 100644
index 0000000..f3c1ac4
+ If you say Y here, you can turn on debugging output from Unionfs.
diff --git a/fs/unionfs/Makefile b/fs/unionfs/Makefile
new file mode 100644
-index 0000000..d45ae17
+index 0000000..60b6060
--- /dev/null
+++ b/fs/unionfs/Makefile
@@ -0,0 +1,17 @@
-+UNIONFS_VERSION="2.5.11 (for 3.2.2)"
++UNIONFS_VERSION="2.5.11 (for 3.3.0-rc3)"
+
+EXTRA_CFLAGS += -DUNIONFS_VERSION=\"$(UNIONFS_VERSION)\"
+
+}
diff --git a/fs/unionfs/debug.c b/fs/unionfs/debug.c
new file mode 100644
-index 0000000..c07f697
+index 0000000..21ce90c
--- /dev/null
+++ b/fs/unionfs/debug.c
-@@ -0,0 +1,549 @@
+@@ -0,0 +1,551 @@
+/*
+ * Copyright (c) 2003-2011 Erez Zadok
+ * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
+ */
+
+#include "union.h"
++#include "../mount.h"
+
+/*
+ * Helper debugging functions for maintainers (and for users to report back
+
+static unsigned int __mnt_get_count(struct vfsmount *mnt)
+{
++ struct mount *m = real_mount(mnt);
+#ifdef CONFIG_SMP
+ unsigned int count = 0;
+ int cpu;
+
+ for_each_possible_cpu(cpu) {
-+ count += per_cpu_ptr(mnt->mnt_pcp, cpu)->mnt_count;
++ count += per_cpu_ptr(m->mnt_pcp, cpu)->mnt_count;
+ }
+
+ return count;
+#else
-+ return mnt->mnt_count;
++ return m->mnt_count;
+#endif
+}
+
+};
diff --git a/fs/unionfs/inode.c b/fs/unionfs/inode.c
new file mode 100644
-index 0000000..afc9a2d
+index 0000000..dd522c2
--- /dev/null
+++ b/fs/unionfs/inode.c
@@ -0,0 +1,1085 @@
+}
+
+static int unionfs_create(struct inode *dir, struct dentry *dentry,
-+ int mode, struct nameidata *nd_unused)
++ umode_t mode, struct nameidata *nd_unused)
+{
+ int err = 0;
+ struct dentry *lower_dentry = NULL;
+ return err;
+}
+
-+static int unionfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
++static int unionfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
+{
+ int err = 0;
+ struct dentry *lower_dentry = NULL;
+ return err;
+}
+
-+static int unionfs_mknod(struct inode *dir, struct dentry *dentry, int mode,
++static int unionfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode,
+ dev_t dev)
+{
+ int err = 0;
+ err = PTR_ERR(inode);
+ goto out_dput;
+ }
-+ sb->s_root = d_alloc_root(inode);
++ sb->s_root = d_make_root(inode);
+ if (unlikely(!sb->s_root)) {
+ err = -ENOMEM;
-+ goto out_iput;
++ goto out_dput;
+ }
+ d_set_d_op(sb->s_root, &unionfs_dops);
+
+}
diff --git a/fs/unionfs/super.c b/fs/unionfs/super.c
new file mode 100644
-index 0000000..c3ac814
+index 0000000..b99f14d
--- /dev/null
+++ b/fs/unionfs/super.c
@@ -0,0 +1,1030 @@
+ unionfs_read_unlock(sb);
+}
+
-+static int unionfs_show_options(struct seq_file *m, struct vfsmount *mnt)
++static int unionfs_show_options(struct seq_file *m, struct dentry *root)
+{
-+ struct super_block *sb = mnt->mnt_sb;
++ struct super_block *sb = root->d_sb;
+ int ret = 0;
+ char *tmp_page;
+ char *path;
+#include <linux/splice.h>
+#include <linux/sched.h>
+
-+#include <asm/system.h>
++
+
+#include <linux/union_fs.h>
+
+#endif /* _LINUX_UNIONFS_H */
+
diff --git a/security/security.c b/security/security.c
-index e2f684a..23ab419 100644
+index d754249..f7e8373 100644
--- a/security/security.c
+++ b/security/security.c
-@@ -558,6 +558,7 @@ int security_inode_permission(struct inode *inode, int mask)
+@@ -538,6 +538,7 @@ int security_inode_permission(struct inode *inode, int mask)
return 0;
return security_ops->inode_permission(inode, mask);
}