Re: [PATCH 8/67] aufs module global variables and operations

Previous thread: none

Next thread: [Re: Linux 2.6.26-rc2] Write protect on on by Maciej Rutecki on Friday, May 16, 2008 - 10:55 am. (14 messages)
To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs document

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
Documentation/filesystems/aufs/README | 374 +++++++++++++++++++++++++++++++++
1 files changed, 374 insertions(+), 0 deletions(-)

diff --git a/Documentation/filesystems/aufs/README b/Documentation/filesystems/aufs/README
new file mode 100644
index 0000000..ebe19db
--- /dev/null
+++ b/Documentation/filesystems/aufs/README
@@ -0,0 +1,374 @@
+
+Aufs -- Another Unionfs
+Junjiro Okajima
+
+# $Id: README,v 1.79 2008/05/04 23:55:14 sfjro Exp $
+
+
+0. Introduction
+----------------------------------------
+In the early days, aufs was entirely re-designed and re-implemented
+Unionfs Version 1.x series. After many original ideas, approaches,
+improvements and implementations, it becomes totally different from
+Unionfs while keeping the basic features.
+Recently, Unionfs Version 2.x series begin taking some of same
+approaches to aufs's.
+Unionfs is being developed by Professor Erez Zadok at Stony Brook
+University and his team.
+If you don't know Unionfs, I recommend you becoming familiar with it
+before using aufs. Some terminology in aufs follows Unionfs's.
+
+Bug reports (including my broken English), suggestions, comments
+and donations are always welcome. Your bug report may help other users,
+including future users. Especially the bug report which doesn't follow
+unix/linux filesystem's semantics is important.
+
+
+1. Features
+----------------------------------------
+- unite several directories into a single virtual filesystem. The member
+ directory is called as a branch.
+- you can specify the permission flags to the branch, which are 'readonly',
+ 'readwrite' and 'whiteout-able.'
+- by upper writable branch, internal copyup and whiteout, files/dirs on
+ readonly branch are modifiable logically.
+- dynamic branch manipulation, add, del.
+- etc... see Unionfs in detail.
+
+Also there are many enhancements in...

To: <hooanon05@...>
Cc: <linux-fsdevel@...>, <linux-kernel@...>
Date: Friday, May 16, 2008 - 10:59 am

A couple of comments about this. First off you might want to reconsider
how you are breaking up the patches. 67 patches seems a bit much to me
and while the separation between patches is clear it seems that some of
them can be folded. Second I'm not sure if I haven't gotten it yet or if
it wasn't sent but I am missing an Email 0/67. Typically this contains a
description of the patch set, an index of the patches (possibly with
descriptions), and a diffstat for the entire patch set. The last thing
is that each patch should have a worth wile description attached to it.
All of your comments are two lines and that may make sense based on how
you have it broken up but if you start breaking up the patch set
differently you will need better descriptions (possibly even now for
some of the more obscure functionality).

Dave

--

To: Dave Quigley <dpquigl@...>
Cc: <linux-fsdevel@...>, <linux-kernel@...>
Date: Friday, May 16, 2008 - 11:45 am

Hello Dave,
Thank you for your comments.

About diffstat, actually I send it but the subject was not 0/67.
Please read the thread whose subject is
"[RFC n/2] AUFS: merging/stacking several filesystems"
The last message in the thread which I sent just before the patch series
has diffstat.
Do you want me to re-send it after changing the subject line?

About the number of patches, I have to agree it is large. I chose the
way to make a patch per a new file, and in case of modifying the
existing multiple files I made a single patch. I guess the latter is the
case you wrote "can be folded."

About the description, simple one for the new files because they are
brand new... I wrote a little more in case of modifying the existing
files (see the last patch). Of course a more detail description will be
necessary in future modification.
If you think the functionality is obscure, please read the aufs
documents included in the patch set (the first patches).

Junjiro Okajima

--

To: <hooanon05@...>
Cc: <linux-fsdevel@...>, <linux-kernel@...>
Date: Friday, May 16, 2008 - 12:09 pm

You don't have to resend it now. Just keep it in mind for future patch

Yea in some cases this is possible. You could roll all headers into one
patch. Or you could roll a header and its corresponding source into a

It is fine to have an overall document describing your FS but there are
things you have missing. For example patch 62. Why do you have magic
sysreq handling? What does it do? What problem is it solving? This isn't
in your 01 patch and I can't tell its purpose at all from the patch.

Another example is what are your sysfs entries for? A description of
what they are for in either the main doc or as a patch comment is
necessary. Why is your sysfs functionality broken out into two patches?

There are many other things like this. I must admit our initial release
of Unionfs wasn't any better in terms of patch descriptions. Also our
patch set was smaller since we removed some functionality we knew would
be resisted by upstream and because our file layout is different from
yours. However like the sysfs patches being broken up there are a couple
of other things that represent one logical set that can be grouped
together.

The point of posting these sets to LKML is so people will review them.
If I have to read through a large document and then through each patch
individually just to figure out what the patch is trying to accomplish
before I can see how it is going about accomplishing it, then that is
extra resistance to actually looking through the set.

--

To: Dave Quigley <dpquigl@...>
Cc: <linux-fsdevel@...>, <linux-kernel@...>
Date: Friday, May 16, 2008 - 10:06 pm

It simply dumps some aufs status to console. Because I think it is a
nature of magic sysrq, and it is not a feature to solve a specific
problem, I didn't write much, just simply
----------------------------------------------------------------------
.B sysrq=key
Specifies MagicSysRq key for debugging aufs.
You need to enable both of CONFIG_MAGIC_SYSRQ and CONFIG_AUFS_DEBUG.
If your linux version is linux\-2.6.24 and earlier, you need to enable
CONFIG_AUFS_SYSAUFS too.
Currently this is for developers only.
The default is `a'.
----------------------------------------------------------------------

One of them is for lifetime management as the description
said. Generally an object correspoing to an entry might be under sysfs
is managed by kref. This management is independent from CONFIG_SYSFS,
and the former patch is compiled unconditionally.
The other is for the actual entires under sysfs, and compiled when SYSFS
is enabled only.
I don't think it is a good idea to make them in a single patch.

But I will re-send the entire aufs patch series in next week, after...
- make some simple header + source pairs in a single patch and try more
description text, as you pointed out.
- remove some lines unnecessary for -mm tree, pointed out by Jan
Engelhardt and Sam Ravnborg.

I tried to do so...
I thought first document is important too, but the smaller patches in
the later is more preferable than larger ones. Addionally most of them
are totally new files. So I chose "one patch by one new file" way.

Anyway, I will re-send them in next week after trying some grouping.

Thank you
Junjiro Okajima
--

To: Dave Quigley <dpquigl@...>
Cc: <hooanon05@...>, <linux-fsdevel@...>, <linux-kernel@...>
Date: Friday, May 16, 2008 - 11:32 am

No 0/67 unfortunately, and --no-chain was also missing when calling
git-send-email. (Argh, git-send-email should default to no-chain!)
--

To: Jan Engelhardt <jengelh@...>
Cc: Dave Quigley <dpquigl@...>, <linux-fsdevel@...>, <linux-kernel@...>
Date: Sunday, May 18, 2008 - 10:25 pm

I have upgraded GIT on my system, and got a new option '--cover-letter.'
Next time I will send 0/n and specify --no-chain-reply-to too.

Junjiro Okajima
--

To: Jan Engelhardt <jengelh@...>
Cc: Dave Quigley <dpquigl@...>, <hooanon05@...>, <linux-fsdevel@...>, <linux-kernel@...>
Date: Friday, May 16, 2008 - 5:07 pm

If you use Guilt, it does all the brain-damage removal for you ;)
(guilt-patchbomb to be exact)

Josef 'Jeff' Sipek.

--
I'm somewhere between geek and normal.
- Linus Torvalds
--

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs manual

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
Documentation/filesystems/aufs/aufs.5 | 1608 +++++++++++++++++++++++++++++++++
1 files changed, 1608 insertions(+), 0 deletions(-)

diff --git a/Documentation/filesystems/aufs/aufs.5 b/Documentation/filesystems/aufs/aufs.5
new file mode 100644
index 0000000..7335e14
--- /dev/null
+++ b/Documentation/filesystems/aufs/aufs.5
@@ -0,0 +1,1608 @@
+.ds AUFS_VERSION 20080516-mm
+.ds AUFS_XINO_FNAME .aufs.xino
+.ds AUFS_XINO_DEFPATH /tmp/.aufs.xino
+.ds AUFS_DIRWH_DEF 3
+.ds AUFS_WH_PFX .wh.
+.ds AUFS_WH_PFX_LEN 4
+.ds AUFS_WKQ_NAME aufsd
+.ds AUFS_NWKQ_DEF 4
+.ds AUFS_WH_DIROPQ .wh..wh..opq
+.ds AUFS_WH_BASENAME .wh.aufs
+.ds AUFS_WH_PLINKDIR .wh.plink
+.ds AUFS_BRANCH_MAX 127
+.ds AUFS_MFS_SECOND_DEF 30
+.\".so aufs.tmac
+.
+.eo
+.de TQ
+.br
+.ns
+.TP \$1
+..
+.de Bu
+.IP \(bu 4
+..
+.ec
+.\" end of macro definitions
+.
+.\" ----------------------------------------------------------------------
+.TH aufs 5 \*[AUFS_VERSION] Linux "Linux Aufs User\[aq]s Manual"
+.SH NAME
+aufs \- another unionfs. version \*[AUFS_VERSION]
+
+.\" ----------------------------------------------------------------------
+.SH DESCRIPTION
+Aufs is a stackable unification filesystem such as Unionfs, which unifies
+several directories and provides a merged single directory.
+In the early days, aufs was entirely re-designed and re-implemented
+Unionfs Version 1.x series. After
+many original ideas, approaches and improvements, it
+becomes totally different from Unionfs while keeping the basic features.
+See Unionfs Version 1.x series for the basic features.
+Recently, Unionfs Version 2.x series begin taking some of same
+approaches to aufs\[aq]s.
+
+.\" ----------------------------------------------------------------------
+.SH MOUNT OPTIONS
+At mount-time, the order of interpreting options is,
+.RS
+.Bu
+simple flags, except xino/noxino...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs global header file

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
include/linux/aufs_type.h | 111 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 111 insertions(+), 0 deletions(-)

diff --git a/include/linux/aufs_type.h b/include/linux/aufs_type.h
new file mode 100644
index 0000000..1f56ec9
--- /dev/null
+++ b/include/linux/aufs_type.h
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2005, 2006, 2007, 2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/* $Id: aufs_type.h,v 1.106 2008/05/12 00:29:11 sfjro Exp $ */
+
+#include <linux/ioctl.h>
+
+#ifndef __AUFS_TYPE_H__
+#define __AUFS_TYPE_H__
+
+#define AUFS_VERSION "20080516-mm"
+
+/* move this to linux-2.6.19/include/magic.h */
+#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's')
+
+/* ---------------------------------------------------------------------- */
+
+#ifdef CONFIG_AUFS_BRANCH_MAX_127
+/* some environments treat 'char' as 'unsigned char' by default */
+typedef signed char aufs_bindex_t;
+#define AUFS_BRANCH_MAX 127
+#else
+typedef short aufs_bindex_t;
+#ifdef CONFIG_AUFS_BRANCH_MAX_511
+#define AUFS_BRANCH_MAX 511
+#elif defined(CONFIG_AUFS_BRANCH_MAX_1023)
...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs configuration

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/Kconfig | 198 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 198 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/Kconfig b/fs/aufs/Kconfig
new file mode 100644
index 0000000..aa99e50
--- /dev/null
+++ b/fs/aufs/Kconfig
@@ -0,0 +1,198 @@
+config AUFS
+ bool "Another unionfs (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ help
+ Aufs is a stackable unification filesystem such as Unionfs,
+ which unifies several directories and provides a merged single
+ directory.
+ In the early days, aufs was entirely re-designed and
+ re-implemented Unionfs Version 1.x series. After many original
+ ideas, approaches and improvements, it becomes totally
+ different from Unionfs while keeping the basic features.
+ See Unionfs for the basic features.
+
+if AUFS
+config AUFS_FAKE_DM
+ bool
+ depends on AUFS
+ default n
+
+choice
+ prompt "Maximum number of branches"
+ depends on AUFS
+ default AUFS_BRANCH_MAX_127
+ help
+ Specifies the maximum number of branches (or member directories)
+ in a single aufs. The larger value consumes more system
+ resources and has an impact to performance.
+config AUFS_BRANCH_MAX_127
+ bool "127"
+ help
+ Specifies the maximum number of branches (or member directories)
+ in a single aufs. The larger value consumes more system
+ resources and has an impact to performance.
+config AUFS_BRANCH_MAX_511
+ bool "511"
+ help
+ Specifies the maximum number of branches (or member directories)
+ in a single aufs. The larger value consumes more system
+ resources and has an impact to performance.
+config AUFS_BRANCH_MAX_1023
+ bool "1023"
+ help
+ Specifies the maximum number of branches (or member directories)
+ in a single aufs. The larger value consumes more system
+ resources and has an impact to performance.
+# config AUFS_BRANCH_MAX_32767
+# bool "32767"
+...

To: Junjiro Okajima <hooanon05@...>
Cc: <linux-fsdevel@...>, <linux-kernel@...>
Date: Friday, May 16, 2008 - 11:28 am

I do not think you need "default n" either as that should be the

One AUFS_FAKE_DM is redundant here. It should probably be just

Performance is not "damaged" but "hurt" :-) [or just "will negatively

Since I see this for the first time, a bit of help text would not be

If it is obsolete, it should not be merged.
--

To: Jan Engelhardt <jengelh@...>
Cc: <linux-fsdevel@...>, <linux-kernel@...>
Date: Sunday, May 18, 2008 - 10:23 pm

Hi,
Thank you for your review and comments.

I will fix as you pointed out.

The *current* unionfs doesn't support such nested mount, ie. unionfs as
a branch of another unionfs mount.

English language is much more difficult than C language for me...

Junjiro Okajima
--

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs Makefile

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/Makefile | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 57 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/Makefile b/fs/aufs/Makefile
new file mode 100644
index 0000000..05e0864
--- /dev/null
+++ b/fs/aufs/Makefile
@@ -0,0 +1,57 @@
+# AUFS Makefile for the Linux 2.6.25 and later
+# $Id: Makefile,v 1.3 2008/04/28 03:03:10 sfjro Exp $
+
+# the environment variables are not inherited since 2.6.23
+ifdef AUFS_EXTRA_CFLAGS
+EXTRA_CFLAGS += ${AUFS_EXTRA_CFLAGS}
+endif
+
+########################################
+
+ifdef CONFIG_AUFS_WORKAROUND_FUSE
+# defined in ${srctree}/fs/fuse/inode.c
+EXTRA_CFLAGS += -DFUSE_SUPER_MAGIC=0x65735546
+endif
+
+ifdef CONFIG_XFS_FS
+# defined in ${srctree}/fs/xfs/xfs_sb.h
+EXTRA_CFLAGS += -DXFS_SB_MAGIC=0x58465342
+endif
+
+ifdef CONFIG_TMPFS
+# defined in ${srctree}/mm/shmem.c
+EXTRA_CFLAGS += -DTMPFS_MAGIC=0x01021994
+endif
+
+-include $(dir $(lastword ${MAKEFILE_LIST}))priv.mk
+#$(warning ${EXTRA_CFLAGS})
+
+########################################
+
+obj-$(CONFIG_AUFS) += aufs.o
+aufs-y := module.o super.o sbinfo.o branch.o xino.o sysaufs.o opts.o \
+ wkq.o vfsub.o dcsub.o \
+ cpup.o whout.o plink.o wbr_policy.o \
+ dentry.o dinfo.o \
+ file.o f_op.o finfo.o \
+ dir.o vdir.o \
+ inode.o i_op.o i_op_add.o i_op_del.o i_op_ren.o iinfo.o \
+ misc.o
+
+#xattr.o
+aufs-$(CONFIG_SYSFS) += sysfs.o
+aufs-$(CONFIG_AUFS_BR_NFS) += br_nfs.o
+aufs-$(CONFIG_AUFS_BR_XFS) += br_xfs.o
+aufs-$(CONFIG_AUFS_WORKAROUND_FUSE) += br_fuse.o
+
+aufs-$(CONFIG_AUFS_DLGT) += dlgt.o
+aufs-$(CONFIG_AUFS_HINOTIFY) += hinotify.o hin_or_dlgt.o
+# dirty
+ifndef CONFIG_AUFS_HINOTIFY
+aufs-$(CONFIG_AUFS_DLGT) += hin_or_dlgt.o
+endif
+
+aufs-$(CONFIG_AUFS_EXPORT) += export.o
+aufs-$(CONFIG_AUFS_ROBR) += robr.o
+aufs-$(CONFIG_AUFS_DEBUG) += debug.o
+aufs-$(C...

To: <hooanon05@...>
Cc: <linux-fsdevel@...>, <linux-kernel@...>
Date: Friday, May 16, 2008 - 1:25 pm

Hi Junjiro.

A few comments to your Makefile.

Use:

Sam
--

To: Sam Ravnborg <sam@...>
Cc: <linux-fsdevel@...>, <linux-kernel@...>
Date: Sunday, May 18, 2008 - 10:27 pm

Hi Sam,
Thank you for your review and comments.

I will fix as you pointed out.

I will add a new automatic configuration CONFIG_AUFS_HIN_OR_DLGT.

Junjiro Okajima
--

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs main header file

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/aufs.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 56 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/aufs.h b/fs/aufs/aufs.h
new file mode 100644
index 0000000..915bde0
--- /dev/null
+++ b/fs/aufs/aufs.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * main header files
+ *
+ * $Id: aufs.h,v 1.2 2008/04/21 01:31:49 sfjro Exp $
+ */
+
+#ifndef __AUFS_H__
+#define __AUFS_H__
+
+#ifdef __KERNEL__
+
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)
+#error you got wrong version
+#endif
+
+#include "debug.h"
+
+#include "branch.h"
+#include "cpup.h"
+#include "dcsub.h"
+#include "dentry.h"
+#include "dir.h"
+#include "file.h"
+#include "hinode.h"
+#include "inode.h"
+#include "misc.h"
+#include "module.h"
+#include "opts.h"
+#include "super.h"
+#include "sysaufs.h"
+#include "vfsub.h"
+#include "whout.h"
+#include "wkq.h"
+//#include "xattr.h"
+
+#endif /* __KERNEL__ */
+#endif /* __AUFS_H__ */
--
1.4.4.4

--

To: Junjiro Okajima <hooanon05@...>
Cc: <linux-fsdevel@...>, <linux-kernel@...>
Date: Friday, May 16, 2008 - 11:33 am

Kill this.

--

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs module initialization and module-global

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/module.h | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 78 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/module.h b/fs/aufs/module.h
new file mode 100644
index 0000000..cccee38
--- /dev/null
+++ b/fs/aufs/module.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2007-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * module initialization and module-global
+ *
+ * $Id: module.h,v 1.2 2008/04/21 01:33:00 sfjro Exp $
+ */
+
+#ifndef __AUFS_MODULE_H__
+#define __AUFS_MODULE_H__
+
+#ifdef __KERNEL__
+
+//#include <linux/slab.h>
+
+/* ---------------------------------------------------------------------- */
+
+/* module parameters */
+extern short aufs_nwkq;
+extern int sysaufs_brs;
+
+/* ---------------------------------------------------------------------- */
+
+extern char au_esc_chars[];
+extern int au_dir_roflags;
+
+/* kmem cache */
+enum {
+ AuCache_DINFO,
+ AuCache_ICNTNR,
+ AuCache_FINFO,
+ AuCache_VDIR,
+ AuCache_DEHSTR,
+#ifdef CONFIG_AUFS_HINOTIFY
+ AuCache_HINOTIFY,
+#endif
+ AuCache_Last
+};
+
+extern stru...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs module global variables and operations

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/module.c | 243 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 243 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/module.c b/fs/aufs/module.c
new file mode 100644
index 0000000..c5577c7
--- /dev/null
+++ b/fs/aufs/module.c
@@ -0,0 +1,243 @@
+/*
+ * Copyright (C) 2007 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * module global variables and operations
+ *
+ * $Id: module.c,v 1.3 2008/04/28 03:02:06 sfjro Exp $
+ */
+
+#include <linux/module.h>
+#include "aufs.h"
+
+/* ---------------------------------------------------------------------- */
+
+/*
+ * aufs caches
+ */
+struct kmem_cache *au_cachep[AuCache_Last];
+static int __init create_cache(void)
+{
+ au_cachep[AuCache_DINFO] = AuCache(au_dinfo);
+ if (au_cachep[AuCache_DINFO])
+ au_cachep[AuCache_ICNTNR] = AuCache(aufs_icntnr);
+ if (au_cachep[AuCache_ICNTNR])
+ au_cachep[AuCache_FINFO] = AuCache(au_finfo);
+ //au_cachep[AuCache_FINFO] = NULL;
+ if (au_cachep[AuCache_FINFO])
+ au_cachep[AuCache_VDIR] = AuCache(au_vdir);
+ if (au_cachep[AuCache_VDIR])
+ au_cachep[AuCach...

To: Junjiro Okajima <hooanon05@...>
Cc: <linux-fsdevel@...>, <linux-kernel@...>
Date: Friday, May 16, 2008 - 11:36 am

...

--

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs super_block operations

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/super.h | 410 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 410 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/super.h b/fs/aufs/super.h
new file mode 100644
index 0000000..f6e6d8b
--- /dev/null
+++ b/fs/aufs/super.h
@@ -0,0 +1,410 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * super_block operations
+ *
+ * $Id: super.h,v 1.4 2008/05/04 23:52:41 sfjro Exp $
+ */
+
+#ifndef __AUFS_SUPER_H__
+#define __AUFS_SUPER_H__
+
+#ifdef __KERNEL__
+
+#include <linux/fs.h>
+#include <linux/cramfs_fs.h>
+#include <linux/kobject.h>
+#include <linux/magic.h>
+#include <linux/aufs_type.h>
+//#include "hinode.h"
+#include "misc.h"
+//#include "opts.h"
+#include "wkq.h"
+
+typedef ssize_t (*au_readf_t)(struct file *, char __user *, size_t, loff_t *);
+typedef ssize_t (*au_writef_t)(struct file *, const char __user *, size_t,
+ loff_t *);
+
+struct au_wbr_copyup_operations {
+ int (*copyup)(struct dentry *dentry);
+};
+
+struct au_wbr_create_operations {
+ int (*create)(struct dentry *d...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs mount and super_block operations

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/super.c | 891 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 891 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/super.c b/fs/aufs/super.c
new file mode 100644
index 0000000..491f75f
--- /dev/null
+++ b/fs/aufs/super.c
@@ -0,0 +1,891 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * mount and super_block operations
+ *
+ * $Id: super.c,v 1.5 2008/05/12 00:28:35 sfjro Exp $
+ */
+
+#include <linux/module.h>
+#include <linux/buffer_head.h>
+#include <linux/seq_file.h>
+#include <linux/smp_lock.h>
+#include <linux/statfs.h>
+
+#include "aufs.h"
+
+/*
+ * super_operations
+ */
+static struct inode *aufs_alloc_inode(struct super_block *sb)
+{
+ struct aufs_icntnr *c;
+
+ AuTraceEnter();
+
+ c = au_cache_alloc_icntnr();
+ //if (LktrCond) {au_cache_free_icntnr(c); c = NULL;}
+ if (c) {
+ inode_init_once(&c->vfs_inode);
+ c->vfs_inode.i_version = 1; //sigen(sb);
+ c->iinfo.ii_hinode = NULL;
+ return &c->vfs_inode;
+ }
+ return NULL;
+}
+
+static void a...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs superblock private data

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/sbinfo.c | 268 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 268 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/sbinfo.c b/fs/aufs/sbinfo.c
new file mode 100644
index 0000000..a412811
--- /dev/null
+++ b/fs/aufs/sbinfo.c
@@ -0,0 +1,268 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * superblock private data
+ *
+ * $Id: sbinfo.c,v 1.4 2008/05/12 00:28:22 sfjro Exp $
+ */
+
+#include <linux/mnt_namespace.h>
+#include <linux/smp_lock.h>
+#include "aufs.h"
+
+/*
+ * they are necessary regardless sysfs is disabled.
+ */
+void au_si_free(struct kobject *kobj)
+{
+ struct au_sbinfo *sbinfo;
+ struct super_block *sb;
+
+ LKTRTrace("kobj %p\n", kobj);
+ sbinfo = container_of(kobj, struct au_sbinfo, si_kobj);
+ LKTRTrace("sbinfo %p\n", sbinfo);
+ AuDebugOn(!list_empty(&sbinfo->si_plink));
+
+ sb = sbinfo->si_sb;
+ if (unlikely(!au_ftest_si(sbinfo, FAILED_INIT))) {
+ au_sbilist_lock();
+ au_sbilist_del(sbinfo);
+ au_sbilist_unlock();
+ }
+
+ si_write_lock(sb);
+ au_xino_clr(sb);
+ au_br_free...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs branch filesystems and xino for them

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/branch.h | 345 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 345 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/branch.h b/fs/aufs/branch.h
new file mode 100644
index 0000000..a9146eb
--- /dev/null
+++ b/fs/aufs/branch.h
@@ -0,0 +1,345 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * branch filesystems and xino for them
+ *
+ * $Id: branch.h,v 1.3 2008/04/28 03:03:32 sfjro Exp $
+ */
+
+#ifndef __AUFS_BRANCH_H__
+#define __AUFS_BRANCH_H__
+
+#ifdef __KERNEL__
+
+#include <linux/fs.h>
+#include <linux/mount.h>
+#include <linux/sysfs.h>
+#include <linux/aufs_type.h>
+#include "misc.h"
+#include "super.h"
+
+/* ---------------------------------------------------------------------- */
+
+/* an entry in a xino file */
+struct au_xino_entry {
+ ino_t ino;
+ //__u32 h_gen;
+} __packed;
+
+//#define AuXino_INVALID_HGEN (-1)
+
+/* a xino file */
+struct au_xino_file {
+ //struct file **xi_file;
+ struct file *xi_file;
+
+ /* array management */
+ //unsigned long long xi_limi...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs branch management

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/branch.c | 933 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 933 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/branch.c b/fs/aufs/branch.c
new file mode 100644
index 0000000..ae5d4b3
--- /dev/null
+++ b/fs/aufs/branch.c
@@ -0,0 +1,933 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * branch management
+ *
+ * $Id: branch.c,v 1.4 2008/05/04 23:51:26 sfjro Exp $
+ */
+
+#include <linux/iso_fs.h>
+#include <linux/loop.h>
+#include <linux/romfs_fs.h>
+#include <linux/smp_lock.h>
+#include "aufs.h"
+
+static void free_branch(struct au_branch *br)
+{
+ AuTraceEnter();
+
+ if (br->br_xino)
+ fput(br->br_xino);
+ dput(br->br_wh);
+ dput(br->br_plink);
+ if (!au_test_nfs(br->br_mnt->mnt_sb))
+ mntput(br->br_mnt);
+ else {
+ lockdep_off();
+ mntput(br->br_mnt);
+ lockdep_on();
+ }
+ AuDebugOn(au_br_count(br) || atomic_read(&br->br_wh_running));
+ //AuDbg("free\n");
+ kfree(br);
+}
+
+/*
+ * frees all branches
+ */
+void au_br_free(struct au_sbinfo *sbinfo)
+{...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs external inode number translation table and bitmap

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/xino.c | 1249 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 1249 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/xino.c b/fs/aufs/xino.c
new file mode 100644
index 0000000..58fbafd
--- /dev/null
+++ b/fs/aufs/xino.c
@@ -0,0 +1,1249 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * external inode number translation table and bitmap
+ *
+ * $Id: xino.c,v 1.5 2008/05/12 00:29:11 sfjro Exp $
+ */
+
+//#include <linux/fsnotify.h>
+//#include <linux/smp_lock.h>
+#include <linux/uaccess.h>
+#include "aufs.h"
+
+/* ---------------------------------------------------------------------- */
+
+static ssize_t xino_fread(au_readf_t func, struct file *file, void *buf,
+ size_t size, loff_t *pos)
+{
+ ssize_t err;
+ mm_segment_t oldfs;
+
+ LKTRTrace("%.*s, sz %lu, *pos %Ld\n",
+ AuDLNPair(file->f_dentry), (unsigned long)size, *pos);
+
+ oldfs = get_fs();
+ set_fs(KERNEL_DS);
+ do {
+ // signal_pending
+ err = func(file, (char __user *)buf, size, pos);
+ } while (err == -...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs special handling for inode attributes on FUSE branch

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/br_fuse.c | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 109 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/br_fuse.c b/fs/aufs/br_fuse.c
new file mode 100644
index 0000000..295139b
--- /dev/null
+++ b/fs/aufs/br_fuse.c
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * special handling for inode attributes on FUSE branch
+ *
+ * $Id: br_fuse.c,v 1.2 2008/04/21 01:32:05 sfjro Exp $
+ */
+
+#include "aufs.h"
+
+/* h_mnt can be NULL, is it safe? */
+int au_update_fuse_h_inode(struct vfsmount *h_mnt, struct dentry *h_dentry)
+{
+ int err;
+ struct kstat st;
+
+ LKTRTrace("%.*s\n", AuDLNPair(h_dentry));
+
+ err = 0;
+ if (unlikely(h_dentry->d_inode
+ //&& atomic_read(&h_dentry->d_inode->i_count)
+ && au_test_fuse(h_dentry->d_sb))) {
+ err = vfsub_getattr(h_mnt, h_dentry, &st, /*dlgt*/0);
+ if (unlikely(err)) {
+ AuDbg("err %d\n", err);
+ au_debug_on();
+ AuDbgDentry(h_dentry);
+ au_debug_off();
+ WARN_ON(err);
+ }
...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs lookup functions for NFS branch in linux-2.6.19 and later

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/br_nfs.c | 391 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 391 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/br_nfs.c b/fs/aufs/br_nfs.c
new file mode 100644
index 0000000..ab5c8c2
--- /dev/null
+++ b/fs/aufs/br_nfs.c
@@ -0,0 +1,391 @@
+/*
+ * Copyright (C) 2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * lookup functions for NFS branch in linux-2.6.19 and later
+ *
+ * $Id: br_nfs.c,v 1.3 2008/05/04 23:51:14 sfjro Exp $
+ */
+
+#include "aufs.h"
+
+static struct file *au_find_h_intent(struct au_hdentry *hd, struct file *file)
+{
+ struct file *h_file, *hf;
+ struct au_hdintent *hdi, *tmp, *do_free;
+
+ LKTRTrace("%.*s\n", AuDLNPair(hd->hd_dentry));
+
+ h_file = NULL;
+ do_free = NULL;
+ spin_lock(&hd->hd_lock);
+ list_for_each_entry_safe(hdi, tmp, hd->hd_intent_list, hdi_list) {
+ hf = hdi->hdi_file[AuIntent_BRANCH];
+ if (hdi->hdi_file[AuIntent_AUFS] == file
+ && hf->f_dentry == hd->hd_dentry) {
+ h_file = hf;
+ do_free = hdi;
+ list_del(&hdi->hdi_list)...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs special handling inode attributes on XFS branch in linux-2.6.24 and later

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/br_xfs.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 69 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/br_xfs.c b/fs/aufs/br_xfs.c
new file mode 100644
index 0000000..360ffaa
--- /dev/null
+++ b/fs/aufs/br_xfs.c
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * special handling inode attributes on XFS branch in linux-2.6.24 and later
+ *
+ * $Id: br_xfs.c,v 1.2 2008/04/21 01:33:00 sfjro Exp $
+ */
+
+#include "aufs.h"
+
+/* h_mnt can be NULL, is it safe? */
+dev_t au_h_rdev(struct inode *h_inode, struct vfsmount *h_mnt,
+ struct dentry *h_dentry)
+{
+ dev_t rdev;
+ int err;
+ struct kstat st;
+
+ LKTRTrace("hi%lu\n", h_inode->i_ino);
+ if (h_dentry)
+ LKTRTrace("%.*s\n", AuDLNPair(h_dentry));
+
+ rdev = h_inode->i_rdev;
+ if (!rdev || !au_test_xfs(h_inode->i_sb))
+ goto out;
+
+ rdev = 0;
+ if (!h_dentry) {
+ err = 0;
+ h_dentry = d_find_alias(h_inode);
+ if (unlikely(!h_dentry))
+ goto failure;
+ err = PTR_ERR(h_dentry);
+ ...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs sysfs interface and lifetime management, header

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/sysaufs.h | 150 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 150 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/sysaufs.h b/fs/aufs/sysaufs.h
new file mode 100644
index 0000000..eff08c0
--- /dev/null
+++ b/fs/aufs/sysaufs.h
@@ -0,0 +1,150 @@
+/*
+ * Copyright (C) 2007-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * sysfs interface and lifetime management
+ *
+ * $Id: sysaufs.h,v 1.5 2008/05/04 23:51:26 sfjro Exp $
+ */
+
+#ifndef __SYSAUFS_H__
+#define __SYSAUFS_H__
+
+#ifdef __KERNEL__
+
+#include <linux/fs.h>
+#include <linux/sysfs.h>
+#include "module.h"
+#include "super.h"
+
+/* entries under sysfs per super block */
+enum {
+ SysaufsSb_XINO,
+ SysaufsSb_MNTPNT1,
+#if 0
+ SysaufsSb_PLINK,
+ SysaufsSb_files,
+#endif
+ SysaufsSb_Last
+};
+
+#define SysaufsSb_PREFIX "si_" /* followed by %p */
+
+struct au_sbi_attr {
+ struct attribute attr;
+ int (*show)(struct seq_file *seq, struct super_block *sb);
+};
+
+/* ---------------------------------------------------------------------- */
+
+/* sysau...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs sysfs interface and lifetime management, source

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/sysaufs.c | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 104 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/sysaufs.c b/fs/aufs/sysaufs.c
new file mode 100644
index 0000000..7df12fd
--- /dev/null
+++ b/fs/aufs/sysaufs.c
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2007-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * sysfs interface and lifetime management
+ * they are necessary regardless sysfs is disabled.
+ *
+ * $Id: sysaufs.c,v 1.4 2008/04/28 03:05:39 sfjro Exp $
+ */
+
+#include <linux/fs.h>
+#include <linux/module.h>
+#include <linux/sysfs.h>
+#include "aufs.h"
+
+/* ---------------------------------------------------------------------- */
+
+/* super_blocks list is not exported */
+DEFINE_MUTEX(au_sbilist_mtx);
+LIST_HEAD(au_sbilist);
+
+/* ---------------------------------------------------------------------- */
+
+static struct kset au_kset;
+
+#define AuSbiAttr(_name) { \
+ .attr = { .name = __stringify(_name), .mode = 0444 }, \
+ .show = sysaufs_sbi_##_name, \
+}
+
+static struct a...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs mount options/flags, header

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/opts.h | 245 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 245 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/opts.h b/fs/aufs/opts.h
new file mode 100644
index 0000000..3b3ae84
--- /dev/null
+++ b/fs/aufs/opts.h
@@ -0,0 +1,245 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * mount options/flags
+ *
+ * $Id: opts.h,v 1.2 2008/04/21 01:46:26 sfjro Exp $
+ */
+
+#ifndef __AUFS_OPTS_H__
+#define __AUFS_OPTS_H__
+
+#ifdef __KERNEL__
+
+#include <linux/fs.h>
+#include <linux/namei.h>
+#include <linux/aufs_type.h>
+#include "wkq.h"
+
+/* ---------------------------------------------------------------------- */
+/* mount flags */
+
+/* external inode number bitmap and translation table */
+#define AuOpt_XINO 1
+#define AuOpt_TRUNC_XINO (1 << 1)
+#define AuOpt_LINO (1 << 2)
+#define AuOpt_UDBA_NONE (1 << 3) /* users direct branch access */
+#define AuOpt_UDBA_REVAL (1 << 4)
+#define AuOpt_UDBA_INOTIFY (1 << 5)
+#define AuOpt_SHWH (1 << 6)
+#define AuOpt_PL...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs mount options/flags, source

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/opts.c | 1493 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 1493 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/opts.c b/fs/aufs/opts.c
new file mode 100644
index 0000000..0c4b64d
--- /dev/null
+++ b/fs/aufs/opts.c
@@ -0,0 +1,1493 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * mount options/flags
+ *
+ * $Id: opts.c,v 1.4 2008/05/04 23:51:41 sfjro Exp $
+ */
+
+#include <linux/types.h> /* a distribution requires */
+#include <linux/parser.h>
+#include "aufs.h"
+
+/* ---------------------------------------------------------------------- */
+
+enum {
+ Opt_br,
+ Opt_add, Opt_del, Opt_mod, Opt_reorder, Opt_append, Opt_prepend,
+ Opt_idel, Opt_imod, Opt_ireorder,
+ Opt_dirwh, Opt_rdcache, Opt_deblk, Opt_nhash, Opt_rendir,
+ Opt_xino, Opt_zxino, Opt_noxino,
+ Opt_trunc_xino, Opt_trunc_xino_v, Opt_notrunc_xino,
+ Opt_trunc_xino_path, Opt_itrunc_xino,
+ Opt_xinodir, Opt_xinonames, Opt_ixinonames,
+ Opt_trunc_xib, Opt_notrunc_xib,
+ Opt_dirperm1, Opt_nodirperm1,
+ Opt_shwh, Opt_noshwh,
+ Opt_plink, Opt_...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs workqueue for asynchronous/super-io/delegated operations, header

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/wkq.h | 160 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 160 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/wkq.h b/fs/aufs/wkq.h
new file mode 100644
index 0000000..b9e2edd
--- /dev/null
+++ b/fs/aufs/wkq.h
@@ -0,0 +1,160 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * workqueue for asynchronous/super-io/delegated operations
+ *
+ * $Id: wkq.h,v 1.3 2008/04/28 03:18:21 sfjro Exp $
+ */
+
+#ifndef __AUFS_WKQ_H__
+#define __AUFS_WKQ_H__
+
+#ifdef __KERNEL__
+
+#include <linux/fs.h>
+#include <linux/sched.h>
+#include <linux/workqueue.h>
+#include <linux/aufs_type.h>
+
+/* ---------------------------------------------------------------------- */
+
+/* internal workqueue named AUFS_WKQ_NAME */
+struct au_wkq {
+ struct workqueue_struct *q;
+
+ /* accounting */
+ atomic_t busy;
+ unsigned int max_busy; // todo: STAT only
+};
+
+/*
+ * in the next operation, wait for the 'nowait' tasks in system-wide workqueue
+ */
+struct au_nowait_tasks {
...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs workqueue for asynchronous/super-io/delegated operations, source

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/wkq.c | 321 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 321 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/wkq.c b/fs/aufs/wkq.c
new file mode 100644
index 0000000..965d1e4
--- /dev/null
+++ b/fs/aufs/wkq.c
@@ -0,0 +1,321 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * workqueue for asynchronous/super-io/delegated operations
+ *
+ * $Id: wkq.c,v 1.4 2008/05/04 23:53:38 sfjro Exp $
+ */
+
+#include <linux/module.h>
+#include "aufs.h"
+
+struct au_wkq *au_wkq;
+
+struct au_cred {
+#ifdef CONFIG_AUFS_DLGT
+ int umask;
+ uid_t fsuid;
+ gid_t fsgid;
+ kernel_cap_t cap_effective, cap_inheritable, cap_permitted;
+ //unsigned keep_capabilities:1;
+ //struct user_struct *user;
+ //struct fs_struct *fs;
+ //struct nsproxy *nsproxy;
+#endif
+};
+
+struct au_wkinfo {
+ struct work_struct wk;
+ struct vfsmount *mnt;
+
+ unsigned int flags;
+ struct au_cred cred;
+
+ au_wkq_func_t func;
+ void *args;
+
+ atomic_t *busyp;
+ struct completion *comp;
+};
+
+/* ----...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs sub-VFS, header

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/vfsub.h | 493 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 493 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/vfsub.h b/fs/aufs/vfsub.h
new file mode 100644
index 0000000..a7852bb
--- /dev/null
+++ b/fs/aufs/vfsub.h
@@ -0,0 +1,493 @@
+/*
+ * Copyright (C) 2007-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * sub-routines for VFS
+ *
+ * $Id: vfsub.h,v 1.2 2008/04/21 01:49:22 sfjro Exp $
+ */
+
+#ifndef __AUFS_VFSUB_H__
+#define __AUFS_VFSUB_H__
+
+#ifdef __KERNEL__
+
+#include <linux/fs.h>
+#include <linux/namei.h>
+#include <linux/splice.h>
+#include <linux/inotify.h>
+
+/* ---------------------------------------------------------------------- */
+
+/* vfsub flags */
+#define Vfsub_DLGT 1 /* operation with delegation */
+#define Vfsub_FORCE_UNLINK (1 << 1) /* force unlinking */
+#define vfsub_ftest(flags, name) ((flags) & Vfsub_##name)
+#define vfsub_fset(flags, name) { (flags) |= Vfsub_##name; }
+#define vfsub_fclr(flags, name) { (flags) &= ~Vfsub_##name; }
+#ifndef CONFIG_AUFS_DLGT
+#undef Vfsub_DLGT
+#...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs sub-VFS, source

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/vfsub.c | 653 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 653 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/vfsub.c b/fs/aufs/vfsub.c
new file mode 100644
index 0000000..88d1ca0
--- /dev/null
+++ b/fs/aufs/vfsub.c
@@ -0,0 +1,653 @@
+/*
+ * Copyright (C) 2007-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * sub-routines for VFS
+ *
+ * $Id: vfsub.c,v 1.3 2008/05/12 00:29:11 sfjro Exp $
+ */
+// I'm going to slightly mad
+
+#include <linux/uaccess.h>
+#include "aufs.h"
+
+/* ---------------------------------------------------------------------- */
+
+void vfsub_args_init(struct vfsub_args *vargs, struct au_hin_ignore *ign,
+ int dlgt, int force_unlink)
+{
+ do_vfsub_args_reinit(vargs, ign);
+ vargs->flags = 0;
+ if (unlikely(dlgt))
+ vfsub_fset(vargs->flags, DLGT);
+ if (force_unlink)
+ vfsub_fset(vargs->flags, FORCE_UNLINK);
+}
+
+/* ---------------------------------------------------------------------- */
+
+struct file *vfsub_filp_open(const char *path, int oflags, int mode)
+{
+ struct file *err;
+
+ LKTRTrace("%s\n",...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs sub-dcache, header

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/dcsub.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 54 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/dcsub.h b/fs/aufs/dcsub.h
new file mode 100644
index 0000000..e012b94
--- /dev/null
+++ b/fs/aufs/dcsub.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2007-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * sub-routines for dentry cache
+ *
+ * $Id: dcsub.h,v 1.1 2008/04/18 12:18:29 sfjro Exp $
+ */
+
+#ifndef __AUFS_DCSUB_H__
+#define __AUFS_DCSUB_H__
+
+#ifdef __KERNEL__
+
+#include <linux/dcache.h>
+
+struct au_dpage {
+ int ndentry;
+ struct dentry **dentries;
+};
+
+struct au_dcsub_pages {
+ int ndpage;
+ struct au_dpage *dpages;
+};
+
+/* ---------------------------------------------------------------------- */
+
+int au_dpages_init(struct au_dcsub_pages *dpages, gfp_t gfp);
+void au_dpages_free(struct au_dcsub_pages *dpages);
+typedef int (*au_dpages_test)(struct dentry *dentry, void *arg);
+int au_dcsub_pages(struct au_dcsub_pages *dpages, struct dentry *root,
+ au_dpages_test test, void *arg);
+int au_dcsub_pages_rev(struct...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs sub-dcache, source

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/dcsub.c | 246 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 246 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/dcsub.c b/fs/aufs/dcsub.c
new file mode 100644
index 0000000..69ec3f6
--- /dev/null
+++ b/fs/aufs/dcsub.c
@@ -0,0 +1,246 @@
+/*
+ * Copyright (C) 2007-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * sub-routines for dentry cache
+ *
+ * $Id: dcsub.c,v 1.2 2008/04/21 01:31:49 sfjro Exp $
+ */
+
+#include "aufs.h"
+
+static void au_dpage_free(struct au_dpage *dpage)
+{
+ int i;
+
+ AuTraceEnter();
+ AuDebugOn(!dpage);
+
+ for (i = 0; i < dpage->ndentry; i++)
+ dput(dpage->dentries[i]);
+ free_page((unsigned long)dpage->dentries);
+}
+
+int au_dpages_init(struct au_dcsub_pages *dpages, gfp_t gfp)
+{
+ int err;
+ void *p;
+
+ AuTraceEnter();
+
+ err = -ENOMEM;
+ dpages->dpages = kmalloc(sizeof(*dpages->dpages), gfp);
+ if (unlikely(!dpages->dpages))
+ goto out;
+ p = (void *)__get_free_page(gfp);
+ if (unlikely(!p))
+ goto out_dpages;
+ dpages->dpages[0].ndentry = 0;
+ dpages->dpages[0].dentries = p;
...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs copy-up/down functions

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/cpup.h | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 82 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/cpup.h b/fs/aufs/cpup.h
new file mode 100644
index 0000000..0e398f2
--- /dev/null
+++ b/fs/aufs/cpup.h
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * copy-up/down functions
+ *
+ * $Id: cpup.h,v 1.2 2008/04/21 01:33:43 sfjro Exp $
+ */
+
+#ifndef __AUFS_CPUP_H__
+#define __AUFS_CPUP_H__
+
+#ifdef __KERNEL__
+
+#include <linux/fs.h>
+#include <linux/aufs_type.h>
+
+void au_cpup_attr_timesizes(struct inode *inode);
+void au_cpup_attr_nlink(struct inode *inode);
+void au_cpup_attr_changeable(struct inode *inode);
+void au_cpup_igen(struct inode *inode, struct inode *h_inode);
+void au_cpup_attr_all(struct inode *inode);
+
+/* ---------------------------------------------------------------------- */
+
+/* cpup flags */
+#define AuCpup_DTIME 1 /* do dtime_store/revert */
+#define au_ftest_cpup(flags, name) ((flags) & AuCpup_##name)
+#define au_fset_cpup(flags, name) { (flags) |=...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs copy-up functions, see wbr_policy.c for copy-down

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/cpup.c | 1043 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 1043 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/cpup.c b/fs/aufs/cpup.c
new file mode 100644
index 0000000..3227d19
--- /dev/null
+++ b/fs/aufs/cpup.c
@@ -0,0 +1,1043 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * copy-up functions, see wbr_policy.c for copy-down
+ *
+ * $Id: cpup.c,v 1.5 2008/05/12 00:29:11 sfjro Exp $
+ */
+
+#include <linux/fs_stack.h>
+#include <linux/uaccess.h>
+#include "aufs.h"
+
+/* violent cpup_attr_*() functions don't care inode lock */
+void au_cpup_attr_timesizes(struct inode *inode)
+{
+ struct inode *h_inode;
+
+ LKTRTrace("i%lu\n", inode->i_ino);
+ //IMustLock(inode);
+ h_inode = au_h_iptr(inode, au_ibstart(inode));
+ AuDebugOn(!h_inode);
+ //IMustLock(!h_inode);
+
+ fsstack_copy_attr_times(inode, h_inode);
+ //todo: this spin_lock conflicts the new unionfs patch in -mm tree
+ //spin_lock(&inode->i_lock);
+ fsstack_copy_inode_size(inode, h_inode);
+ //spin_unlock(&...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs whiteout for logical deletion and opaque directory, header

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/whout.h | 140 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 140 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/whout.h b/fs/aufs/whout.h
new file mode 100644
index 0000000..f66239f
--- /dev/null
+++ b/fs/aufs/whout.h
@@ -0,0 +1,140 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * whiteout for logical deletion and opaque directory
+ *
+ * $Id: whout.h,v 1.2 2008/04/21 02:00:37 sfjro Exp $
+ */
+
+#ifndef __AUFS_WHOUT_H__
+#define __AUFS_WHOUT_H__
+
+#ifdef __KERNEL__
+
+#include <linux/fs.h>
+#include <linux/aufs_type.h>
+#include "dir.h"
+#include "opts.h"
+#include "super.h"
+
+int au_wh_name_alloc(const char *name, int len, struct qstr *wh);
+void au_wh_name_free(struct qstr *wh);
+
+struct au_ndx;
+int au_wh_test(struct dentry *h_parent, struct qstr *wh_name, int try_sio,
+ struct au_ndx *ndx);
+int au_diropq_test(struct dentry *h_dentry, struct au_ndx *ndx);
+
+struct dentry *au_whtmp_lkup(struct dentry *h_parent, struct qstr *prefix,
+ struct au_...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs whiteout for logical deletion and opaque directory, source

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/whout.c | 1058 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 1058 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/whout.c b/fs/aufs/whout.c
new file mode 100644
index 0000000..8d1dcd3
--- /dev/null
+++ b/fs/aufs/whout.c
@@ -0,0 +1,1058 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * whiteout for logical deletion and opaque directory
+ *
+ * $Id: whout.c,v 1.4 2008/05/12 00:27:58 sfjro Exp $
+ */
+
+#include <linux/fs.h>
+#include <linux/namei.h>
+//#include <linux/random.h>
+//#include <linux/security.h>
+#include "aufs.h"
+
+#define WH_MASK S_IRUGO
+
+/* If a directory contains this file, then it is opaque. We start with the
+ * .wh. flag so that it is blocked by lookup.
+ */
+static struct qstr diropq_name = {
+ .name = AUFS_WH_DIROPQ,
+ .len = sizeof(AUFS_WH_DIROPQ) - 1
+};
+
+/*
+ * generate whiteout name, which is NOT terminated by NULL.
+ * @name: original d_name.name
+ * @len: original d_name.len
+ * @wh: whiteout qstr
+ * returns zero when su...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs pseudo-link

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/plink.c | 349 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 349 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/plink.c b/fs/aufs/plink.c
new file mode 100644
index 0000000..f991fa6
--- /dev/null
+++ b/fs/aufs/plink.c
@@ -0,0 +1,349 @@
+/*
+ * Copyright (C) 2007-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * pseudo-link
+ *
+ * $Id: plink.c,v 1.2 2008/04/21 01:45:16 sfjro Exp $
+ */
+
+#include "aufs.h"
+
+struct pseudo_link {
+ struct list_head list;
+ struct inode *inode;
+};
+
+#ifdef CONFIG_AUFS_DEBUG
+void au_plink_list(struct super_block *sb)
+{
+ struct au_sbinfo *sbinfo;
+ struct list_head *plink_list;
+ struct pseudo_link *plink;
+
+ AuTraceEnter();
+ SiMustAnyLock(sb);
+ sbinfo = au_sbi(sb);
+ AuDebugOn(!au_opt_test(au_mntflags(sb), PLINK));
+
+ plink_list = &sbinfo->si_plink;
+ spin_lock(&sbinfo->si_plink_lock);
+ list_for_each_entry(plink, plink_list, list)
+ AuDbg("%lu\n", plink->inode->i_ino);
+ spin_unlock(&sbinfo->si_plink_lock);
+}
+#endif
+
+int au_plink_test(struct super_block *sb, struct inode *in...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs policies for selecting one among multiple writable branches

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/wbr_policy.c | 693 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 693 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/wbr_policy.c b/fs/aufs/wbr_policy.c
new file mode 100644
index 0000000..1e0f1b8
--- /dev/null
+++ b/fs/aufs/wbr_policy.c
@@ -0,0 +1,693 @@
+/*
+ * Copyright (C) 2007-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * policies for selecting one among multiple writable branches
+ *
+ * $Id: wbr_policy.c,v 1.3 2008/04/28 03:04:12 sfjro Exp $
+ */
+
+#include <linux/statfs.h>
+#include "aufs.h"
+
+static int au_cpdown_attr(struct dentry *h_dst, struct dentry *h_src, int dlgt)
+{
+ int err, sbits;
+ struct iattr ia;
+ struct inode *h_idst, *h_isrc;
+ struct vfsub_args vargs;
+
+ LKTRTrace("%.*s\n", AuDLNPair(h_dst));
+ h_idst = h_dst->d_inode;
+ //IMustLock(h_idst);
+ h_isrc = h_src->d_inode;
+ //IMustLock(h_isrc);
+
+ ia.ia_valid = ATTR_FORCE | ATTR_MODE | ATTR_UID | ATTR_GID;
+ ia.ia_mode = h_isrc->i_mode;
+ ia.ia_uid = h_isrc->i_uid;
+ ia.ia_gid = h_isrc->i_gid;
+ sbits = !!(ia.i...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs lookup and dentry operations, header

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/dentry.h | 384 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 384 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/dentry.h b/fs/aufs/dentry.h
new file mode 100644
index 0000000..3ed8ebf
--- /dev/null
+++ b/fs/aufs/dentry.h
@@ -0,0 +1,384 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * lookup and dentry operations
+ *
+ * $Id: dentry.h,v 1.4 2008/05/04 23:54:53 sfjro Exp $
+ */
+
+#ifndef __AUFS_DENTRY_H__
+#define __AUFS_DENTRY_H__
+
+#ifdef __KERNEL__
+
+#include <linux/fs.h>
+#include <linux/namei.h>
+#include <linux/aufs_type.h>
+#include "misc.h"
+#include "super.h"
+#include "vfsub.h"
+
+/* nameidata open_intent */
+enum {
+ AuIntent_AUFS,
+ AuIntent_BRANCH,
+ AuIntent_Last
+};
+
+struct au_hdintent {
+ struct list_head hdi_list;
+ struct file *hdi_file[AuIntent_Last];
+};
+
+struct au_hdentry {
+ struct dentry *hd_dentry;
+
+#ifdef CONFIG_AUFS_BR_NFS
+ spinlock_t hd_lock; /* intest_list */
+ struct list_head *hd_intent_list;
+#endif
+};
+
+struct au_dinfo {
+ ...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs lookup and dentry operations, source

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/dentry.c | 1020 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 1020 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/dentry.c b/fs/aufs/dentry.c
new file mode 100644
index 0000000..06afa17
--- /dev/null
+++ b/fs/aufs/dentry.c
@@ -0,0 +1,1020 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * lookup and dentry operations
+ *
+ * $Id: dentry.c,v 1.5 2008/05/12 00:29:11 sfjro Exp $
+ */
+
+//#include <linux/fs.h>
+//#include <linux/namei.h>
+#include "aufs.h"
+
+/* ---------------------------------------------------------------------- */
+
+/*
+ * au_lkup_one() is a generic abstract entry function which calls
+ * lookup_one_len() or __lookup_hash() finally. it is some condisions that makes
+ * lookup complicated, which are nfs branch, open-intent and dlgt mode.
+ */
+
+#if defined(CONFIG_AUFS_BR_NFS) || defined(CONFIG_AUFS_DLGT)
+/* cf. lookup_one_len() in linux/fs/namei.c */
+struct dentry *au_lkup_one(const char *name, struct dentry *parent, int len,
+ struct au_ndx *ndx)
+{
+ struct dentry *...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs dentry private data

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/dinfo.c | 425 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 425 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/dinfo.c b/fs/aufs/dinfo.c
new file mode 100644
index 0000000..2022cef
--- /dev/null
+++ b/fs/aufs/dinfo.c
@@ -0,0 +1,425 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * dentry private data
+ *
+ * $Id: dinfo.c,v 1.3 2008/04/28 03:04:23 sfjro Exp $
+ */
+
+#include "aufs.h"
+
+int au_alloc_dinfo(struct dentry *dentry)
+{
+ struct au_dinfo *dinfo;
+ struct super_block *sb;
+ int nbr;
+
+ LKTRTrace("%.*s\n", AuDLNPair(dentry));
+ AuDebugOn(dentry->d_fsdata);
+
+ dinfo = au_cache_alloc_dinfo();
+ //if (LktrCond) {au_cache_free_dinfo(dinfo); dinfo = NULL;}
+ if (dinfo) {
+ sb = dentry->d_sb;
+ nbr = au_sbend(sb) + 1;
+ if (unlikely(nbr <= 0))
+ nbr = 1;
+ dinfo->di_hdentry = kcalloc(nbr, sizeof(*dinfo->di_hdentry),
+ GFP_KERNEL);
+ //if (LktrCond)
+ //{kfree(dinfo->di_hdentry); dinfo->di_hdentry = NULL;}
+ if (dinfo->di_hdentry) {
+ au_h_dentry_init_all(dinfo->d...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs file operations

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/file.h | 246 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 246 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/file.h b/fs/aufs/file.h
new file mode 100644
index 0000000..33a1036
--- /dev/null
+++ b/fs/aufs/file.h
@@ -0,0 +1,246 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * file operations
+ *
+ * $Id: file.h,v 1.2 2008/04/21 01:35:14 sfjro Exp $
+ */
+
+#ifndef __AUFS_FILE_H__
+#define __AUFS_FILE_H__
+
+#ifdef __KERNEL__
+
+#include <linux/file.h>
+#include <linux/fs.h>
+#include <linux/mm.h>
+#include <linux/aufs_type.h>
+#include "dentry.h"
+#include "misc.h"
+#include "super.h"
+
+/* ---------------------------------------------------------------------- */
+
+struct au_branch;
+struct au_hfile {
+ struct file *hf_file;
+ struct au_branch *hf_br;
+};
+
+struct au_vdir;
+struct au_finfo {
+ atomic_t fi_generation;
+
+ struct au_rwsem fi_rwsem;
+ struct au_hfile *fi_hfile;
+ aufs_bindex_t fi_bstart, fi_bend;
+
+ union {
+ struct vm_operations_struct *fi_h_vm_ops;
+ struct ...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs handling file/dir, and address_space operation

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/file.c | 822 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 822 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/file.c b/fs/aufs/file.c
new file mode 100644
index 0000000..d4396d3
--- /dev/null
+++ b/fs/aufs/file.c
@@ -0,0 +1,822 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * handling file/dir, and address_space operation
+ *
+ * $Id: file.c,v 1.4 2008/05/04 23:54:53 sfjro Exp $
+ */
+
+//#include <linux/fsnotify.h>
+#include <linux/pagemap.h>
+//#include <linux/poll.h>
+//#include <linux/security.h>
+#include "aufs.h"
+
+/*
+ * a dirty trick for handling FMODE_EXEC and deny_write_access().
+ * because FMODE_EXEC flag is not passed to f_op->open(),
+ * set it to file->private_data temporary.
+ */
+#if !defined(CONFIG_AUFS_MODULE) || defined(CONFIG_AUFS_DENY_WRITE_ACCESS_PATCH)
+int au_store_fmode_exec(struct nameidata *nd, struct inode *inode)
+{
+ int err;
+ union {
+ void *p;
+ unsigned long ul;
+ } u;
+
+ err = 0;
+ if (nd
+ && (nd->fla...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs file private data

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/finfo.c | 185 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 185 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/finfo.c b/fs/aufs/finfo.c
new file mode 100644
index 0000000..74b2ebf
--- /dev/null
+++ b/fs/aufs/finfo.c
@@ -0,0 +1,185 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * file private data
+ *
+ * $Id: finfo.c,v 1.2 2008/04/21 01:35:14 sfjro Exp $
+ */
+
+#include "aufs.h"
+
+struct au_finfo *au_fi(struct file *file)
+{
+ struct au_finfo *finfo = file->private_data;
+ AuDebugOn(!finfo
+ || !finfo->fi_hfile
+ || (0 < finfo->fi_bend
+ && (/* au_sbi(file->f_dentry->d_sb)->si_bend
+ < finfo->fi_bend
+ || */ finfo->fi_bend < finfo->fi_bstart)));
+ return finfo;
+}
+
+struct au_branch *au_fbr(struct file *file, aufs_bindex_t bindex)
+{
+ struct au_finfo *finfo = au_fi(file);
+ struct au_hfile *hf;
+
+ FiMustAnyLock(file);
+ AuDebugOn(!finfo
+ || finfo->fi_bstart < 0
+ || bindex < finfo->fi_bstart
+ || finfo->fi_bend &l...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs file and vm operations

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/f_op.c | 665 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 665 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/f_op.c b/fs/aufs/f_op.c
new file mode 100644
index 0000000..ee8a849
--- /dev/null
+++ b/fs/aufs/f_op.c
@@ -0,0 +1,665 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * file and vm operations
+ *
+ * $Id: f_op.c,v 1.4 2008/05/12 00:28:10 sfjro Exp $
+ */
+
+//#include <linux/fsnotify.h>
+#include <linux/fs_stack.h>
+//#include <linux/pagemap.h>
+#include <linux/poll.h>
+//#include <linux/security.h>
+#include "aufs.h"
+
+/* common function to regular file and dir */
+int aufs_flush(struct file *file, fl_owner_t id)
+{
+ int err;
+ struct dentry *dentry;
+ aufs_bindex_t bindex, bend;
+
+ dentry = file->f_dentry;
+ LKTRTrace("%.*s\n", AuDLNPair(dentry));
+
+ // aufs_read_lock_file()
+ si_noflush_read_lock(dentry->d_sb);
+ fi_read_lock(file);
+ di_read_lock_child(dentry, AuLock_IW);
+
+ err = 0;
+ bend = au_fbend(file);
+ for (bindex = au_fbstart(file); !err &&...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs directory operations, header

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/dir.h | 146 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 146 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/dir.h b/fs/aufs/dir.h
new file mode 100644
index 0000000..94ccbd1
--- /dev/null
+++ b/fs/aufs/dir.h
@@ -0,0 +1,146 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * directory operations
+ *
+ * $Id: dir.h,v 1.2 2008/04/21 01:34:26 sfjro Exp $
+ */
+
+#ifndef __AUFS_DIR_H__
+#define __AUFS_DIR_H__
+
+#ifdef __KERNEL__
+
+#include <linux/fs.h>
+#include <linux/aufs_type.h>
+
+/* ---------------------------------------------------------------------- */
+
+/* need to be faster and smaller */
+
+#define AuSize_DEBLK 512 // todo: changeable
+#define AuSize_NHASH 32 // todo: changeable
+#if AuSize_DEBLK < NAME_MAX || PAGE_SIZE < AuSize_DEBLK
+#error invalid size AuSize_DEBLK
+#endif
+
+typedef char au_vdir_deblk_t[AuSize_DEBLK];
+
+struct au_nhash {
+ struct hlist_head heads[AuSize_NHASH];
+};
+
+struct au_vdir_destr {
+ unsigned char len;
+ char name[0];
+} __packed;
+
+struct...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs directory operations, source

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/dir.c | 573 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 573 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/dir.c b/fs/aufs/dir.c
new file mode 100644
index 0000000..e9dac57
--- /dev/null
+++ b/fs/aufs/dir.c
@@ -0,0 +1,573 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * directory operations
+ *
+ * $Id: dir.c,v 1.4 2008/05/12 00:27:58 sfjro Exp $
+ */
+
+#include <linux/fs_stack.h>
+#include "aufs.h"
+
+static int reopen_dir(struct file *file)
+{
+ int err;
+ struct dentry *dentry, *h_dentry;
+ aufs_bindex_t bindex, btail, bstart;
+ struct file *h_file;
+
+ dentry = file->f_dentry;
+ LKTRTrace("%.*s\n", AuDLNPair(dentry));
+ AuDebugOn(!S_ISDIR(dentry->d_inode->i_mode));
+
+ /* open all hidden dirs */
+ bstart = au_dbstart(dentry);
+#if 1
+ for (bindex = au_fbstart(file); bindex < bstart; bindex++)
+ au_set_h_fptr(file, bindex, NULL);
+#endif
+ au_set_fbstart(file, bstart);
+ btail = au_dbtaildir(dentry);
+#if 1
+ for (bindex = au_fbend(file); btail < bindex; bindex--)
+ au_se...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs virtual or vertical directory

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/vdir.c | 963 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 963 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/vdir.c b/fs/aufs/vdir.c
new file mode 100644
index 0000000..f2b67e9
--- /dev/null
+++ b/fs/aufs/vdir.c
@@ -0,0 +1,963 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * virtual or vertical directory
+ *
+ * $Id: vdir.c,v 1.3 2008/04/28 03:05:48 sfjro Exp $
+ */
+
+#include "aufs.h"
+
+static int calc_size(int namelen)
+{
+ int sz;
+
+ sz = sizeof(struct au_vdir_de) + namelen;
+ if (sizeof(ino_t) == sizeof(long)) {
+ const int mask = sizeof(ino_t) - 1;
+ if (sz & mask) {
+ sz += sizeof(ino_t);
+ sz &= ~mask;
+ }
+ } else {
+#if 0 // remove
+ BUG();
+ /* this block will be discarded by optimizer. */
+ int m;
+ m = sz % sizeof(ino_t);
+ if (m)
+ sz += sizeof(ino_t) - m;
+#endif
+ }
+
+ AuDebugOn(sz % sizeof(ino_t));
+ return sz;
+}
+
+static int set_deblk_end(union au_vdir_deblk_p *p,
+ union au_vdir_deblk_p *deblk_end)
+{
+ if (calc_size(0) <= deblk_end->p - ...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs inode operations

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/inode.h | 336 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 336 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/inode.h b/fs/aufs/inode.h
new file mode 100644
index 0000000..6b6945f
--- /dev/null
+++ b/fs/aufs/inode.h
@@ -0,0 +1,336 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * inode operations
+ *
+ * $Id: inode.h,v 1.2 2008/04/21 01:32:05 sfjro Exp $
+ */
+
+#ifndef __AUFS_INODE_H__
+#define __AUFS_INODE_H__
+
+#ifdef __KERNEL__
+
+#include <linux/fs.h>
+#include <linux/namei.h>
+#include <linux/security.h>
+#include <linux/aufs_type.h>
+#include "hinode.h"
+#include "misc.h"
+#include "super.h"
+
+struct au_hinode;
+struct au_vdir;
+struct au_iinfo {
+ atomic_t ii_generation;
+ struct super_block *ii_hsb1; /* no get/put */
+
+ struct au_rwsem ii_rwsem;
+ aufs_bindex_t ii_bstart, ii_bend;
+ struct au_hinode *ii_hinode;
+ struct au_vdir *ii_vdir;
+};
+
+struct aufs_icntnr {
+ struct au_iinfo iinfo;
+ struct inode vfs_inode;
+};
+
+/* --------------------------------------------...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:32 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs inode functions

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/inode.c | 425 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 425 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/inode.c b/fs/aufs/inode.c
new file mode 100644
index 0000000..7bab2cc
--- /dev/null
+++ b/fs/aufs/inode.c
@@ -0,0 +1,425 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * inode functions
+ *
+ * $Id: inode.c,v 1.3 2008/04/28 03:04:12 sfjro Exp $
+ */
+
+#include "aufs.h"
+
+int au_refresh_hinode_self(struct inode *inode)
+{
+ int err, new_sz, update;
+ struct inode *first;
+ struct au_hinode *p, *q, tmp;
+ struct super_block *sb;
+ struct au_iinfo *iinfo;
+ aufs_bindex_t bindex, bend, new_bindex;
+
+ LKTRTrace("i%lu\n", inode->i_ino);
+ IiMustWriteLock(inode);
+
+ err = -ENOMEM;
+ update = 0;
+ sb = inode->i_sb;
+ bend = au_sbend(sb);
+ new_sz = sizeof(*iinfo->ii_hinode) * (bend + 1);
+ iinfo = au_ii(inode);
+ p = au_kzrealloc(iinfo->ii_hinode, sizeof(*p) * (iinfo->ii_bend + 1),
+ new_sz, GFP_KERNEL);
+ //p = NULL;
+ if (unlikely(!p))
+ goto out;
+
+ iinfo->ii_hinode = p;
+ p = iinf...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:33 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs inode private data

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/iinfo.c | 290 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 290 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/iinfo.c b/fs/aufs/iinfo.c
new file mode 100644
index 0000000..c8eb976
--- /dev/null
+++ b/fs/aufs/iinfo.c
@@ -0,0 +1,290 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * inode private data
+ *
+ * $Id: iinfo.c,v 1.2 2008/04/21 01:32:05 sfjro Exp $
+ */
+
+#include "aufs.h"
+
+struct au_iinfo *au_ii(struct inode *inode)
+{
+ struct au_iinfo *iinfo;
+
+ iinfo = &(container_of(inode, struct aufs_icntnr, vfs_inode)->iinfo);
+ /* bad_inode case */
+ if (unlikely(!iinfo->ii_hinode))
+ return NULL;
+ AuDebugOn(!iinfo->ii_hinode
+ /* || au_sbi(inode->i_sb)->si_bend < iinfo->ii_bend */
+ || iinfo->ii_bend < iinfo->ii_bstart);
+ return iinfo;
+}
+
+struct inode *au_h_iptr(struct inode *inode, aufs_bindex_t bindex)
+{
+ struct inode *hidden_inode;
+
+ IiMustAnyLock(inode);
+ AuDebugOn(bindex < 0 || au_ibend(inode) < bindex);
+ hidden_inode = au_ii(inode)->ii_hinode[0...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:33 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs inode operations (except add/del/rename)

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/i_op.c | 844 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 844 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/i_op.c b/fs/aufs/i_op.c
new file mode 100644
index 0000000..2efa931
--- /dev/null
+++ b/fs/aufs/i_op.c
@@ -0,0 +1,844 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * inode operations (except add/del/rename)
+ *
+ * $Id: i_op.c,v 1.4 2008/05/04 23:54:53 sfjro Exp $
+ */
+
+//#include <linux/fs.h>
+#include <linux/fs_stack.h>
+//#include <linux/namei.h>
+//#include <linux/mm.h>
+#include <linux/uaccess.h>
+#include "aufs.h"
+
+static int h_permission(struct inode *h_inode, int mask,
+ struct nameidata *fake_nd, int brperm, int dlgt)
+{
+ int err, submask;
+ const int write_mask = (mask & (MAY_WRITE | MAY_APPEND));
+
+ LKTRTrace("ino %lu, mask 0x%x, brperm 0x%x\n",
+ h_inode->i_ino, mask, brperm);
+
+ err = -EACCES;
+ if (unlikely((write_mask && IS_IMMUTABLE(h_inode))
+ || ((mask & MAY_EXEC) && S_ISREG(h_inode->i_mode)
...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:33 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs inode operations (add entry)

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/i_op_add.c | 828 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 828 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/i_op_add.c b/fs/aufs/i_op_add.c
new file mode 100644
index 0000000..1f1fb6c
--- /dev/null
+++ b/fs/aufs/i_op_add.c
@@ -0,0 +1,828 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * inode operations (add entry)
+ *
+ * $Id: i_op_add.c,v 1.4 2008/05/04 23:54:53 sfjro Exp $
+ */
+
+#include "aufs.h"
+
+/*
+ * final procedure of adding a new entry, except link(2).
+ * remove whiteout, instantiate, copyup the parent dir's times and size
+ * and update version.
+ * if it failed, re-create the removed whiteout.
+ */
+static int epilog(struct inode *dir, struct dentry *wh_dentry,
+ struct dentry *dentry)
+{
+ int err, rerr;
+ aufs_bindex_t bwh;
+ struct inode *inode, *h_dir;
+ struct dentry *wh;
+ struct au_ndx ndx;
+ struct super_block *sb;
+
+ LKTRTrace("wh %p, %.*s\n", wh_dentry, AuDLNPair(dentry));
+
+ bwh = -1;
+ if (wh_dentry) {
+ h_dir = wh_dentry->d_parent->d_inode; /* dir inode is locke...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:33 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs inode operations (del entry)

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/i_op_del.c | 582 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 582 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/i_op_del.c b/fs/aufs/i_op_del.c
new file mode 100644
index 0000000..5b84cca
--- /dev/null
+++ b/fs/aufs/i_op_del.c
@@ -0,0 +1,582 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * inode operations (del entry)
+ *
+ * $Id: i_op_del.c,v 1.4 2008/05/04 23:54:53 sfjro Exp $
+ */
+
+#include "aufs.h"
+
+/* returns,
+ * 0: wh is unnecessary
+ * plus: wh is necessary
+ * minus: error
+ */
+int au_wr_dir_need_wh(struct dentry *dentry, int isdir, aufs_bindex_t *bcpup,
+ struct dentry *locked)
+{
+ int need_wh, err;
+ aufs_bindex_t bstart;
+ struct dentry *h_dentry;
+ struct super_block *sb;
+
+ LKTRTrace("%.*s, isdir %d, *bcpup %d, locked %p\n",
+ AuDLNPair(dentry), isdir, *bcpup, locked);
+ sb = dentry->d_sb;
+
+ bstart = au_dbstart(dentry);
+ LKTRTrace("bcpup %d, bstart %d\n", *bcpup, bstart);
+ h_dentry = au_h_dptr(dentry, bstart);
+ if (*bcpup < 0) {
+ *bcpup = bstart;
+ if (au_tes...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:33 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs inode operation (rename entry)

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/i_op_ren.c | 832 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 832 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/i_op_ren.c b/fs/aufs/i_op_ren.c
new file mode 100644
index 0000000..e1e05fb
--- /dev/null
+++ b/fs/aufs/i_op_ren.c
@@ -0,0 +1,832 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * inode operation (rename entry)
+ * todo: this is monster
+ *
+ * $Id: i_op_ren.c,v 1.4 2008/05/04 23:51:40 sfjro Exp $
+ */
+
+#include "aufs.h"
+
+enum { SRC, DST };
+
+#define AuRen_ISDIR 1
+#define AuRen_ISSAMEDIR (1 << 1)
+#define AuRen_WHSRC (1 << 2)
+#define AuRen_WHDST (1 << 3)
+#define AuRen_DLGT (1 << 4)
+#define au_ftest_ren(flags, name) ((flags) & AuRen_##name)
+#define au_fset_ren(flags, name) { (flags) |= AuRen_##name; }
+#define au_fclr_ren(flags, name) { (flags) &= ~AuRen_##name; }
+#ifndef CONFIG_AUFS_DLGT
+#undef AuRen_DLGT
+#define AuRen_DLGT 0
+#endif
+
+struct rename_args {
+ struct dentry *h_dentry[2], *parent[2], *h_parent[2], *h_trap;
+ struct au_nhash whlist;
+ au...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:33 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs lower (branch filesystem) inode and setting inotify

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/hinode.h | 188 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 188 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/hinode.h b/fs/aufs/hinode.h
new file mode 100644
index 0000000..59ddae7
--- /dev/null
+++ b/fs/aufs/hinode.h
@@ -0,0 +1,188 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * lower (branch filesystem) inode and setting inotify
+ *
+ * $Id: hinode.h,v 1.3 2008/04/28 03:08:37 sfjro Exp $
+ */
+
+#ifndef __AUFS_HINODE_H__
+#define __AUFS_HINODE_H__
+
+#ifdef __KERNEL__
+
+#include <linux/fs.h>
+#include <linux/inotify.h>
+#include <linux/aufs_type.h>
+//#include "branch.h"
+//#include "inode.h"
+#include "super.h"
+#include "vfsub.h"
+
+/* ---------------------------------------------------------------------- */
+
+struct au_hinotify {
+#ifdef CONFIG_AUFS_HINOTIFY
+ struct inotify_watch hin_watch;
+ struct inode *hin_aufs_inode; /* no get/put */
+
+ /* an array of atomic_t X au_hin_nignore */
+ atomic_t hin_ignore[0];
+#endif
+};
+
+struct au_hinode {
+ ...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:33 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs inotify handler

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/hinotify.c | 1114 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 1114 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/hinotify.c b/fs/aufs/hinotify.c
new file mode 100644
index 0000000..28176f6
--- /dev/null
+++ b/fs/aufs/hinotify.c
@@ -0,0 +1,1114 @@
+/*
+ * Copyright (C) 2006-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * inotify handler
+ *
+ * $Id: hinotify.c,v 1.4 2008/05/04 23:52:19 sfjro Exp $
+ */
+
+#include "aufs.h"
+
+/* inotify events */
+static const __u32 AuInMask = (IN_MOVE | IN_DELETE | IN_CREATE
+ /* | IN_ACCESS */
+ | IN_MODIFY | IN_ATTRIB
+ /* | IN_DELETE_SELF | IN_MOVE_SELF */
+ );
+static struct inotify_handle *in_handle;
+
+/* the size of an array for ignore counter */
+static int au_hin_nignore;
+
+AuCacheFuncs(hinotify, AuCache_HINOTIFY);
+
+int au_hin_alloc(struct au_hinode *hinode, struct inode *inode,
+ struct inode *hidden_inode)
+{
+ int err, i;
+ struct au_hinotify *hin;
+ s32 wd;
+
+ LKTRTrace("i%lu, hi%lu\n", inode->i_ino, hidden_inode->i_ino);
+
+ err = -ENOMEM;
+ hin = au_cache_a...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:33 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs sub-routines for vfs in hinotify or dlgt mode

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/hin_or_dlgt.c | 708 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 708 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/hin_or_dlgt.c b/fs/aufs/hin_or_dlgt.c
new file mode 100644
index 0000000..ad0a2fc
--- /dev/null
+++ b/fs/aufs/hin_or_dlgt.c
@@ -0,0 +1,708 @@
+/*
+ * Copyright (C) 2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * sub-routines for vfs in hinotify or dlgt mode
+ *
+ * $Id: hin_or_dlgt.c,v 1.2 2008/04/21 02:00:37 sfjro Exp $
+ */
+// I'm going to slightly mad
+
+#include <linux/uaccess.h>
+#include "aufs.h"
+
+#if !defined(CONFIG_AUFS_HINOTIFY) && !defined(CONFIG_AUFS_DLGT)
+#error mis-configuraion or Makefile
+#endif
+
+/* ---------------------------------------------------------------------- */
+
+struct permission_args {
+ int *errp;
+ struct inode *inode;
+ int mask;
+ struct nameidata *nd;
+};
+
+static void call_permission(void *args)
+{
+ struct permission_args *a = args;
+ *a->errp = do_vfsub_permission(a->inode, a->mask, a->nd);
+}
+
+int vfsub_permission(struct inode *inode,...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:33 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs lookup functions in 'delegate' mode

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/dlgt.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 113 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/dlgt.c b/fs/aufs/dlgt.c
new file mode 100644
index 0000000..0721a73
--- /dev/null
+++ b/fs/aufs/dlgt.c
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * lookup functions in 'delegate' mode
+ *
+ * $Id: dlgt.c,v 1.2 2008/04/21 02:00:37 sfjro Exp $
+ */
+
+//#include <linux/security.h>
+#include "aufs.h"
+
+/* ---------------------------------------------------------------------- */
+
+struct au_lookup_one_len_args {
+ struct dentry **errp;
+ const char *name;
+ struct dentry *parent;
+ int len;
+};
+
+static void au_call_lookup_one_len(void *args)
+{
+ struct au_lookup_one_len_args *a = args;
+ *a->errp = vfsub_lookup_one_len(a->name, a->parent, a->len);
+}
+
+struct dentry *au_lkup_one_dlgt(const char *name, struct dentry *parent,
+ int len, unsigned int flags)
+{
+ struct dentry *dentry;
+ int dirperm1;
+
+ LKTRTrace("%.*s/%.*s, 0x%x\n", AuDLNPair(parent),...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:33 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs export via nfs

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/export.c | 597 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 597 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/export.c b/fs/aufs/export.c
new file mode 100644
index 0000000..edcbb6f
--- /dev/null
+++ b/fs/aufs/export.c
@@ -0,0 +1,597 @@
+/*
+ * Copyright (C) 2007-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * export via nfs
+ *
+ * $Id: export.c,v 1.4 2008/05/04 23:52:08 sfjro Exp $
+ */
+
+#include <linux/exportfs.h>
+#include "aufs.h"
+
+union conv {
+#if BITS_PER_LONG == 32
+ __u32 a[1];
+#else
+ __u32 a[2];
+#endif
+ ino_t ino;
+};
+
+static ino_t decode_ino(__u32 *a)
+{
+ union conv u;
+
+ u.a[0] = a[0];
+#if BITS_PER_LONG == 64
+ u.a[1] = a[1];
+#endif
+ return u.ino;
+}
+
+static void encode_ino(__u32 *a, ino_t ino)
+{
+ union conv u;
+
+ u.ino = ino;
+ a[0] = u.a[0];
+#if BITS_PER_LONG == 64
+ a[1] = u.a[1];
+#endif
+}
+
+/* NFS file handle */
+enum {
+ Fh_br_id,
+ Fh_sigen,
+#if BITS_PER_LONG == 64
+ /* support 64bit inode number */
+ Fh_ino1,
+ Fh_ino2,
+ Fh_dir_ino1,
+ Fh_dir_ino2,
+ Fh_h_ino1,
+ Fh_h_ino...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:33 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs 'robr', aufs as readonly branch of another aufs

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/robr.c | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 111 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/robr.c b/fs/aufs/robr.c
new file mode 100644
index 0000000..0e508bc
--- /dev/null
+++ b/fs/aufs/robr.c
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * 'robr', aufs as readonly branch of another aufs
+ *
+ * $Id: robr.c,v 1.2 2008/05/12 00:26:53 sfjro Exp $
+ */
+
+#include "aufs.h"
+
+/* ---------------------------------------------------------------------- */
+
+int au_test_robr_wh(struct qstr *name, struct dentry *h_parent,
+ struct qstr *wh_name, int try_sio, struct au_ndx *ndx)
+{
+ if (strncmp(name->name, AUFS_WH_PFX, AUFS_WH_PFX_LEN))
+ return au_wh_test(h_parent, wh_name, try_sio, ndx);
+ return -EPERM;
+}
+
+int au_test_robr_shwh(struct super_block *sb, const struct qstr *name)
+{
+ return 0;
+}
+
+/* ---------------------------------------------------------------------- */
+
+struct au_robr_lvma {
+ struct list_head list;
+ struct vm_area_struct *vm...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:33 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs sysfs interface

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/sysfs.c | 459 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 459 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/sysfs.c b/fs/aufs/sysfs.c
new file mode 100644
index 0000000..eb0d367
--- /dev/null
+++ b/fs/aufs/sysfs.c
@@ -0,0 +1,459 @@
+/*
+ * Copyright (C) 2007-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * sysfs interface
+ *
+ * $Id: sysfs.c,v 1.3 2008/05/12 00:27:58 sfjro Exp $
+ */
+
+#include <linux/fs.h>
+#include <linux/module.h>
+#include <linux/seq_file.h>
+#include <linux/sysfs.h>
+#include "aufs.h"
+
+
+#ifdef CONFIG_AUFS_LOCAL
+static ssize_t config_show(struct kobject *kobj, struct kobj_attribute *attr,
+ char *buf)
+{
+#define conf_bool(name) "CONFIG_AUFS_" #name "=y\n"
+ static const char opt[] =
+#ifdef CONFIG_AUFS
+ "CONFIG_AUFS=y\n"
+#else
+ "CONFIG_AUFS=m\n"
+#endif
+#ifdef CONFIG_AUFS_FAKE_DM
+ conf_bool(FAKE_DM)
+#endif
+#ifdef CONFIG_AUFS_BRANCH_MAX_127
+ conf_bool(BRANCH_MAX_127)
+#elif defined(CONFIG_AUFS_BRANCH_MAX_511)
+ conf_bool(BRANCH_MAX_511)
+#elif defined(CONFIG_AUFS_BRANCH_MA...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:33 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs misc functions, header

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/misc.h | 201 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 201 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/misc.h b/fs/aufs/misc.h
new file mode 100644
index 0000000..e57c398
--- /dev/null
+++ b/fs/aufs/misc.h
@@ -0,0 +1,201 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * $Id: misc.h,v 1.2 2008/04/21 01:33:00 sfjro Exp $
+ */
+
+#ifndef __AUFS_MISC_H__
+#define __AUFS_MISC_H__
+
+#ifdef __KERNEL__
+
+#include <linux/fs.h>
+#include <linux/namei.h>
+#include <linux/aufs_type.h>
+
+/* ---------------------------------------------------------------------- */
+
+typedef unsigned int au_gen_t;
+/* see linux/include/linux/jiffies.h */
+#define AuGenYounger(a, b) ((int)(b) - (int)(a) < 0)
+#define AuGenOlder(a, b) AufsGenYounger(b, a)
+
+/* ---------------------------------------------------------------------- */
+
+struct au_rwsem {
+ struct rw_semaphore rwsem;
+#ifdef CONFIG_AUFS_DEBUG
+ atomic_t rcnt;
+#endif
+};
+
+#ifdef CONFIG_AUFS_DEBUG
+#define AuDbgRcntInit(rw) do { \
+ atomic_s...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:33 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs misc functions, source

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/misc.c | 307 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 307 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/misc.c b/fs/aufs/misc.c
new file mode 100644
index 0000000..edb5f7c
--- /dev/null
+++ b/fs/aufs/misc.c
@@ -0,0 +1,307 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * $Id: misc.c,v 1.5 2008/05/12 00:27:16 sfjro Exp $
+ */
+
+//#include <linux/fs.h>
+//#include <linux/namei.h>
+//#include <linux/mm.h>
+//#include <asm/uaccess.h>
+#include "aufs.h"
+
+void *au_kzrealloc(void *p, unsigned int nused, unsigned int new_sz, gfp_t gfp)
+{
+ void *q;
+
+ LKTRTrace("p %p, nused %d, sz %d\n", p, nused, new_sz);
+ AuDebugOn(new_sz <= 0);
+ if (new_sz <= nused)
+ return p;
+
+ q = krealloc(p, new_sz, gfp);
+ if (q)
+ memset(q + nused, 0, new_sz - nused);
+ return q;
+}
+
+/* ---------------------------------------------------------------------- */
+
+struct nameidata *au_dup_nd(struct au_sbinfo *sbinfo, struct nameidata *dst,
+ struct nameidata *src)
+{
+ LKTRTrace("src %p\n...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:33 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs debug print functions, header

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/debug.h | 210 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 210 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/debug.h b/fs/aufs/debug.h
new file mode 100644
index 0000000..5e723a0
--- /dev/null
+++ b/fs/aufs/debug.h
@@ -0,0 +1,210 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * debug print functions
+ *
+ * $Id: debug.h,v 1.2 2008/04/21 02:00:37 sfjro Exp $
+ */
+
+#ifndef __AUFS_DEBUG_H__
+#define __AUFS_DEBUG_H__
+
+#ifdef __KERNEL__
+
+#include <linux/fs.h>
+
+/* to debug easier, do not make it an inlined function */
+#define MtxMustLock(mtx) AuDebugOn(!mutex_is_locked(mtx))
+
+#ifdef CONFIG_AUFS_DEBUG
+/* sparse warns about pointer */
+#define AuDebugOn(a) BUG_ON(!!(a))
+extern atomic_t au_cond;
+#define au_debug_on() atomic_inc_return(&au_cond)
+#define au_debug_off() atomic_dec_return(&au_cond)
+static inline int au_debug_test(void)
+{
+ return atomic_read(&au_cond);
+}
+#else
+#define AuDebugOn(a) do {} while (0)
+#define au_debug_on() do {} while (0)
+#define au_debug_o...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:33 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs debug print functions, source

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/debug.c | 485 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 485 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/debug.c b/fs/aufs/debug.c
new file mode 100644
index 0000000..e6e178d
--- /dev/null
+++ b/fs/aufs/debug.c
@@ -0,0 +1,485 @@
+/*
+ * Copyright (C) 2005-2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * debug print functions
+ *
+ * $Id: debug.c,v 1.2 2008/04/21 01:33:00 sfjro Exp $
+ */
+
+//#include <linux/errno.h>
+#include "aufs.h"
+
+atomic_t au_cond = ATOMIC_INIT(0);
+
+char *au_plevel = KERN_DEBUG;
+#define dpri(fmt, arg...) do { \
+ if (LktrCond) \
+ printk("%s" fmt, au_plevel, ##arg); \
+} while (0)
+
+/* ---------------------------------------------------------------------- */
+
+void au_dpri_whlist(struct au_nhash *whlist)
+{
+ int i;
+ struct hlist_head *head;
+ struct au_vdir_wh *tpos;
+ struct hlist_node *pos;
+
+ for (i = 0; i < AuSize_NHASH; i++) {
+ head = whlist->heads + i;
+ hlist_for_each_entry(tpos, pos, head, wh_hash)
+ dpri("b%d, %.*s, %d\n",
+ tpos->wh_bindex,
+ tpos...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:33 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs magic sysrq handler

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/aufs/sysrq.c | 112 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 112 insertions(+), 0 deletions(-)

diff --git a/fs/aufs/sysrq.c b/fs/aufs/sysrq.c
new file mode 100644
index 0000000..c50c885
--- /dev/null
+++ b/fs/aufs/sysrq.c
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2008 Junjiro 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * magic sysrq hanlder
+ *
+ * $Id: sysrq.c,v 1.4 2008/05/04 23:53:27 sfjro Exp $
+ */
+
+#include <linux/fs.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/sysrq.h>
+#include "aufs.h"
+
+static void sysrq_sb(struct super_block *sb)
+{
+ char *plevel;
+ struct inode *i;
+
+ plevel = au_plevel;
+ au_plevel = KERN_WARNING;
+ au_debug_on();
+
+ pr_warning(AUFS_NAME ": superblock\n");
+ au_dpri_sb(sb);
+ pr_warning(AUFS_NAME ": root dentry\n");
+ au_dpri_dentry(sb->s_root);
+#if 0
+ pr_warning(AUFS_NAME ": root inode\n");
+ au_dpri_inode(sb->s_root->d_inode);
+#endif
+#if 1
+ pr_warning(AUFS_NAME ": isolated inode\n");
+ list_for_each_entry(i, &sb->s_inodes, i_sb_list)
+ if ...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:33 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs mount helper

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
Documentation/filesystems/aufs/mount.aufs | 205 +++++++++++++++++++++++++++++
1 files changed, 205 insertions(+), 0 deletions(-)

diff --git a/Documentation/filesystems/aufs/mount.aufs b/Documentation/filesystems/aufs/mount.aufs
new file mode 100755
index 0000000..28db51e
--- /dev/null
+++ b/Documentation/filesystems/aufs/mount.aufs
@@ -0,0 +1,205 @@
+#!/bin/sh -
+
+# Copyright (C) 2005, 2006, 2007 Junjiro 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
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+# $Id: mount.aufs,v 1.17 2008/03/31 07:44:10 sfjro Exp $
+
+#
+# The main purpose of this script is updating /etc/mtab and calling auplilnk.
+# This script is highly depending on mount(8) in util-linux-2.12p package.
+# TODO: rewrite in C.
+# TODO: updating mtab for bind-mount is not fully supportetd.
+#
+
+PATH=/usr/bin:/usr/sbin:/bin:/sbin
+export PATH
+eecho() { echo "$@" 1>&2; }
+
+conv() # [escape]
+{
+ sed -r -e '
+ s/\\/\\134/g
+ s/$/\\012/
+ ' |
+ tr -d '\n' |
+ sed -r -e '
+ s/ /\\040/g
+ s/\t/\\011/g
+ s/\r/\\015/g
+ s/\\012$//
+ ' |
+ { test "$1" = "escape" && sed -r -e 's/\\/\\\\/g' || cat; }
+ echo
+}
+
+########################################
+...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:33 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs pseudo-link helper

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
Documentation/filesystems/aufs/auplink | 170 ++++++++++++++++++++++++++++++++
1 files changed, 170 insertions(+), 0 deletions(-)

diff --git a/Documentation/filesystems/aufs/auplink b/Documentation/filesystems/aufs/auplink
new file mode 100755
index 0000000..52daf3f
--- /dev/null
+++ b/Documentation/filesystems/aufs/auplink
@@ -0,0 +1,170 @@
+#!/bin/sh
+
+# Copyright (C) 2006, 2007, 2008 Junjiro 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
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+# $Id: auplink,v 1.9 2008/03/31 07:44:10 sfjro Exp $
+
+#set -x; echo $0 $@
+tmp=/tmp/$$
+set -e
+
+Usage()
+{
+ cat <<- EOF 1>&2
+ usage: $0 aufs_mount_point list|cpup|flush
+ 'list' shows the pseudo-linked inode numbers and filenames.
+ 'cpup' copies-up all pseudo-link to the writeble branch.
+ 'flush' calls 'cpup', and then "mount -o remount,clean_plink=inum"
+ and remove the whiteouted plink.
+ EOF
+ rm -f $tmp $tmp.*
+ exit 1
+}
+
+eecho() { echo "$@" 1>&2; }
+
+conv() # [escape]
+{
+ sed -r -e '
+ s/\\/\\134/g
+ s/$/\\012/
+ ' |
+ tr -d '\n' |
+ sed -r -e '
+ s/ /\\040/g
+ s/\t/\\011/g
+ s/\r/\\015/g
+ s/\\012$//
+ ' |
+ { test "$1" = "escape" &&...

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:33 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs pseudo-link helper for symlink

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
Documentation/filesystems/aufs/aulchown.c | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/Documentation/filesystems/aufs/aulchown.c b/Documentation/filesystems/aufs/aulchown.c
new file mode 100644
index 0000000..ca20584
--- /dev/null
+++ b/Documentation/filesystems/aufs/aulchown.c
@@ -0,0 +1,29 @@
+
+/*
+ * While this tool should be atomic, I choose loose/rough way.
+ * cf. auplink and aufs.5
+ * $Id: aulchown.c,v 1.1 2007/01/08 02:00:18 sfjro Exp $
+ */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <stdio.h>
+
+int main(int argc, char *argv[])
+{
+ int err, nerr;
+ struct stat st;
+
+ nerr = 0;
+ while (*++argv) {
+ err = lstat(*argv, &st);
+ if (!err && S_ISLNK(st.st_mode))
+ err = lchown(*argv, st.st_uid, st.st_gid);
+ if (!err)
+ continue;
+ perror(*argv);
+ nerr++;
+ }
+ return nerr;
+}
--
1.4.4.4

--

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:33 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

initial commit
aufs umount helper

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
Documentation/filesystems/aufs/umount.aufs | 33 ++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/Documentation/filesystems/aufs/umount.aufs b/Documentation/filesystems/aufs/umount.aufs
new file mode 100755
index 0000000..f05a462
--- /dev/null
+++ b/Documentation/filesystems/aufs/umount.aufs
@@ -0,0 +1,33 @@
+#!/bin/sh -
+
+# Copyright (C) 2007 Junjiro 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
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+# $Id: umount.aufs,v 1.1 2007/01/15 04:58:42 sfjro Exp $
+
+#
+# The main purpose of this script is calling auplink.
+#
+
+PATH=/usr/bin:/usr/sbin:/bin:/sbin
+export PATH
+
+set -e
+#set -x; echo $0 $@
+dev="$1"
+shift
+auplink "$dev" flush
+exec umount -i $@ "$dev"
--
1.4.4.4

--

To: <linux-fsdevel@...>, <linux-kernel@...>
Cc: Junjiro Okajima <hooanon05@...>
Date: Friday, May 16, 2008 - 10:33 am

From: Junjiro Okajima <hooanon05@yahoo.co.jp>

incorporate aufs, export __lookup_hash() and deeper lockdep

Signed-off-by: Junjiro Okajima <hooanon05@yahoo.co.jp>
---
fs/Kconfig | 2 ++
fs/Makefile | 1 +
fs/namei.c | 2 +-
include/linux/lockdep.h | 4 ++++
include/linux/namei.h | 1 +
5 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/fs/Kconfig b/fs/Kconfig
index 379eb47..6df842f 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -1072,6 +1072,8 @@ config UNION_FS_DEBUG
help
If you say Y here, you can turn on debugging output from Unionfs.

+source "fs/aufs/Kconfig"
+
endmenu

menu "Miscellaneous filesystems"
diff --git a/fs/Makefile b/fs/Makefile
index 7996220..bc5964a 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -121,3 +121,4 @@ obj-$(CONFIG_DEBUG_FS) += debugfs/
obj-$(CONFIG_OCFS2_FS) += ocfs2/
obj-$(CONFIG_GFS2_FS) += gfs2/
obj-$(CONFIG_UNION_FS) += unionfs/
+obj-$(CONFIG_AUFS) += aufs/
diff --git a/fs/namei.c b/fs/namei.c
index 185d56c..1b9e577 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1297,7 +1297,7 @@ int __user_path_lookup_open(const char __user *name, unsigned int lookup_flags,
return err;
}

-static struct dentry *__lookup_hash(struct qstr *name,
+struct dentry *__lookup_hash(struct qstr *name,
struct dentry *base, struct nameidata *nd)
{
struct dentry *dentry;
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 4c4d236..f5d0642 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -58,7 +58,11 @@ enum lock_usage_bit
#define LOCKF_USED_IN_IRQ_READ \
(LOCKF_USED_IN_HARDIRQ_READ | LOCKF_USED_IN_SOFTIRQ_READ)

+#ifdef CONFIG_AUFS
+#define MAX_LOCKDEP_SUBCLASSES 16UL
+#else
#define MAX_LOCKDEP_SUBCLASSES 8UL
+#endif

/*
* Lock-classes are keyed via unique addresses, by embedding the
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 24d88e9..33c7f23 100644
--- a/include...

Previous thread: none

Next thread: [Re: Linux 2.6.26-rc2] Write protect on on by Maciej Rutecki on Friday, May 16, 2008 - 10:55 am. (14 messages)