- 09 Mar, 2019 40 commits
-
-
J. R. Okajima authored
Implement i_op->rename(). This is a big monster and I don't like it. In this version, the copy-up always happen. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Implement i_op->rename(). This is a big monster and I don't like it. In order to call d_move() in aufs lock section, FS_RENAME_DOES_D_MOVE is set to fstype.f_flags. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Implement i_op->rmdir() with supporting logical deletion by whiteout including all children. As struct.txt in previous commit described, the target dir is renamed to a whiteout-ed temporary unique name in rmdir(2), and then removed asynchronously by the system global workqueue. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Implement i_op->unlink() with supporting logical deletion by whiteout. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Here are entry adding inode operations, i_op->create(), symlink(), mkdir(), mknod(), and tmpfile(). Obviously they return EOPNOTSUPP when the target branch fs doesn't support the operation. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Implement dir.i_op->get_link(). I am afraid there may exist the case skipping updating the inode atime. It means the aufs inode atime may be reverted by the real fs inode atime silently. But I don't think it a big problem. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Implement dir.i_op->lookup() and ->permission(). Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Optimize out ->d_revalidate() if possible. If the refreshing failed, then ->d_revalidate() remains. In this case, aufs has two types of dentries. One has ->d_revalidate, the other doesn't. I am afraid it will confuse me someday. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Implement d_op->d_revalidate(). This is another core part of UDBA (cf. lookup.txt in another commit). Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Implement basic sb_op->show_options(), statfs() and sync_fs() simply. - show_options() doesn't print the default values (AuOpt_Def). - statfs() will have an option to summarize the numbers from branches (in later commit). Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Call the functions in previous commits to refresh all. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Maintain the internal array including corresponding XINO file and sysfs entries. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
As a part of branch-management, aufs maintains all cached inodes, dentries, and opened files in remounting. This commits handles the opened files by counting the number of them, generating an array of their pointers. I don't like such array approach, but I don't have another idea. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
As a part of branch-management, aufs maintains all cached inodes, dentries, and opened files in remounting. This commits handles the cached dentries by calling the VFS internal function d_walk(). Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
As a part of branch-management, aufs maintains all cached inodes, dentries, and opened files in remounting. This commits handles the cached inodes by counting the number of cached inodes, generating an array of their pointers. I don't like such array approach, but I don't have another idea. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
It is hard to implement readdir(3) for aufs virtual directory. It considers the every whiteout in a single direcotry, as well as the (first) opaque marker (diropq). This implementation consumes memory a lot, and I'd suggest you to try RDU (readdir in userspace) in later commit. See also the document in previous commit. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
This commit is just to prepare for the succeeding commit, and split to suppress the size of a single commit. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Expand finfo to support for a directory. For readdir(3), see VDIR and RDU in later commits. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
The structure is very similar to iinfo and dinfo (in previous commits). This commit is for non-dir files. For a directory, see later commit. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
As a part of looking-up, construct a virtual inode. After branch-management (add/del branches), the inode has to be refreshed to represent a revealed file. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Now aufs becomes mountable with very few features. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
In order to prevent firing the notify event from aufs itself, hnotify feature is suspend/resume-able. They are combined with mutex lock/unlock for the parent dir. See also previous commits. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
The feature is constructed by two layers. One is generic interface, and the other is exact implementation. This is rather historical. Originally aufs implemented this feature based upon 'inotify.' Later 'fsnotify' made 'inotify' obsolete. During the transition period, these two layers were introduced to support both of 'inotify' and 'fsnotify.' Currently only 'fsnotify' is supported, but the layers are kept for the future use. This feature is compiled only when CONFIG_AUFS_HNOTIFY is enabled. See also the document in previous commit. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
This is the hardest test to support UDBA (users' direct branch access). It uses 'fsnotify' internally. Detecting UDBA, decrements the generation of the cached aufs objects. In the next access to the file, aufs detects the generation is obsoleted and tries refreshing it. Eventually aufs cache will be updated to latest status. The fsnotify is set on the cached dirs on the non-RR branches. The RR (real readonly) branches will never be modified and it is unnecessary to set fsnotify for them. This commit is for the declarations mainly, and the body parts will be in succeeding commits. This feature is compiled only when CONFIG_AUFS_HNOTIFY is enabled. See also the document in this commit. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
The main part is in previous commit. This commit handles the generation of aufs objects, to make sure the inode in the file handle is still valid. In order not to confuse NFSD, the various operation returns ESTALE for NFSD where it used to return EBUSY. See also the document in this commit. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Implement exporting via NFS. The file handle is rather large (40 bytes at most + the file handle on a branch). The non-virtual filesystems can use an anonymous (disconnected) dentry as long as the inode is identified, but aufs needs a dentry with dinfo which is usually constructed. So aufs has to find or generate the normal dentry from the file handle in decoding. Eg. in aufs, there should never be the anonymous dentry. In decoding the file handle, if both of the dentry and the inode which are corresponding the file handle are still in cache, then they are returned immediately. Otherwise aufs has to find the cached parent dir from the file handle. If the parent dir is not cached either, the aufs tries these steps. - decode the branch fs's file handle and get the parent dir - generate the path of the parent dir on the branch - convert the branch path to aufs's path - lookup the inode number under the aufs' path The last one is the slowest case. exportfs_decode_fh() (actually reconnect_path()) acquires mutex, and this behaviour violates the locking order between aufs si_rwsem. This is not a problem since internal exportfs_decode_fh() is called for the branch fs. Simply use lockdep_off/on to silence the lockdep message. See also the document in later commit. This is compiled only when CONFIG_AUFS_EXPORT is enabled. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
As a result of branch management, the virtual inode may point a different real inode from it used to. And aufs has to maintain its address_space_operations, since its definition may affect the behaviour. I know some people (including grsec-patch) doesn't like a non-const address_space_operations, but in order to keep the consistency of the behaviour, the correct address_space_operations is important. See also the document in this commit. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Aufs allows users' direct branch access (UDBA), ie. by-passing aufs. Of course it will make aufs inode/dentry-caches obsolete. In order to detect such change by the several tests, "udba=" option is introduced. For details, see lookup.txt in later commit. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Several policies to select one among multiple writable branches. See also the document in previous commit. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Aufs can have multiple writable branches, and there are several policies to select one among them. This commit implements default "top-down-parent" for both of creating-policy and copyup-policy. See also the document in this commit. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Imagine a sequence such like this. - user opens a file which exists on the lower readonly branch. - user unlinks the file (still opened). its parent dir may be removed too. - user writes something to the file. Then aufs has to copy-up the unlinked file. Note that the copy-up in aufs is not done in open(2) by default. This commit handles this case by copy-up the file in write(2). The target directory is the one which aufs created internally for this purpose. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Copy-up the ancestors of the target. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Because the copy-up operation is big and has many parameters and functions, consolidate them in this commit. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
The functions for - create the copy-up target file - copy filedata - copy metadata In copying filedata, I had tried splice_direct() instead of repeating read/write. Surprisingly, I could not see a big difference. So let's keep this approach for a while. Someday SEEK_DATA/SEEK_HOLE become more popular, it may help optimizing this read/write. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
The internal file read/write for copy-up in kernelspace. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Basically copy-up is done by these steps using au_pin (in another commit). - lock the target parent mutex - lookup a negative dentry with a whiteout-ed temporary unique name - create it - unlock the target parent mutex - copy filedata - copy metadata (inode attributes) - lock the target parent mutex - rename the temporary name to the target name - unlock the target parent mutex This commit contains step2 mainly. I hope someday aufs uses O_TMPFILE for this. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Copy the inode attributes between branches. See also the document in this commit. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
To create/delete/rename files including copy-up, aufs acquires several locks on the branch fs internally. These lock/unlock operations are consolidated into struct au_pin in this commit. au_pin handles - LOCKDEP class - re-validate/verify - suspend/resume HNOTIFY See also lookup.txt in later commit. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
Some filesystems are natively readonly. And aufs can make a few optimization for them. This new attribute tells aufs. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-
J. R. Okajima authored
The functions to create/delete the opaque directory marker (called 'diropq') on the added writable branch. For details, refer to previous commit. Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
-