aufs mmap: remove include of linux/fs.h from linux/mm.h

This include is added by aufs3-mmap.patch but causes circular dependencies on
arm64 as seen with the Debian kernel packages in http://buildd.debian-ports.org/status/fetch.php?pkg=linux&arch=arm64&ver=3.14.12-1&stamp=1405234443
which contains:

In file included from /PKGBUILDDIR/include/linux/mm.h:23:0,
                 from /PKGBUILDDIR/include/linux/pid_namespace.h:6,
                 from /PKGBUILDDIR/include/linux/ptrace.h:9,
                 from /PKGBUILDDIR/arch/arm64/include/asm/compat.h:26,
                 from /PKGBUILDDIR/arch/arm64/include/asm/stat.h:23,
                 from /PKGBUILDDIR/include/linux/stat.h:5,
                 from /PKGBUILDDIR/include/linux/module.h:10,
                 from /PKGBUILDDIR/init/main.c:15:
/PKGBUILDDIR/include/linux/fs.h:1575:64: warning: 'struct kstat' declared inside parameter list [enabled by default]
  int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);

According to http://article.gmane.org/gmane.linux.ports.arm.kernel/342042
> The added mm.h->fs.h looks like a mistake, it should not be there, and we have
> in the past worked hard to separate mm.h, sched.h and fs.h from one another.

Move all of the static inline functions added to mm.h by
aufs3-mmap.patch into a new file, mm/aufs_mmap.c, instead to avoid the
new includes in mm.h.

See-also: http://www.mail-archive.com/aufs-users@lists.sourceforge.net/msg04727.html
Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
aufs: tiny, move upward static functions

Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
aufs: tiny, make a local var for repeated use

Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
aufs: allow deleting a branch who has an opened dir

An opened dir can makes a branch busy and the branch cannot be removed
(until this commit).
But when the same named dir exists on another branch, the opened aufs
dir should not be effected to its health and the branch should be able
to be removed.
But by this change, aufs_iterate() may show users a cached entry under
the removed dir. I am not sure how critical it is.
Other opened files still make the branch busy.

Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
aufs: bugfix, stop passing an error code to dput()

I am afraid this is the root cause of the bug James B reported, but I am
unsure. This is a definitly a bug though.

See-also: http://www.mail-archive.com/aufs-users@lists.sourceforge.net/msg04701.html
Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
aufs: possible bugfix, ptr in an array

This array is used for storing pointers and checked as
"array[i] != NULL)" later. There is no bug found yet, but I am afraid it
will be in the future.

Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
aufs: fhsm 1/10, documentation

Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
aufs: fhsm 2/10, a new branch attribute

This branch attribute represents that the branch is participant in FHSM.

Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
aufs: fhsm 3/10, a new internal sbinfo status

In order to activate FHSM, the number of branches who has fhsm attribute
has to be more than 2.

Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
aufs: fhsm 4/10, a new mount option, fhsm_sec

This value represents the caching time of STFS notification, which is a
subset of statfs.
The many frequent notification may damage the performance, so aufs
doesn't notify to user-space until the specified time has passed.

Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
aufs: fhsm 5/10, new info per writable branch

While any branch can be a participant in FHSM, the notification is made
from the writable branch only.

Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
aufs: fhsm 6/10, stop coo/moo for the fhsm daemon

The daemon (in FHSM world) operates the move-down. And to do this, it
opens the file. In this case, aufs should ignore the coo/moo branch
attribute.

Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
aufs: fhsm 7/10, a new ioctl

This ioctl returns an fd as a notification interface.

Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
aufs: fhsm 8/10, notifier core

The core of the fhsm notification is au_fhsm_wrote(), which retrieves
stfs, and if the specifed time has passed then tells stfs to userspace.

Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
aufs: fhsm 9/10, call notifier

Wherever aufs writes to a writable branch, the fhsm notification is
necessary.

Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
aufs: fhsm 10/10, kbuild

Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
Merge remote-tracking branch 'aufs3-standalone/aufs3.9/00base' into aufs3.9/10static
aufs: tiny, eliminate the rich sentences

Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
Merge branch 'aufs3.9/10static' into aufs3.9/11proc_map
Merge branch 'aufs3.9/00base' into aufs3.10/00base