SOURCES: kernel-aufs2.patch (NEW) - snap from git

zbyniu zbyniu at pld-linux.org
Sun Apr 26 23:45:05 CEST 2009


Author: zbyniu                       Date: Sun Apr 26 21:45:05 2009 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- snap from git

---- Files affected:
SOURCES:
   kernel-aufs2.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/kernel-aufs2.patch
diff -u /dev/null SOURCES/kernel-aufs2.patch:1.1
--- /dev/null	Sun Apr 26 23:45:06 2009
+++ SOURCES/kernel-aufs2.patch	Sun Apr 26 23:44:59 2009
@@ -0,0 +1,25848 @@
+diff --git a/Documentation/ABI/testing/debugfs-aufs b/Documentation/ABI/testing/debugfs-aufs
+new file mode 100644
+index 0000000..4110b94
+--- /dev/null
++++ b/Documentation/ABI/testing/debugfs-aufs
+@@ -0,0 +1,40 @@
++What:		/debug/aufs/si_<id>/
++Date:		March 2009
++Contact:	J. R. Okajima <hooanon05 at yahoo.co.jp>
++Description:
++		Under /debug/aufs, a directory named si_<id> is created
++		per aufs mount, where <id> is a unique id generated
++		internally.
++
++What:		/debug/aufs/si_<id>/xib
++Date:		March 2009
++Contact:	J. R. Okajima <hooanon05 at yahoo.co.jp>
++Description:
++		It shows the consumed blocks by xib (External Inode Number
++		Bitmap), its block size and file size.
++		When the aufs mount option 'noxino' is specified, it
++		will be empty. About XINO files, see
++		Documentation/filesystems/aufs/aufs.5 in detail.
++
++What:		/debug/aufs/si_<id>/xino0, xino1 ... xinoN
++Date:		March 2009
++Contact:	J. R. Okajima <hooanon05 at yahoo.co.jp>
++Description:
++		It shows the consumed blocks by xino (External Inode Number
++		Translation Table), its link count, block size and file
++		size.
++		When the aufs mount option 'noxino' is specified, it
++		will be empty. About XINO files, see
++		Documentation/filesystems/aufs/aufs.5 in detail.
++
++What:		/debug/aufs/si_<id>/xigen
++Date:		March 2009
++Contact:	J. R. Okajima <hooanon05 at yahoo.co.jp>
++Description:
++		It shows the consumed blocks by xigen (External Inode
++		Generation Table), its block size and file size.
++		If CONFIG_AUFS_EXPORT is disabled, this entry will not
++		be created.
++		When the aufs mount option 'noxino' is specified, it
++		will be empty. About XINO files, see
++		Documentation/filesystems/aufs/aufs.5 in detail.
+diff --git a/Documentation/ABI/testing/sysfs-aufs b/Documentation/ABI/testing/sysfs-aufs
+new file mode 100644
+index 0000000..ca49330
+--- /dev/null
++++ b/Documentation/ABI/testing/sysfs-aufs
+@@ -0,0 +1,25 @@
++What:		/sys/fs/aufs/si_<id>/
++Date:		March 2009
++Contact:	J. R. Okajima <hooanon05 at yahoo.co.jp>
++Description:
++		Under /sys/fs/aufs, a directory named si_<id> is created
++		per aufs mount, where <id> is a unique id generated
++		internally.
++
++What:		/sys/fs/aufs/si_<id>/br0, br1 ... brN
++Date:		March 2009
++Contact:	J. R. Okajima <hooanon05 at yahoo.co.jp>
++Description:
++		It shows the abolute path of a member directory (which
++		is called branch) in aufs, and its permission.
++
++What:		/sys/fs/aufs/si_<id>/xi_path
++Date:		March 2009
++Contact:	J. R. Okajima <hooanon05 at yahoo.co.jp>
++Description:
++		It shows the abolute path of XINO (External Inode Number
++		Bitmap, Translation Table and Generation Table) file
++		even if it is the default path.
++		When the aufs mount option 'noxino' is specified, it
++		will be empty. About XINO files, see
++		Documentation/filesystems/aufs/aufs.5 in detail.
+diff --git a/Documentation/filesystems/aufs/README b/Documentation/filesystems/aufs/README
+new file mode 100644
+index 0000000..ed68e31
+--- /dev/null
++++ b/Documentation/filesystems/aufs/README
+@@ -0,0 +1,256 @@
++
++Aufs2 -- advanced multi layered unification filesystem version 2
++http://aufs.sf.net
++Junjiro R. Okajima
++
++
++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 the same
++approaches to aufs1's.
++Unionfs is being developed by Professor Erez Zadok at Stony Brook
++University and his team.
++
++This version of AUFS, aufs2 has several purposes.
++- to be reviewed easily and widely.
++- to make the source files simpler and smaller by dropping several
++  original features.
++
++Note: it becomes clear that "Aufs was rejected. Let's give it up."
++According to Christoph Hellwig, linux rejects all union-type filesystems
++but UnionMount.
++<http://marc.info/?l=linux-kernel&m=123938533724484&w=2>
++
++Through this work, I found some bad things in aufs1 source code and
++fixed them. Some of the dropped features will be reverted in the future,
++but not all I'm afraid.
++Aufs2 supports linux-2.6.27 and later. If you want older kernel version
++support, try aufs1 from CVS on SourceForge.
++
++
++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...
++
++Also there are many enhancements in aufs1, such as:
++- keep inode number by external inode number table
++- keep the timestamps of file/dir in internal copyup operation
++- seekable directory, supporting NFS readdir.
++- support mmap(2) including /proc/PID/exe symlink, without page-copy
++- whiteout is hardlinked in order to reduce the consumption of inodes
++  on branch
++- do not copyup, nor create a whiteout when it is unnecessary
++- revert a single systemcall when an error occurs in aufs
++- remount interface instead of ioctl
++- maintain /etc/mtab by an external command, /sbin/mount.aufs.
++- loopback mounted filesystem as a branch
++- kernel thread for removing the dir who has a plenty of whiteouts
++- support copyup sparse file (a file which has a 'hole' in it)
++- default permission flags for branches
++- selectable permission flags for ro branch, whether whiteout can
++  exist or not
++- export via NFS.
++- support <sysfs>/fs/aufs and <debugfs>/aufs.
++- support multiple writable branches, some policies to select one
++  among multiple writable branches.
++- a new semantics for link(2) and rename(2) to support multiple
++  writable branches.
++- no glibc changes are required.
++- pseudo hardlink (hardlink over branches)
++- allow a direct access manually to a file on branch, e.g. bypassing aufs.
++  including NFS or remote filesystem branch.
++- and more...
++
++Currently these features are dropped temporary from this version, aufs2.
++See design/08plan.txt in detail.
++- test only the highest one for the directory permission (dirperm1)
++- show whiteout mode (shwh)
++- copyup on open (coo=)
++- nested mount, i.e. aufs as readonly no-whiteout branch of another aufs
++  (robr)
++- statistics of aufs thread (/sys/fs/aufs/stat)
++- delegation mode (dlgt)
++  a delegation of the internal branch access to support task I/O
++  accounting, which also supports Linux Security Modules (LSM) mainly
++  for Suse AppArmor.
++- intent.open/create (file open in a single lookup)
++
++Features or just an idea in the future (see also design/*.txt),
++- reorder the branch index without del/re-add.
++- permanent xino files for NFSD
++- an option for refreshing the opened files after add/del branches
++- 'move' policy for copy-up between two writable branches, after
++  checking free space.
++- O_DIRECT
++- light version, without branch manipulation. (unnecessary?)
++- copyup in userspace
++- inotify in userspace
++- readv/writev
++- xattr, acl
++
++
++2. Download
++----------------------------------------
++Kindly one of aufs user, the Center for Scientific Computing and Free
++Software (C3SL), Federal University of Parana offered me a public GIT
++tree space.
++
++There are three GIT trees, aufs2-2.6, aufs2-standalone and aufs2-util.
++While the aufs2-util is always necessary, you need either of aufs2-2.6
++or aufs2-standalone.
++
++The aufs2-2.6 tree includes the whole linux-2.6 GIT tree,
++git://git.kernel.org/.../torvalds/linux-2.6.git.
++And you cannot select CONFIG_AUFS_FS=m for this version, eg. you cannot
++build aufs2 as an externel kernel module.
++If you already have linux-2.6 GIT tree, you may want to pull and merge
++the "aufs2" branch from this tree.
++
++On the other hand, the aufs2-standalone tree has only aufs2 source files
++and a necessary patch, and you can select CONFIG_AUFS_FS=m. In other
++words, the aufs2-standalone tree is generated from aufs2-2.6 tree by,
++- extract new files and modifications.
++- generate a single patch file from modifications.
++- generate a ChangeLog file from git-log.
++- commit the files newly and no log messages. this is not git-pull.
++
++Both of aufs2-2.6 and aufs2-standalone trees have a branch whose name is
++in form of "aufs2-xx" where "xx" represents the linux kernel version,
++"linux-2.6.xx".
++
++o aufs2-2.6 tree
++$ git clone --reference /your/linux-2.6/git/tree \
++	http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-2.6.git \
++	aufs2-2.6.git
++- if you don't have linux-2.6 GIT tree, then remove "--reference ..."
++$ cd aufs2-2.6.git
++$ git checkout origin/aufs2-xx	# for instance, aufs2-27 for linux-2.6.27
++				# aufs2 (no -xx) for the latest -rc version.
++
++o aufs2-standalone tree
++$ git clone http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git \
++	aufs2-standalone.git
++$ cd aufs2-standalone.git
++$ git checkout origin/aufs2-xx	# for instance, aufs2-27 for linux-2.6.27
++				# aufs2 (no -xx) for the latest -rc version.
++- apply "aufs2-standalone.patch" to your kernel source files.
++
++o aufs2-util tree
++$ git clone http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-util.git \
++	aufs2-util.git
++$ cd aufs2-util.git
++- no particular tag/branch currently.
++
++
++3. Configuration and Compilation
++----------------------------------------
++For aufs2-2.6 tree,
++- enable CONFIG_EXPERIMENTAL and CONFIG_AUFS_FS.
++- set other aufs configurations if necessary.
++
++For aufs2-standalone tree,
++- enable CONFIG_EXPERIMENTAL and CONFIG_AUFS_FS, you can select =m.
++- edit fs/aufs/config.mk and set other aufs configurations if necessary.
++
++And then,
++- build your kernel (or a module) by "make"
++- install it and reboot your system
++- read README in aufs2-util, build and install it
++
++
++4. Usage
++----------------------------------------
++At first, make sure aufs2-util are installed, and please read the aufs
++manual, ./Documentation/filesystems/aufs/aufs.5.
++$ man -l aufs.5
++
++And then,
++$ mkdir /tmp/rw /tmp/aufs
++# mount -t aufs -o br=/tmp/rw:${HOME}=ro none /tmp/aufs
++
++Here is another example. The result is equivalent.
++# mount -t aufs -o br=/tmp/rw:${HOME} none /tmp/aufs
++  Or
++# mount -t aufs -o br:/tmp/rw none /tmp/aufs
++# mount -o remount,append:${HOME} /tmp/aufs
++
++Then, you can see whole tree of your home dir through /tmp/aufs. If
++you modify a file under /tmp/aufs, the one on your home directory is
++not affected, instead the same named file will be newly created under
++/tmp/rw. And all of your modification to a file will be applied to
++the one under /tmp/rw. This is called the file based Copy on Write
++(COW) method.
++Aufs mount options are described in aufs.5.
++
++Additionally, there are some sample usages of aufs which are a
++diskless system with network booting, and LiveCD over NFS.
++See sample dir in CVS tree on SourceForge.
++
++
++5. Contact
++----------------------------------------
++When you have any problems or strange behaviour in aufs, please let me
++know with:
++- /proc/mounts (instead of the output of mount(8))
++- /sys/module/aufs/*
++- /sys/fs/aufs/* (if you have them)
++- /debug/aufs/* (if you have them)
++- linux kernel version
++  if your kernel is not plain, for example modified by distributor,
++  the url where i can download its source is necessary too.
++- aufs version which was printed at loading the module or booting the
++  system, instead of the date you downloaded.
++- configuration (define/undefine CONFIG_AUFS_xxx)
++- kernel configuration or /proc/config.gz (if you have it)
++- behaviour which you think to be incorrect
++- actual operation, reproducible one is better
++- mailto: aufs-users at lists.sourceforge.net
++
++Usually, I don't watch the Public Areas(Bugs, Support Requests, Patches,
++and Feature Requests) on SourceForge. Please join and write to
++aufs-users ML.
++
++
++6. Acknowledgements
++----------------------------------------
++Thanks to everyone who have tried and are using aufs, whoever
++have reported a bug or any feedback.
++
++Especially donors:
++Tomas Matejicek(slax.org) made a donation (much more than once).
++Dai Itasaka made a donation (2007/8).
++Chuck Smith made a donation (2008/4, 10 and 12).
++Henk Schoneveld made a donation (2008/9).
++Chih-Wei Huang, ASUS, CTC donated Eee PC 4G (2008/10).
++Francois Dupoux made a donation (2008/11).
++Bruno Cesar Ribas and Luis Carlos Erpen de Bona, C3SL serves public GIT
++tree (2009/2).
++William Grant made a donation (2009/3).
++
++Thank you very much.
++Donations are always, including future donations, very important and
++helpful for me to keep on developing aufs.
++
++
++7.
++----------------------------------------
++If you are an experienced user, no explanation is needed. Aufs is
++just a linux filesystem.
++
++
++Enjoy!
++
++# Local variables: ;
++# mode: text;
++# End: ;
+diff --git a/Documentation/filesystems/aufs/aufs.5 b/Documentation/filesystems/aufs/aufs.5
+new file mode 100644
+index 0000000..0b9732f
+--- /dev/null
++++ b/Documentation/filesystems/aufs/aufs.5
+@@ -0,0 +1,1681 @@
++.ds AUFS_VERSION aufs2
++.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_BASE .wh..wh.aufs
++.ds AUFS_WH_PLINKDIR .wh..wh.plnk
++.ds AUFS_BRANCH_MAX 127
++.ds AUFS_MFS_SECOND_DEF 30
++.ds AUFS_RDBLK_DEF 512
++.ds AUFS_RDHASH_DEF 32
++.\".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 \- advanced multi layered unification filesystem. 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 and udba=inotify
++.Bu
++branches
++.Bu
++xino/noxino
++.Bu
++udba=inotify
++.RE
++
++At remount-time,
++the options are interpreted in the given order,
++e.g. left to right.
++.RS
++.Bu
++create or remove
++whiteout-base(\*[AUFS_WH_BASE]) and
++whplink-dir(\*[AUFS_WH_PLINKDIR]) if necessary
++.RE
++.
++.TP
++.B br:BRANCH[:BRANCH ...] (dirs=BRANCH[:BRANCH ...])
++Adds new branches.
++(cf. Branch Syntax).
++
++Aufs rejects the branch which is an ancestor or a descendant of another
++branch. It is called overlapped. When the branch is loopback-mounted
++directory, aufs also checks the source fs-image file of loopback
++device. If the source file is a descendant of another branch, it will
++be rejected too.
++
++After mounting aufs or adding a branch, if you move a branch under
++another branch and make it descendant of another branch, aufs will not
++work correctly.
++.
++.TP
++.B [ add | ins ]:index:BRANCH
++Adds a new branch.
++The index begins with 0.
++Aufs creates
++whiteout-base(\*[AUFS_WH_BASE]) and
++whplink-dir(\*[AUFS_WH_PLINKDIR]) if necessary.
++
++If there is the same named file on the lower branch (larger index),
++aufs will hide the lower file.
++You can only see the highest file.
++You will be confused if the added branch has whiteouts (including
++diropq), they may or may not hide the lower entries.
++.\" It is recommended to make sure that the added branch has no whiteout.
++
++Even if a process have once mapped a file by mmap(2) with MAP_SHARED
++and the same named file exists on the lower branch,
++the process still refers the file on the lower(hidden)
++branch after adding the branch.
++If you want to update the contents of a process address space after
++adding, you need to restart your process or open/mmap the file again.
++.\" Usually, such files are executables or shared libraries.
++(cf. Branch Syntax).
++.
++.TP
++.B del:dir
++Removes a branch.
++Aufs does not remove
++whiteout-base(\*[AUFS_WH_BASE]) and
++whplink-dir(\*[AUFS_WH_PLINKDIR]) automatically.
++For example, when you add a RO branch which was unified as RW, you
++will see whiteout-base or whplink-dir on the added RO branch.
++
++If a process is referencing the file/directory on the deleting branch
++(by open, mmap, current working directory, etc.), aufs will return an
++error EBUSY.
++.
++.TP
++.B mod:BRANCH
++Modifies the permission flags of the branch.
++Aufs creates or removes
++whiteout-base(\*[AUFS_WH_BASE]) and/or
++whplink-dir(\*[AUFS_WH_PLINKDIR]) if necessary.
++
++If the branch permission is been changing \[oq]rw\[cq] to \[oq]ro\[cq], and a process
++is mapping a file by mmap(2)
++.\" with MAP_SHARED
++on the branch, the process may or may not
++be able to modify its mapped memory region after modifying branch
++permission flags.
++(cf. Branch Syntax).
++.
++.TP
++.B append:BRANCH
++equivalent to \[oq]add:(last index + 1):BRANCH\[cq].
++(cf. Branch Syntax).
++.
++.TP
++.B prepend:BRANCH
++equivalent to \[oq]add:0:BRANCH.\[cq]
++(cf. Branch Syntax).
++.
++.TP
++.B xino=filename
++Use external inode number bitmap and translation table.
++When CONFIG_AUFS_EXPORT is enabled, external inode generation table too.
++It is set to
++<FirstWritableBranch>/\*[AUFS_XINO_FNAME] by default, or
++\*[AUFS_XINO_DEFPATH].
++Comma character in filename is not allowed.
++
++The files are created per an aufs and per a branch filesystem, and
++unlinked. So you
++cannot find this file, but it exists and is read/written frequently by
++aufs.
++(cf. External Inode Number Bitmap, Translation Table and Generation Table).
++
++If you enable CONFIG_SYSFS, the path of xino files are not shown in
++/proc/mounts (and /etc/mtab), instead it is shown in
++<sysfs>/fs/aufs/si_<id>/xi_path.
++Otherwise, it is shown in /proc/mounts unless it is not the default
++path.
++.
++.TP
++.B noxino
++Stop using external inode number bitmap and translation table.
++
++If you use this option,
++Some applications will not work correctly.
++.\" And pseudo link feature will not work after the inode cache is
++.\" shrunk.
++(cf. External Inode Number Bitmap, Translation Table and Generation Table).
++.
++.TP
++.B trunc_xib
++Truncate the external inode number bitmap file. The truncation is done
++automatically when you delete a branch unless you do not specify
++\[oq]notrunc_xib\[cq] option.
++(cf. External Inode Number Bitmap, Translation Table and Generation Table).
++.
++.TP
++.B notrunc_xib
++Stop truncating the external inode number bitmap file when you delete
++a branch.
++(cf. External Inode Number Bitmap, Translation Table and Generation Table).
++.
++.TP
++.B create_policy | create=CREATE_POLICY
++.TQ
++.B copyup_policy | copyup | cpup=COPYUP_POLICY
++Policies to select one among multiple writable branches. The default
++values are \[oq]create=tdp\[cq] and \[oq]cpup=tdp\[cq].
++link(2) and rename(2) systemcalls have an exception. In aufs, they
++try keeping their operations in the branch where the source exists.
++(cf. Policies to Select One among Multiple Writable Branches).
++.
++.TP
++.B verbose | v
++Print some information.
++Currently, it is only busy file (or inode) at deleting a branch.
++.
++.TP
++.B noverbose | quiet | q | silent
++Disable \[oq]verbose\[cq] option.
++This is default value.
++.
++.TP
++.B sum
++df(1)/statfs(2) returns the total number of blocks and inodes of
++all branches.
++Note that there are cases that systemcalls may return ENOSPC, even if
++df(1)/statfs(2) shows that aufs has some free space/inode.
++.
++.TP
++.B nosum
++Disable \[oq]sum\[cq] option.
++This is default value.
++.
++.TP
++.B dirwh=N
++Watermark to remove a dir actually at rmdir(2) and rename(2).
++
++If the target dir which is being removed or renamed (destination dir)
++has a huge number of whiteouts, i.e. the dir is empty logically but
++physically, the cost to remove/rename the single
++dir may be very high.
++It is
++required to unlink all of whiteouts internally before issuing
++rmdir/rename to the branch.
++To reduce the cost of single systemcall,
++aufs renames the target dir to a whiteout-ed temporary name and
++invokes a pre-created
++kernel thread to remove whiteout-ed children and the target dir.
++The rmdir/rename systemcall returns just after kicking the thread.
++
++When the number of whiteout-ed children is less than the value of
++dirwh, aufs remove them in a single systemcall instead of passing
++another thread.
++This value is ignored when the branch is NFS.
++The default value is \*[AUFS_DIRWH_DEF].
++.\" .
<<Diff was trimmed, longer than 597 lines>>


More information about the pld-cvs-commit mailing list