|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
From: J. R. Okajima <hooanon05@yahoo.co.jp>
|
|
|
|
|
Date: Sat May 18 10:36:30 2013 +0900
|
|
|
|
|
Subject: aufs3.x-rcN-20130520
|
|
|
|
|
Origin: http://sourceforge.net/p/aufs/aufs3-standalone/ci/4f14cef47eb7c23eda7198931fbab1040866b6ee/tree/
|
|
|
|
|
Date: Fri Jul 19 11:54:34 2013 +0900
|
|
|
|
|
Subject: aufs3.x-rcN-20130722
|
|
|
|
|
Origin: http://sourceforge.net/p/aufs/aufs3-standalone/ci/2482fbbf640a326afc454d78ace7a266a05c39d4/tree/
|
|
|
|
|
Bug-Debian: http://bugs.debian.org/541828
|
|
|
|
|
|
|
|
|
|
Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
@ -87,8 +87,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ When the aufs mount option 'noxino' is specified, it
|
|
|
|
|
+ will be empty. About XINO files, see the aufs manual.
|
|
|
|
|
--- a/Documentation/filesystems/aufs/README 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/Documentation/filesystems/aufs/README 2013-06-02 18:23:34.749538984 +0100
|
|
|
|
|
@@ -0,0 +1,345 @@
|
|
|
|
|
+++ b/Documentation/filesystems/aufs/README 2013-07-22 05:16:41.115119378 +0100
|
|
|
|
|
@@ -0,0 +1,346 @@
|
|
|
|
|
+
|
|
|
|
|
+Aufs3 -- advanced multi layered unification filesystem version 3.x
|
|
|
|
|
+http://aufs.sf.net
|
|
|
|
@ -417,6 +417,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+POIRETTE Marc made a donation (2013/4).
|
|
|
|
|
+Alessandro Gorreta made a donation (2013/4).
|
|
|
|
|
+lauri kasvandik made a donation (2013/5).
|
|
|
|
|
+pemasu from Finland made a donation (2013/7).
|
|
|
|
|
+
|
|
|
|
|
+Thank you very much.
|
|
|
|
|
+Donations are always, including future donations, very important and
|
|
|
|
@ -1715,7 +1716,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+#endif /* __KERNEL__ */
|
|
|
|
|
+#endif /* __AUFS_H__ */
|
|
|
|
|
--- a/fs/aufs/branch.c 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/fs/aufs/branch.c 2013-06-02 18:23:34.749538984 +0100
|
|
|
|
|
+++ b/fs/aufs/branch.c 2013-07-22 05:16:41.115119378 +0100
|
|
|
|
|
@@ -0,0 +1,1213 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2005-2013 Junjiro R. Okajima
|
|
|
|
@ -2330,7 +2331,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ ndentry = dpage->ndentry;
|
|
|
|
|
+ for (j = 0; !err && j < ndentry; j++) {
|
|
|
|
|
+ d = dpage->dentries[j];
|
|
|
|
|
+ AuDebugOn(!d->d_count);
|
|
|
|
|
+ AuDebugOn(!d_count(d));
|
|
|
|
|
+ if (!au_digen_test(d, sigen)) {
|
|
|
|
|
+ di_read_lock_child(d, AuLock_IR);
|
|
|
|
|
+ if (unlikely(au_dbrange_test(d))) {
|
|
|
|
@ -3230,8 +3231,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+
|
|
|
|
|
+-include ${srctree}/${src}/conf_priv.mk
|
|
|
|
|
--- a/fs/aufs/cpup.c 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/fs/aufs/cpup.c 2013-06-02 18:23:34.749538984 +0100
|
|
|
|
|
@@ -0,0 +1,1228 @@
|
|
|
|
|
+++ b/fs/aufs/cpup.c 2013-07-22 05:16:41.115119378 +0100
|
|
|
|
|
@@ -0,0 +1,1247 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2005-2013 Junjiro R. Okajima
|
|
|
|
|
+ *
|
|
|
|
@ -3261,7 +3262,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+void au_cpup_attr_flags(struct inode *dst, unsigned int iflags)
|
|
|
|
|
+{
|
|
|
|
|
+ const unsigned int mask = S_DEAD | S_SWAPFILE | S_PRIVATE
|
|
|
|
|
+ | S_NOATIME | S_NOCMTIME;
|
|
|
|
|
+ | S_NOATIME | S_NOCMTIME | S_AUTOMOUNT;
|
|
|
|
|
+
|
|
|
|
|
+ BUILD_BUG_ON(sizeof(iflags) != sizeof(dst->i_flags));
|
|
|
|
|
+
|
|
|
|
@ -4181,6 +4182,25 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ return err;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/* generalized cpup_simple() with h_open_pre/post() calls */
|
|
|
|
|
+int au_sio_cpup_simple_h_open(struct dentry *dentry, aufs_bindex_t bdst,
|
|
|
|
|
+ loff_t len, unsigned int flags,
|
|
|
|
|
+ struct au_pin *pin, aufs_bindex_t bsrc)
|
|
|
|
|
+{
|
|
|
|
|
+ int err;
|
|
|
|
|
+ struct file *h_file;
|
|
|
|
|
+
|
|
|
|
|
+ h_file = au_h_open_pre(dentry, bsrc);
|
|
|
|
|
+ if (IS_ERR(h_file))
|
|
|
|
|
+ err = PTR_ERR(h_file);
|
|
|
|
|
+ else {
|
|
|
|
|
+ err = au_sio_cpup_simple(dentry, bdst, len, flags, pin);
|
|
|
|
|
+ au_h_open_post(dentry, bsrc, h_file);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return err;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/* ---------------------------------------------------------------------- */
|
|
|
|
|
+
|
|
|
|
|
+/*
|
|
|
|
@ -4461,8 +4481,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ return err;
|
|
|
|
|
+}
|
|
|
|
|
--- a/fs/aufs/cpup.h 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/fs/aufs/cpup.h 2013-06-02 18:23:34.749538984 +0100
|
|
|
|
|
@@ -0,0 +1,84 @@
|
|
|
|
|
+++ b/fs/aufs/cpup.h 2013-07-22 05:16:41.115119378 +0100
|
|
|
|
|
@@ -0,0 +1,87 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2005-2013 Junjiro R. Okajima
|
|
|
|
|
+ *
|
|
|
|
@ -4522,6 +4542,9 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ struct dentry *dst_parent, struct au_pin *pin);
|
|
|
|
|
+int au_sio_cpup_simple(struct dentry *dentry, aufs_bindex_t bdst, loff_t len,
|
|
|
|
|
+ unsigned int flags, struct au_pin *pin);
|
|
|
|
|
+int au_sio_cpup_simple_h_open(struct dentry *dentry, aufs_bindex_t bdst,
|
|
|
|
|
+ loff_t len, unsigned int flags,
|
|
|
|
|
+ struct au_pin *pin, aufs_bindex_t bsrc);
|
|
|
|
|
+int au_sio_cpup_wh(struct dentry *dentry, aufs_bindex_t bdst, loff_t len,
|
|
|
|
|
+ struct file *file, struct au_pin *pin);
|
|
|
|
|
+
|
|
|
|
@ -5036,7 +5059,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+#endif /* __KERNEL__ */
|
|
|
|
|
+#endif /* __DBGAUFS_H__ */
|
|
|
|
|
--- a/fs/aufs/dcsub.c 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/fs/aufs/dcsub.c 2013-03-10 01:48:58.459093058 +0000
|
|
|
|
|
+++ b/fs/aufs/dcsub.c 2013-07-22 05:16:41.115119378 +0100
|
|
|
|
|
@@ -0,0 +1,243 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2005-2013 Junjiro R. Okajima
|
|
|
|
@ -5138,7 +5161,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ dpages->ndpage++;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ AuDebugOn(!dentry->d_count);
|
|
|
|
|
+ AuDebugOn(!d_count(dentry));
|
|
|
|
|
+ dpage->dentries[dpage->ndentry++] = dget_dlock(dentry);
|
|
|
|
|
+ return 0; /* success */
|
|
|
|
|
+
|
|
|
|
@ -5164,7 +5187,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ if (this_parent->d_sb == sb
|
|
|
|
|
+ && !IS_ROOT(this_parent)
|
|
|
|
|
+ && au_di(this_parent)
|
|
|
|
|
+ && this_parent->d_count
|
|
|
|
|
+ && d_count(this_parent)
|
|
|
|
|
+ && (!test || test(this_parent, arg))) {
|
|
|
|
|
+ err = au_dpages_append(dpages, this_parent, GFP_ATOMIC);
|
|
|
|
|
+ if (unlikely(err))
|
|
|
|
@ -5178,7 +5201,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+
|
|
|
|
|
+ next = tmp->next;
|
|
|
|
|
+ spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
|
|
|
|
|
+ if (dentry->d_count) {
|
|
|
|
|
+ if (d_count(dentry)) {
|
|
|
|
|
+ if (!list_empty(&dentry->d_subdirs)) {
|
|
|
|
|
+ spin_unlock(&this_parent->d_lock);
|
|
|
|
|
+ spin_release(&dentry->d_lock.dep_map, 1,
|
|
|
|
@ -5229,7 +5252,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ write_seqlock(&rename_lock);
|
|
|
|
|
+ spin_lock(&dentry->d_lock);
|
|
|
|
|
+ if (do_include
|
|
|
|
|
+ && dentry->d_count
|
|
|
|
|
+ && d_count(dentry)
|
|
|
|
|
+ && (!test || test(dentry, arg)))
|
|
|
|
|
+ err = au_dpages_append(dpages, dentry, GFP_ATOMIC);
|
|
|
|
|
+ spin_unlock(&dentry->d_lock);
|
|
|
|
@ -5243,7 +5266,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ while (!IS_ROOT(dentry)) {
|
|
|
|
|
+ dentry = dentry->d_parent; /* rename_lock is locked */
|
|
|
|
|
+ spin_lock(&dentry->d_lock);
|
|
|
|
|
+ if (dentry->d_count
|
|
|
|
|
+ if (d_count(dentry)
|
|
|
|
|
+ && (!test || test(dentry, arg)))
|
|
|
|
|
+ err = au_dpages_append(dpages, dentry, GFP_ATOMIC);
|
|
|
|
|
+ spin_unlock(&dentry->d_lock);
|
|
|
|
@ -5379,7 +5402,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+#endif /* __KERNEL__ */
|
|
|
|
|
+#endif /* __AUFS_DCSUB_H__ */
|
|
|
|
|
--- a/fs/aufs/debug.c 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/fs/aufs/debug.c 2013-06-02 18:23:34.749538984 +0100
|
|
|
|
|
+++ b/fs/aufs/debug.c 2013-07-22 05:16:41.115119378 +0100
|
|
|
|
|
@@ -0,0 +1,491 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2005-2013 Junjiro R. Okajima
|
|
|
|
@ -5542,7 +5565,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ bindex,
|
|
|
|
|
+ AuDLNPair(dentry->d_parent), AuDLNPair(dentry),
|
|
|
|
|
+ dentry->d_sb ? au_sbtype(dentry->d_sb) : "??",
|
|
|
|
|
+ dentry->d_count, dentry->d_flags);
|
|
|
|
|
+ d_count(dentry), dentry->d_flags);
|
|
|
|
|
+ hn = -1;
|
|
|
|
|
+ if (bindex >= 0 && dentry->d_inode && au_test_aufs(dentry->d_sb)) {
|
|
|
|
|
+ struct au_iinfo *iinfo = au_ii(dentry->d_inode);
|
|
|
|
@ -7423,7 +7446,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+#endif /* __KERNEL__ */
|
|
|
|
|
+#endif /* __AUFS_DENTRY_H__ */
|
|
|
|
|
--- a/fs/aufs/dinfo.c 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/fs/aufs/dinfo.c 2013-03-10 01:48:58.459093058 +0000
|
|
|
|
|
+++ b/fs/aufs/dinfo.c 2013-07-22 05:16:41.115119378 +0100
|
|
|
|
|
@@ -0,0 +1,543 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2005-2013 Junjiro R. Okajima
|
|
|
|
@ -7745,7 +7768,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ return NULL;
|
|
|
|
|
+ AuDebugOn(bindex < 0);
|
|
|
|
|
+ d = au_di(dentry)->di_hdentry[0 + bindex].hd_dentry;
|
|
|
|
|
+ AuDebugOn(d && d->d_count <= 0);
|
|
|
|
|
+ AuDebugOn(d && d_count(d) <= 0);
|
|
|
|
|
+ return d;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
@ -7969,8 +7992,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ return -1;
|
|
|
|
|
+}
|
|
|
|
|
--- a/fs/aufs/dir.c 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/fs/aufs/dir.c 2013-06-02 18:23:34.749538984 +0100
|
|
|
|
|
@@ -0,0 +1,630 @@
|
|
|
|
|
+++ b/fs/aufs/dir.c 2013-07-22 05:16:41.115119378 +0100
|
|
|
|
|
@@ -0,0 +1,645 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2005-2013 Junjiro R. Okajima
|
|
|
|
|
+ *
|
|
|
|
@ -8006,6 +8029,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ nlink += h_dir->i_nlink - 2;
|
|
|
|
|
+ if (h_dir->i_nlink < 2)
|
|
|
|
|
+ nlink += 2;
|
|
|
|
|
+ smp_mb();
|
|
|
|
|
+ /* 0 can happen in revaliding */
|
|
|
|
|
+ set_nlink(dir, nlink);
|
|
|
|
|
+}
|
|
|
|
@ -8020,6 +8044,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ nlink -= h_dir->i_nlink - 2;
|
|
|
|
|
+ if (h_dir->i_nlink < 2)
|
|
|
|
|
+ nlink -= 2;
|
|
|
|
|
+ smp_mb();
|
|
|
|
|
+ /* nlink == 0 means the branch-fs is broken */
|
|
|
|
|
+ set_nlink(dir, nlink);
|
|
|
|
|
+}
|
|
|
|
@ -8329,13 +8354,16 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+
|
|
|
|
|
+/* ---------------------------------------------------------------------- */
|
|
|
|
|
+
|
|
|
|
|
+static int aufs_readdir(struct file *file, void *dirent, filldir_t filldir)
|
|
|
|
|
+static int aufs_iterate(struct file *file, struct dir_context *ctx)
|
|
|
|
|
+{
|
|
|
|
|
+ int err;
|
|
|
|
|
+ struct dentry *dentry;
|
|
|
|
|
+ struct inode *inode, *h_inode;
|
|
|
|
|
+ struct super_block *sb;
|
|
|
|
|
+
|
|
|
|
|
+ AuDbg("%.*s, ctx{%pf, %llu}\n",
|
|
|
|
|
+ AuDLNPair(file->f_dentry), ctx->actor, ctx->pos);
|
|
|
|
|
+
|
|
|
|
|
+ dentry = file->f_dentry;
|
|
|
|
|
+ inode = dentry->d_inode;
|
|
|
|
|
+ IMustLock(inode);
|
|
|
|
@ -8354,7 +8382,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+
|
|
|
|
|
+ h_inode = au_h_iptr(inode, au_ibstart(inode));
|
|
|
|
|
+ if (!au_test_nfsd()) {
|
|
|
|
|
+ err = au_vdir_fill_de(file, dirent, filldir);
|
|
|
|
|
+ err = au_vdir_fill_de(file, ctx);
|
|
|
|
|
+ fsstack_copy_attr_atime(inode, h_inode);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ /*
|
|
|
|
@ -8364,7 +8392,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ atomic_inc(&h_inode->i_count);
|
|
|
|
|
+ di_read_unlock(dentry, AuLock_IR);
|
|
|
|
|
+ si_read_unlock(sb);
|
|
|
|
|
+ err = au_vdir_fill_de(file, dirent, filldir);
|
|
|
|
|
+ err = au_vdir_fill_de(file, ctx);
|
|
|
|
|
+ fsstack_copy_attr_atime(inode, h_inode);
|
|
|
|
|
+ fi_write_unlock(file);
|
|
|
|
|
+ iput(h_inode);
|
|
|
|
@ -8398,17 +8426,19 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+struct test_empty_arg {
|
|
|
|
|
+ struct dir_context ctx;
|
|
|
|
|
+ struct au_nhash *whlist;
|
|
|
|
|
+ unsigned int flags;
|
|
|
|
|
+ int err;
|
|
|
|
|
+ aufs_bindex_t bindex;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+static int test_empty_cb(void *__arg, const char *__name, int namelen,
|
|
|
|
|
+ loff_t offset __maybe_unused, u64 ino,
|
|
|
|
|
+static int test_empty_cb(struct dir_context *ctx, const char *__name,
|
|
|
|
|
+ int namelen, loff_t offset __maybe_unused, u64 ino,
|
|
|
|
|
+ unsigned int d_type)
|
|
|
|
|
+{
|
|
|
|
|
+ struct test_empty_arg *arg = __arg;
|
|
|
|
|
+ struct test_empty_arg *arg = container_of(ctx, struct test_empty_arg,
|
|
|
|
|
+ ctx);
|
|
|
|
|
+ char *name = (void *)__name;
|
|
|
|
|
+
|
|
|
|
|
+ arg->err = 0;
|
|
|
|
@ -8460,7 +8490,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ arg->err = 0;
|
|
|
|
|
+ au_fclr_testempty(arg->flags, CALLED);
|
|
|
|
|
+ /* smp_mb(); */
|
|
|
|
|
+ err = vfsub_readdir(h_file, test_empty_cb, arg);
|
|
|
|
|
+ err = vfsub_iterate_dir(h_file, &arg->ctx);
|
|
|
|
|
+ if (err >= 0)
|
|
|
|
|
+ err = arg->err;
|
|
|
|
|
+ } while (!err && au_ftest_testempty(arg->flags, CALLED));
|
|
|
|
@ -8521,7 +8551,11 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ unsigned int rdhash;
|
|
|
|
|
+ aufs_bindex_t bindex, bstart, btail;
|
|
|
|
|
+ struct au_nhash whlist;
|
|
|
|
|
+ struct test_empty_arg arg;
|
|
|
|
|
+ struct test_empty_arg arg = {
|
|
|
|
|
+ .ctx = {
|
|
|
|
|
+ .actor = au_diractor(test_empty_cb)
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ SiMustAnyLock(dentry->d_sb);
|
|
|
|
|
+
|
|
|
|
@ -8563,7 +8597,11 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+int au_test_empty(struct dentry *dentry, struct au_nhash *whlist)
|
|
|
|
|
+{
|
|
|
|
|
+ int err;
|
|
|
|
|
+ struct test_empty_arg arg;
|
|
|
|
|
+ struct test_empty_arg arg = {
|
|
|
|
|
+ .ctx = {
|
|
|
|
|
+ .actor = au_diractor(test_empty_cb)
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ aufs_bindex_t bindex, btail;
|
|
|
|
|
+
|
|
|
|
|
+ err = 0;
|
|
|
|
@ -8591,7 +8629,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ .owner = THIS_MODULE,
|
|
|
|
|
+ .llseek = default_llseek,
|
|
|
|
|
+ .read = generic_read_dir,
|
|
|
|
|
+ .readdir = aufs_readdir,
|
|
|
|
|
+ .iterate = aufs_iterate,
|
|
|
|
|
+ .unlocked_ioctl = aufs_ioctl_dir,
|
|
|
|
|
+#ifdef CONFIG_COMPAT
|
|
|
|
|
+ .compat_ioctl = aufs_compat_ioctl_dir,
|
|
|
|
@ -8602,7 +8640,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ .fsync = aufs_fsync_dir
|
|
|
|
|
+};
|
|
|
|
|
--- a/fs/aufs/dir.h 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/fs/aufs/dir.h 2013-03-10 01:48:58.459093058 +0000
|
|
|
|
|
+++ b/fs/aufs/dir.h 2013-07-22 05:16:41.115119378 +0100
|
|
|
|
|
@@ -0,0 +1,137 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2005-2013 Junjiro R. Okajima
|
|
|
|
@ -8712,7 +8750,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ unsigned char shwh);
|
|
|
|
|
+void au_vdir_free(struct au_vdir *vdir);
|
|
|
|
|
+int au_vdir_init(struct file *file);
|
|
|
|
|
+int au_vdir_fill_de(struct file *file, void *dirent, filldir_t filldir);
|
|
|
|
|
+int au_vdir_fill_de(struct file *file, struct dir_context *ctx);
|
|
|
|
|
+
|
|
|
|
|
+/* ioctl.c */
|
|
|
|
|
+long aufs_ioctl_dir(struct file *file, unsigned int cmd, unsigned long arg);
|
|
|
|
@ -8742,8 +8780,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+#endif /* __KERNEL__ */
|
|
|
|
|
+#endif /* __AUFS_DIR_H__ */
|
|
|
|
|
--- a/fs/aufs/dynop.c 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/fs/aufs/dynop.c 2013-06-02 18:23:34.749538984 +0100
|
|
|
|
|
@@ -0,0 +1,379 @@
|
|
|
|
|
+++ b/fs/aufs/dynop.c 2013-07-22 05:16:41.115119378 +0100
|
|
|
|
|
@@ -0,0 +1,380 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2010-2013 Junjiro R. Okajima
|
|
|
|
|
+ *
|
|
|
|
@ -8939,6 +8977,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ DySetAop(migratepage);
|
|
|
|
|
+ DySetAop(launder_page);
|
|
|
|
|
+ DySetAop(is_partially_uptodate);
|
|
|
|
|
+ DySetAop(is_dirty_writeback);
|
|
|
|
|
+ DySetAop(error_remove_page);
|
|
|
|
|
+ DySetAop(swap_activate);
|
|
|
|
|
+ DySetAop(swap_deactivate);
|
|
|
|
@ -9203,8 +9242,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+#endif /* __KERNEL__ */
|
|
|
|
|
+#endif /* __AUFS_DYNOP_H__ */
|
|
|
|
|
--- a/fs/aufs/export.c 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/fs/aufs/export.c 2013-06-02 18:23:34.749538984 +0100
|
|
|
|
|
@@ -0,0 +1,826 @@
|
|
|
|
|
+++ b/fs/aufs/export.c 2013-07-22 05:16:41.119119378 +0100
|
|
|
|
|
@@ -0,0 +1,832 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2005-2013 Junjiro R. Okajima
|
|
|
|
|
+ *
|
|
|
|
@ -9548,6 +9587,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+struct find_name_by_ino {
|
|
|
|
|
+ struct dir_context ctx;
|
|
|
|
|
+ int called, found;
|
|
|
|
|
+ ino_t ino;
|
|
|
|
|
+ char *name;
|
|
|
|
@ -9555,10 +9595,11 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+static int
|
|
|
|
|
+find_name_by_ino(void *arg, const char *name, int namelen, loff_t offset,
|
|
|
|
|
+ u64 ino, unsigned int d_type)
|
|
|
|
|
+find_name_by_ino(struct dir_context *ctx, const char *name, int namelen,
|
|
|
|
|
+ loff_t offset, u64 ino, unsigned int d_type)
|
|
|
|
|
+{
|
|
|
|
|
+ struct find_name_by_ino *a = arg;
|
|
|
|
|
+ struct find_name_by_ino *a = container_of(ctx, struct find_name_by_ino,
|
|
|
|
|
+ ctx);
|
|
|
|
|
+
|
|
|
|
|
+ a->called++;
|
|
|
|
|
+ if (a->ino != ino)
|
|
|
|
@ -9576,7 +9617,11 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ struct dentry *dentry, *parent;
|
|
|
|
|
+ struct file *file;
|
|
|
|
|
+ struct inode *dir;
|
|
|
|
|
+ struct find_name_by_ino arg;
|
|
|
|
|
+ struct find_name_by_ino arg = {
|
|
|
|
|
+ .ctx = {
|
|
|
|
|
+ .actor = au_diractor(find_name_by_ino)
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ int err;
|
|
|
|
|
+
|
|
|
|
|
+ parent = path->dentry;
|
|
|
|
@ -9596,7 +9641,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ do {
|
|
|
|
|
+ arg.called = 0;
|
|
|
|
|
+ /* smp_mb(); */
|
|
|
|
|
+ err = vfsub_readdir(file, find_name_by_ino, &arg);
|
|
|
|
|
+ err = vfsub_iterate_dir(file, &arg.ctx);
|
|
|
|
|
+ } while (!err && !arg.found && arg.called);
|
|
|
|
|
+ dentry = ERR_PTR(err);
|
|
|
|
|
+ if (unlikely(err))
|
|
|
|
@ -10032,7 +10077,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ atomic_set(&sbinfo->si_xigen_next, u);
|
|
|
|
|
+}
|
|
|
|
|
--- a/fs/aufs/f_op.c 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/fs/aufs/f_op.c 2013-06-02 18:23:34.753538984 +0100
|
|
|
|
|
+++ b/fs/aufs/f_op.c 2013-07-22 05:16:41.119119378 +0100
|
|
|
|
|
@@ -0,0 +1,721 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2005-2013 Junjiro R. Okajima
|
|
|
|
@ -10474,7 +10519,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ * It means that when aufs acquires si_rwsem for write, the process should never
|
|
|
|
|
+ * acquire mmap_sem.
|
|
|
|
|
+ *
|
|
|
|
|
+ * Actually aufs_readdir() holds [fdi]i_rwsem before mmap_sem, but this is not a
|
|
|
|
|
+ * Actually aufs_iterate() holds [fdi]i_rwsem before mmap_sem, but this is not a
|
|
|
|
|
+ * problem either since any directory is not able to be mmap-ed.
|
|
|
|
|
+ * The similar scenario is applied to aufs_readlink() too.
|
|
|
|
|
+ */
|
|
|
|
@ -11135,8 +11180,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ return ret;
|
|
|
|
|
+}
|
|
|
|
|
--- a/fs/aufs/file.c 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/fs/aufs/file.c 2013-06-02 18:23:34.753538984 +0100
|
|
|
|
|
@@ -0,0 +1,688 @@
|
|
|
|
|
+++ b/fs/aufs/file.c 2013-07-22 05:16:41.119119378 +0100
|
|
|
|
|
@@ -0,0 +1,694 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2005-2013 Junjiro R. Okajima
|
|
|
|
|
+ *
|
|
|
|
@ -11551,10 +11596,11 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ /* always superio. */
|
|
|
|
|
+ err = au_pin(&pin, dentry, bstart, AuOpt_UDBA_NONE,
|
|
|
|
|
+ AuPin_DI_LOCKED | AuPin_MNT_WRITE);
|
|
|
|
|
+ if (!err)
|
|
|
|
|
+ if (!err) {
|
|
|
|
|
+ err = au_sio_cpup_simple(dentry, bstart, -1,
|
|
|
|
|
+ AuCpup_DTIME, &pin);
|
|
|
|
|
+ au_unpin(&pin);
|
|
|
|
|
+ au_unpin(&pin);
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (hi_wh) {
|
|
|
|
|
+ /* already copied-up after unlink */
|
|
|
|
|
+ err = au_reopen_wh(file, bstart, hi_wh);
|
|
|
|
@ -11780,7 +11826,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+
|
|
|
|
|
+static int aufs_set_page_dirty(struct page *page)
|
|
|
|
|
+{ AuUnsupport(); return 0; }
|
|
|
|
|
+static void aufs_invalidatepage(struct page *page, unsigned long offset)
|
|
|
|
|
+static void aufs_invalidatepage(struct page *page, unsigned int offset,
|
|
|
|
|
+ unsigned int length)
|
|
|
|
|
+{ AuUnsupport(); }
|
|
|
|
|
+static int aufs_releasepage(struct page *page, gfp_t gfp)
|
|
|
|
|
+{ AuUnsupport(); return 0; }
|
|
|
|
@ -11793,6 +11840,9 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ read_descriptor_t *desc,
|
|
|
|
|
+ unsigned long from)
|
|
|
|
|
+{ AuUnsupport(); return 0; }
|
|
|
|
|
+static void aufs_is_dirty_writeback(struct page *page, bool *dirty,
|
|
|
|
|
+ bool *writeback)
|
|
|
|
|
+{ AuUnsupport(); }
|
|
|
|
|
+static int aufs_error_remove_page(struct address_space *mapping,
|
|
|
|
|
+ struct page *page)
|
|
|
|
|
+{ AuUnsupport(); return 0; }
|
|
|
|
@ -11820,6 +11870,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ .migratepage = aufs_migratepage,
|
|
|
|
|
+ .launder_page = aufs_launder_page,
|
|
|
|
|
+ .is_partially_uptodate = aufs_is_partially_uptodate,
|
|
|
|
|
+ .is_dirty_writeback = aufs_is_dirty_writeback,
|
|
|
|
|
+ .error_remove_page = aufs_error_remove_page,
|
|
|
|
|
+ .swap_activate = aufs_swap_activate,
|
|
|
|
|
+ .swap_deactivate = aufs_swap_deactivate
|
|
|
|
@ -13138,7 +13189,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
--- a/fs/aufs/hnotify.c 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/fs/aufs/hnotify.c 2013-06-02 18:23:34.753538984 +0100
|
|
|
|
|
+++ b/fs/aufs/hnotify.c 2013-07-22 05:16:41.119119378 +0100
|
|
|
|
|
@@ -0,0 +1,712 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2005-2013 Junjiro R. Okajima
|
|
|
|
@ -13530,7 +13581,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ au_digen_dec(d);
|
|
|
|
|
+ else
|
|
|
|
|
+ goto cont_unlock;
|
|
|
|
|
+ if (d->d_count) {
|
|
|
|
|
+ if (d_count(d)) {
|
|
|
|
|
+ dentry = dget_dlock(d);
|
|
|
|
|
+ spin_unlock(&d->d_lock);
|
|
|
|
|
+ break;
|
|
|
|
@ -13853,8 +13904,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ au_hn_destroy_cache();
|
|
|
|
|
+}
|
|
|
|
|
--- a/fs/aufs/i_op.c 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/fs/aufs/i_op.c 2013-06-02 18:23:34.753538984 +0100
|
|
|
|
|
@@ -0,0 +1,1107 @@
|
|
|
|
|
+++ b/fs/aufs/i_op.c 2013-07-22 05:16:41.119119378 +0100
|
|
|
|
|
@@ -0,0 +1,1100 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2005-2013 Junjiro R. Okajima
|
|
|
|
|
+ *
|
|
|
|
@ -14487,7 +14538,6 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ aufs_bindex_t bstart, ibstart;
|
|
|
|
|
+ struct dentry *hi_wh, *parent;
|
|
|
|
|
+ struct inode *inode;
|
|
|
|
|
+ struct file *h_file;
|
|
|
|
|
+ struct au_wr_dir_args wr_dir_args = {
|
|
|
|
|
+ .force_btgt = -1,
|
|
|
|
|
+ .flags = 0
|
|
|
|
@ -14529,7 +14579,6 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ sz = ia->ia_size;
|
|
|
|
|
+ mutex_unlock(&a->h_inode->i_mutex);
|
|
|
|
|
+
|
|
|
|
|
+ h_file = NULL;
|
|
|
|
|
+ hi_wh = NULL;
|
|
|
|
|
+ if (au_ftest_icpup(a->flags, DID_CPUP) && d_unlinked(dentry)) {
|
|
|
|
|
+ hi_wh = au_hi_wh(inode, a->btgt);
|
|
|
|
@ -14553,14 +14602,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ goto out; /* success */
|
|
|
|
|
+
|
|
|
|
|
+ if (!d_unhashed(dentry)) {
|
|
|
|
|
+ h_file = au_h_open_pre(dentry, bstart);
|
|
|
|
|
+ if (IS_ERR(h_file))
|
|
|
|
|
+ err = PTR_ERR(h_file);
|
|
|
|
|
+ else {
|
|
|
|
|
+ err = au_sio_cpup_simple(dentry, a->btgt, sz,
|
|
|
|
|
+ AuCpup_DTIME, &a->pin);
|
|
|
|
|
+ au_h_open_post(dentry, bstart, h_file);
|
|
|
|
|
+ }
|
|
|
|
|
+ err = au_sio_cpup_simple_h_open(dentry, a->btgt, sz,
|
|
|
|
|
+ AuCpup_DTIME, &a->pin, bstart);
|
|
|
|
|
+ if (!err)
|
|
|
|
|
+ a->h_path.dentry = au_h_dptr(dentry, a->btgt);
|
|
|
|
|
+ } else if (!hi_wh)
|
|
|
|
@ -14711,6 +14754,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ n = inode->i_nlink;
|
|
|
|
|
+ n -= nlink;
|
|
|
|
|
+ n += st->nlink;
|
|
|
|
|
+ smp_mb();
|
|
|
|
|
+ /* 0 can happen */
|
|
|
|
|
+ set_nlink(inode, n);
|
|
|
|
|
+ }
|
|
|
|
@ -14963,8 +15007,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ .update_time = aufs_update_time
|
|
|
|
|
+};
|
|
|
|
|
--- a/fs/aufs/i_op_add.c 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/fs/aufs/i_op_add.c 2013-06-02 18:23:34.753538984 +0100
|
|
|
|
|
@@ -0,0 +1,722 @@
|
|
|
|
|
+++ b/fs/aufs/i_op_add.c 2013-07-22 05:16:41.119119378 +0100
|
|
|
|
|
@@ -0,0 +1,716 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2005-2013 Junjiro R. Okajima
|
|
|
|
|
+ *
|
|
|
|
@ -15326,7 +15370,6 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+{
|
|
|
|
|
+ int err;
|
|
|
|
|
+ struct dentry *h_src_dentry;
|
|
|
|
|
+ struct file *h_file;
|
|
|
|
|
+
|
|
|
|
|
+ di_read_lock_parent(a->src_parent, AuLock_IR);
|
|
|
|
|
+ err = au_test_and_cpup_dirs(src_dentry, a->bdst);
|
|
|
|
@ -15339,15 +15382,10 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ AuPin_DI_LOCKED | AuPin_MNT_WRITE);
|
|
|
|
|
+ if (unlikely(err))
|
|
|
|
|
+ goto out;
|
|
|
|
|
+ h_file = au_h_open_pre(src_dentry, a->bsrc);
|
|
|
|
|
+ if (IS_ERR(h_file))
|
|
|
|
|
+ err = PTR_ERR(h_file);
|
|
|
|
|
+ else {
|
|
|
|
|
+ err = au_sio_cpup_simple(src_dentry, a->bdst, -1,
|
|
|
|
|
+ AuCpup_DTIME /* | AuCpup_KEEPLINO */,
|
|
|
|
|
+ &a->pin);
|
|
|
|
|
+ au_h_open_post(src_dentry, a->bsrc, h_file);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ err = au_sio_cpup_simple_h_open(src_dentry, a->bdst, -1,
|
|
|
|
|
+ AuCpup_DTIME /* | AuCpup_KEEPLINO */,
|
|
|
|
|
+ &a->pin, a->bsrc);
|
|
|
|
|
+ au_unpin(&a->pin);
|
|
|
|
|
+
|
|
|
|
|
+out:
|
|
|
|
@ -16168,8 +16206,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ return err;
|
|
|
|
|
+}
|
|
|
|
|
--- a/fs/aufs/i_op_ren.c 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/fs/aufs/i_op_ren.c 2013-06-02 18:23:34.753538984 +0100
|
|
|
|
|
@@ -0,0 +1,1053 @@
|
|
|
|
|
+++ b/fs/aufs/i_op_ren.c 2013-07-22 05:16:41.119119378 +0100
|
|
|
|
|
@@ -0,0 +1,1045 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2005-2013 Junjiro R. Okajima
|
|
|
|
|
+ *
|
|
|
|
@ -17133,26 +17171,18 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+
|
|
|
|
|
+ /* cpup src */
|
|
|
|
|
+ if (a->src_bstart != a->btgt) {
|
|
|
|
|
+ struct file *h_file;
|
|
|
|
|
+ struct au_pin pin;
|
|
|
|
|
+
|
|
|
|
|
+ err = au_pin(&pin, a->src_dentry, a->btgt,
|
|
|
|
|
+ au_opt_udba(a->src_dentry->d_sb),
|
|
|
|
|
+ AuPin_DI_LOCKED | AuPin_MNT_WRITE);
|
|
|
|
|
+ if (unlikely(err))
|
|
|
|
|
+ goto out_children;
|
|
|
|
|
+
|
|
|
|
|
+ AuDebugOn(au_dbstart(a->src_dentry) != a->src_bstart);
|
|
|
|
|
+ h_file = au_h_open_pre(a->src_dentry, a->src_bstart);
|
|
|
|
|
+ if (IS_ERR(h_file)) {
|
|
|
|
|
+ err = PTR_ERR(h_file);
|
|
|
|
|
+ h_file = NULL;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ err = au_sio_cpup_simple(a->src_dentry, a->btgt, -1,
|
|
|
|
|
+ AuCpup_DTIME, &pin);
|
|
|
|
|
+ au_h_open_post(a->src_dentry, a->src_bstart, h_file);
|
|
|
|
|
+ if (!err) {
|
|
|
|
|
+ AuDebugOn(au_dbstart(a->src_dentry) != a->src_bstart);
|
|
|
|
|
+ err = au_sio_cpup_simple_h_open(a->src_dentry, a->btgt,
|
|
|
|
|
+ -1, AuCpup_DTIME, &pin,
|
|
|
|
|
+ a->src_bstart);
|
|
|
|
|
+ au_unpin(&pin);
|
|
|
|
|
+ }
|
|
|
|
|
+ au_unpin(&pin);
|
|
|
|
|
+ if (unlikely(err))
|
|
|
|
|
+ goto out_children;
|
|
|
|
|
+ a->src_bstart = a->btgt;
|
|
|
|
@ -18800,8 +18830,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+#endif
|
|
|
|
|
+#endif
|
|
|
|
|
--- a/fs/aufs/loop.c 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/fs/aufs/loop.c 2013-06-02 18:23:34.753538984 +0100
|
|
|
|
|
@@ -0,0 +1,135 @@
|
|
|
|
|
+++ b/fs/aufs/loop.c 2013-07-22 05:16:41.119119378 +0100
|
|
|
|
|
@@ -0,0 +1,134 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2005-2013 Junjiro R. Okajima
|
|
|
|
|
+ *
|
|
|
|
@ -18824,7 +18854,6 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ * support for loopback block device as a branch
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
|
|
+#include <linux/loop.h>
|
|
|
|
|
+#include "aufs.h"
|
|
|
|
|
+
|
|
|
|
|
+/*
|
|
|
|
@ -18833,14 +18862,14 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+int au_test_loopback_overlap(struct super_block *sb, struct dentry *h_adding)
|
|
|
|
|
+{
|
|
|
|
|
+ struct super_block *h_sb;
|
|
|
|
|
+ struct loop_device *l;
|
|
|
|
|
+ struct file *backing_file;
|
|
|
|
|
+
|
|
|
|
|
+ h_sb = h_adding->d_sb;
|
|
|
|
|
+ if (MAJOR(h_sb->s_dev) != LOOP_MAJOR)
|
|
|
|
|
+ backing_file = loop_backing_file(h_sb);
|
|
|
|
|
+ if (!backing_file)
|
|
|
|
|
+ return 0;
|
|
|
|
|
+
|
|
|
|
|
+ l = h_sb->s_bdev->bd_disk->private_data;
|
|
|
|
|
+ h_adding = l->lo_backing_file->f_dentry;
|
|
|
|
|
+ h_adding = backing_file->f_dentry;
|
|
|
|
|
+ /*
|
|
|
|
|
+ * h_adding can be local NFS.
|
|
|
|
|
+ * in this case aufs cannot detect the loop.
|
|
|
|
@ -18938,8 +18967,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ kfree(au_warn_loopback_array);
|
|
|
|
|
+}
|
|
|
|
|
--- a/fs/aufs/loop.h 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/fs/aufs/loop.h 2013-03-10 01:48:58.463093058 +0000
|
|
|
|
|
@@ -0,0 +1,50 @@
|
|
|
|
|
+++ b/fs/aufs/loop.h 2013-07-22 05:16:41.119119378 +0100
|
|
|
|
|
@@ -0,0 +1,53 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2005-2013 Junjiro R. Okajima
|
|
|
|
|
+ *
|
|
|
|
@ -18971,6 +19000,9 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+struct super_block;
|
|
|
|
|
+
|
|
|
|
|
+#ifdef CONFIG_AUFS_BDEV_LOOP
|
|
|
|
|
+/* drivers/block/loop.c */
|
|
|
|
|
+struct file *loop_backing_file(struct super_block *sb);
|
|
|
|
|
+
|
|
|
|
|
+/* loop.c */
|
|
|
|
|
+int au_test_loopback_overlap(struct super_block *sb, struct dentry *h_adding);
|
|
|
|
|
+int au_test_loopback_kthread(void);
|
|
|
|
@ -22029,8 +22061,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ return err;
|
|
|
|
|
+}
|
|
|
|
|
--- a/fs/aufs/rdu.c 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/fs/aufs/rdu.c 2013-05-04 18:39:11.239157326 +0100
|
|
|
|
|
@@ -0,0 +1,384 @@
|
|
|
|
|
+++ b/fs/aufs/rdu.c 2013-07-22 05:16:41.119119378 +0100
|
|
|
|
|
@@ -0,0 +1,389 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2005-2013 Junjiro R. Okajima
|
|
|
|
|
+ *
|
|
|
|
@ -22069,6 +22101,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ do { (flags) &= ~AuRdu_##name; } while (0)
|
|
|
|
|
+
|
|
|
|
|
+struct au_rdu_arg {
|
|
|
|
|
+ struct dir_context ctx;
|
|
|
|
|
+ struct aufs_rdu *rdu;
|
|
|
|
|
+ union au_rdu_ent_ul ent;
|
|
|
|
|
+ unsigned long end;
|
|
|
|
@ -22077,11 +22110,11 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ int err;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+static int au_rdu_fill(void *__arg, const char *name, int nlen,
|
|
|
|
|
+static int au_rdu_fill(struct dir_context *ctx, const char *name, int nlen,
|
|
|
|
|
+ loff_t offset, u64 h_ino, unsigned int d_type)
|
|
|
|
|
+{
|
|
|
|
|
+ int err, len;
|
|
|
|
|
+ struct au_rdu_arg *arg = __arg;
|
|
|
|
|
+ struct au_rdu_arg *arg = container_of(ctx, struct au_rdu_arg, ctx);
|
|
|
|
|
+ struct aufs_rdu *rdu = arg->rdu;
|
|
|
|
|
+ struct au_rdu_ent ent;
|
|
|
|
|
+
|
|
|
|
@ -22139,7 +22172,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ arg->err = 0;
|
|
|
|
|
+ au_fclr_rdu(cookie->flags, CALLED);
|
|
|
|
|
+ /* smp_mb(); */
|
|
|
|
|
+ err = vfsub_readdir(h_file, au_rdu_fill, arg);
|
|
|
|
|
+ err = vfsub_iterate_dir(h_file, &arg->ctx);
|
|
|
|
|
+ if (err >= 0)
|
|
|
|
|
+ err = arg->err;
|
|
|
|
|
+ } while (!err
|
|
|
|
@ -22156,7 +22189,11 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+{
|
|
|
|
|
+ int err;
|
|
|
|
|
+ aufs_bindex_t bend;
|
|
|
|
|
+ struct au_rdu_arg arg;
|
|
|
|
|
+ struct au_rdu_arg arg = {
|
|
|
|
|
+ .ctx = {
|
|
|
|
|
+ .actor = au_diractor(au_rdu_fill)
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ struct dentry *dentry;
|
|
|
|
|
+ struct inode *inode;
|
|
|
|
|
+ struct file *h_file;
|
|
|
|
@ -22177,7 +22214,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ arg.end += rdu->sz;
|
|
|
|
|
+
|
|
|
|
|
+ err = -ENOTDIR;
|
|
|
|
|
+ if (unlikely(!file->f_op || !file->f_op->readdir))
|
|
|
|
|
+ if (unlikely(!file->f_op || !file->f_op->iterate))
|
|
|
|
|
+ goto out;
|
|
|
|
|
+
|
|
|
|
|
+ err = security_file_permission(file, MAY_READ);
|
|
|
|
@ -25253,8 +25290,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ pr_err("err %d (ignored)\n", err);
|
|
|
|
|
+}
|
|
|
|
|
--- a/fs/aufs/vdir.c 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/fs/aufs/vdir.c 2013-06-02 18:23:34.753538984 +0100
|
|
|
|
|
@@ -0,0 +1,878 @@
|
|
|
|
|
+++ b/fs/aufs/vdir.c 2013-07-22 05:16:41.119119378 +0100
|
|
|
|
|
@@ -0,0 +1,888 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2005-2013 Junjiro R. Okajima
|
|
|
|
|
+ *
|
|
|
|
@ -25694,6 +25731,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
|
|
+struct fillvdir_arg {
|
|
|
|
|
+ struct dir_context ctx;
|
|
|
|
|
+ struct file *file;
|
|
|
|
|
+ struct au_vdir *vdir;
|
|
|
|
|
+ struct au_nhash delist;
|
|
|
|
@ -25703,11 +25741,11 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ int err;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+static int fillvdir(void *__arg, const char *__name, int nlen,
|
|
|
|
|
+static int fillvdir(struct dir_context *ctx, const char *__name, int nlen,
|
|
|
|
|
+ loff_t offset __maybe_unused, u64 h_ino,
|
|
|
|
|
+ unsigned int d_type)
|
|
|
|
|
+{
|
|
|
|
|
+ struct fillvdir_arg *arg = __arg;
|
|
|
|
|
+ struct fillvdir_arg *arg = container_of(ctx, struct fillvdir_arg, ctx);
|
|
|
|
|
+ char *name = (void *)__name;
|
|
|
|
|
+ struct super_block *sb;
|
|
|
|
|
+ ino_t ino;
|
|
|
|
@ -25855,10 +25893,15 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ arg->err = 0;
|
|
|
|
|
+ au_fclr_fillvdir(arg->flags, CALLED);
|
|
|
|
|
+ /* smp_mb(); */
|
|
|
|
|
+ err = vfsub_readdir(hf, fillvdir, arg);
|
|
|
|
|
+ err = vfsub_iterate_dir(hf, &arg->ctx);
|
|
|
|
|
+ if (err >= 0)
|
|
|
|
|
+ err = arg->err;
|
|
|
|
|
+ } while (!err && au_ftest_fillvdir(arg->flags, CALLED));
|
|
|
|
|
+
|
|
|
|
|
+ /*
|
|
|
|
|
+ * dir_relax() may be good for concurrency, but aufs should not
|
|
|
|
|
+ * use it since it will cause a lockdep problem.
|
|
|
|
|
+ */
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!err && shwh)
|
|
|
|
@ -25877,7 +25920,11 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ int err;
|
|
|
|
|
+ unsigned long expire;
|
|
|
|
|
+ unsigned char do_read;
|
|
|
|
|
+ struct fillvdir_arg arg;
|
|
|
|
|
+ struct fillvdir_arg arg = {
|
|
|
|
|
+ .ctx = {
|
|
|
|
|
+ .actor = au_diractor(fillvdir)
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ struct inode *inode;
|
|
|
|
|
+ struct au_vdir *vdir, *allocated;
|
|
|
|
|
+
|
|
|
|
@ -25914,7 +25961,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ arg.vdir = vdir;
|
|
|
|
|
+ err = au_do_read_vdir(&arg);
|
|
|
|
|
+ if (!err) {
|
|
|
|
|
+ /* file->f_pos = 0; */
|
|
|
|
|
+ /* file->f_pos = 0; */ /* todo: ctx->pos? */
|
|
|
|
|
+ vdir->vd_version = inode->i_version;
|
|
|
|
|
+ vdir->vd_last.ul = 0;
|
|
|
|
|
+ vdir->vd_last.p.deblk = vdir->vd_deblk[0];
|
|
|
|
@ -25987,6 +26034,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ struct inode *inode;
|
|
|
|
|
+ struct au_vdir *vdir_cache, *allocated;
|
|
|
|
|
+
|
|
|
|
|
+ /* test file->f_pos here instead of ctx->pos */
|
|
|
|
|
+ err = read_vdir(file, !file->f_pos);
|
|
|
|
|
+ if (unlikely(err))
|
|
|
|
|
+ goto out;
|
|
|
|
@ -26000,6 +26048,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ goto out;
|
|
|
|
|
+ allocated = vdir_cache;
|
|
|
|
|
+ } else if (!file->f_pos && vdir_cache->vd_version != file->f_version) {
|
|
|
|
|
+ /* test file->f_pos here instead of ctx->pos */
|
|
|
|
|
+ err = reinit_vdir(vdir_cache);
|
|
|
|
|
+ if (unlikely(err))
|
|
|
|
|
+ goto out;
|
|
|
|
@ -26031,7 +26080,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/* returns true or false */
|
|
|
|
|
+static int seek_vdir(struct file *file)
|
|
|
|
|
+static int seek_vdir(struct file *file, struct dir_context *ctx)
|
|
|
|
|
+{
|
|
|
|
|
+ int valid;
|
|
|
|
|
+ unsigned int deblk_sz;
|
|
|
|
@ -26044,17 +26093,17 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ vdir_cache = au_fvdir_cache(file);
|
|
|
|
|
+ offset = calc_offset(vdir_cache);
|
|
|
|
|
+ AuDbg("offset %lld\n", offset);
|
|
|
|
|
+ if (file->f_pos == offset)
|
|
|
|
|
+ if (ctx->pos == offset)
|
|
|
|
|
+ goto out;
|
|
|
|
|
+
|
|
|
|
|
+ vdir_cache->vd_last.ul = 0;
|
|
|
|
|
+ vdir_cache->vd_last.p.deblk = vdir_cache->vd_deblk[0];
|
|
|
|
|
+ if (!file->f_pos)
|
|
|
|
|
+ if (!ctx->pos)
|
|
|
|
|
+ goto out;
|
|
|
|
|
+
|
|
|
|
|
+ valid = 0;
|
|
|
|
|
+ deblk_sz = vdir_cache->vd_deblk_sz;
|
|
|
|
|
+ ul = div64_u64(file->f_pos, deblk_sz);
|
|
|
|
|
+ ul = div64_u64(ctx->pos, deblk_sz);
|
|
|
|
|
+ AuDbg("ul %lu\n", ul);
|
|
|
|
|
+ if (ul >= vdir_cache->vd_nblk)
|
|
|
|
|
+ goto out;
|
|
|
|
@ -26065,7 +26114,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ deblk_end.deblk = p.deblk + deblk_sz;
|
|
|
|
|
+ offset = ul;
|
|
|
|
|
+ offset *= deblk_sz;
|
|
|
|
|
+ while (!is_deblk_end(&p, &deblk_end) && offset < file->f_pos) {
|
|
|
|
|
+ while (!is_deblk_end(&p, &deblk_end) && offset < ctx->pos) {
|
|
|
|
|
+ unsigned int l;
|
|
|
|
|
+
|
|
|
|
|
+ l = calc_size(p.de->de_str.len);
|
|
|
|
@ -26086,16 +26135,15 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ return valid;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+int au_vdir_fill_de(struct file *file, void *dirent, filldir_t filldir)
|
|
|
|
|
+int au_vdir_fill_de(struct file *file, struct dir_context *ctx)
|
|
|
|
|
+{
|
|
|
|
|
+ int err;
|
|
|
|
|
+ unsigned int l, deblk_sz;
|
|
|
|
|
+ union au_vdir_deblk_p deblk_end;
|
|
|
|
|
+ struct au_vdir *vdir_cache;
|
|
|
|
|
+ struct au_vdir_de *de;
|
|
|
|
|
+
|
|
|
|
|
+ vdir_cache = au_fvdir_cache(file);
|
|
|
|
|
+ if (!seek_vdir(file))
|
|
|
|
|
+ if (!seek_vdir(file, ctx))
|
|
|
|
|
+ return 0;
|
|
|
|
|
+
|
|
|
|
|
+ deblk_sz = vdir_cache->vd_deblk_sz;
|
|
|
|
@ -26105,12 +26153,11 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ while (!is_deblk_end(&vdir_cache->vd_last.p, &deblk_end)) {
|
|
|
|
|
+ de = vdir_cache->vd_last.p.de;
|
|
|
|
|
+ AuDbg("%.*s, off%lld, i%lu, dt%d\n",
|
|
|
|
|
+ de->de_str.len, de->de_str.name, file->f_pos,
|
|
|
|
|
+ de->de_str.len, de->de_str.name, ctx->pos,
|
|
|
|
|
+ (unsigned long)de->de_ino, de->de_type);
|
|
|
|
|
+ err = filldir(dirent, de->de_str.name, de->de_str.len,
|
|
|
|
|
+ file->f_pos, de->de_ino, de->de_type);
|
|
|
|
|
+ if (unlikely(err)) {
|
|
|
|
|
+ AuTraceErr(err);
|
|
|
|
|
+ if (unlikely(!dir_emit(ctx, de->de_str.name,
|
|
|
|
|
+ de->de_str.len, de->de_ino,
|
|
|
|
|
+ de->de_type))) {
|
|
|
|
|
+ /* todo: ignore the error caused by udba? */
|
|
|
|
|
+ /* return err; */
|
|
|
|
|
+ return 0;
|
|
|
|
@ -26118,13 +26165,13 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+
|
|
|
|
|
+ l = calc_size(de->de_str.len);
|
|
|
|
|
+ vdir_cache->vd_last.p.deblk += l;
|
|
|
|
|
+ file->f_pos += l;
|
|
|
|
|
+ ctx->pos += l;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (vdir_cache->vd_last.ul < vdir_cache->vd_nblk - 1) {
|
|
|
|
|
+ vdir_cache->vd_last.ul++;
|
|
|
|
|
+ vdir_cache->vd_last.p.deblk
|
|
|
|
|
+ = vdir_cache->vd_deblk[vdir_cache->vd_last.ul];
|
|
|
|
|
+ file->f_pos = deblk_sz * vdir_cache->vd_last.ul;
|
|
|
|
|
+ ctx->pos = deblk_sz * vdir_cache->vd_last.ul;
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
@ -26134,8 +26181,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ return 0;
|
|
|
|
|
+}
|
|
|
|
|
--- a/fs/aufs/vfsub.c 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/fs/aufs/vfsub.c 2013-06-02 18:23:34.753538984 +0100
|
|
|
|
|
@@ -0,0 +1,769 @@
|
|
|
|
|
+++ b/fs/aufs/vfsub.c 2013-07-22 05:16:41.119119378 +0100
|
|
|
|
|
@@ -0,0 +1,772 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2005-2013 Junjiro R. Okajima
|
|
|
|
|
+ *
|
|
|
|
@ -26614,12 +26661,15 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ return err;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+int vfsub_readdir(struct file *file, filldir_t filldir, void *arg)
|
|
|
|
|
+int vfsub_iterate_dir(struct file *file, struct dir_context *ctx)
|
|
|
|
|
+{
|
|
|
|
|
+ int err;
|
|
|
|
|
+
|
|
|
|
|
+ AuDbg("%.*s, ctx{%pf, %llu}\n",
|
|
|
|
|
+ AuDLNPair(file->f_dentry), ctx->actor, ctx->pos);
|
|
|
|
|
+
|
|
|
|
|
+ lockdep_off();
|
|
|
|
|
+ err = vfs_readdir(file, filldir, arg);
|
|
|
|
|
+ err = iterate_dir(file, ctx);
|
|
|
|
|
+ lockdep_on();
|
|
|
|
|
+ if (err >= 0)
|
|
|
|
|
+ vfsub_update_h_iattr(&file->f_path, /*did*/NULL); /*ignore*/
|
|
|
|
@ -26845,7 +26895,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ struct dentry *d = a->path->dentry;
|
|
|
|
|
+ struct inode *h_inode;
|
|
|
|
|
+ const int stop_sillyrename = (au_test_nfs(d->d_sb)
|
|
|
|
|
+ && d->d_count == 1);
|
|
|
|
|
+ && d_count(d) == 1);
|
|
|
|
|
+
|
|
|
|
|
+ IMustLock(a->dir);
|
|
|
|
|
+
|
|
|
|
@ -26906,8 +26956,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ return err;
|
|
|
|
|
+}
|
|
|
|
|
--- a/fs/aufs/vfsub.h 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/fs/aufs/vfsub.h 2013-06-02 18:23:34.753538984 +0100
|
|
|
|
|
@@ -0,0 +1,294 @@
|
|
|
|
|
+++ b/fs/aufs/vfsub.h 2013-07-22 05:16:41.119119378 +0100
|
|
|
|
|
@@ -0,0 +1,303 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2005-2013 Junjiro R. Okajima
|
|
|
|
|
+ *
|
|
|
|
@ -27091,7 +27141,16 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+ssize_t vfsub_write_k(struct file *file, void *kbuf, size_t count,
|
|
|
|
|
+ loff_t *ppos);
|
|
|
|
|
+int vfsub_flush(struct file *file, fl_owner_t id);
|
|
|
|
|
+int vfsub_readdir(struct file *file, filldir_t filldir, void *arg);
|
|
|
|
|
+int vfsub_iterate_dir(struct file *file, struct dir_context *ctx);
|
|
|
|
|
+
|
|
|
|
|
+/* just for type-check */
|
|
|
|
|
+static inline filldir_t au_diractor(int (*func)(struct dir_context *,
|
|
|
|
|
+ const char *, int, loff_t, u64,
|
|
|
|
|
+ unsigned))
|
|
|
|
|
+{
|
|
|
|
|
+ return (filldir_t)func;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+static inline loff_t vfsub_f_size_read(struct file *file)
|
|
|
|
|
+{
|
|
|
|
@ -30622,7 +30681,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+
|
|
|
|
|
+#include <uapi/linux/aufs_type.h>
|
|
|
|
|
--- a/include/uapi/linux/aufs_type.h 1970-01-01 01:00:00.000000000 +0100
|
|
|
|
|
+++ b/include/uapi/linux/aufs_type.h 2013-06-02 18:23:34.757538984 +0100
|
|
|
|
|
+++ b/include/uapi/linux/aufs_type.h 2013-07-22 05:16:41.123119378 +0100
|
|
|
|
|
@@ -0,0 +1,235 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * Copyright (C) 2005-2013 Junjiro R. Okajima
|
|
|
|
@ -30666,7 +30725,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch
|
|
|
|
|
+
|
|
|
|
|
+#include <linux/limits.h>
|
|
|
|
|
+
|
|
|
|
|
+#define AUFS_VERSION "3.x-rcN-20130520"
|
|
|
|
|
+#define AUFS_VERSION "3.x-rcN-20130722"
|
|
|
|
|
+
|
|
|
|
|
+/* todo? move this to linux-2.6.19/include/magic.h */
|
|
|
|
|
+#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's')
|
|
|
|
|