[PATCH 08/23] nilfs2: split out nilfs_get_root_dentry

2010-09-13 Thread Ryusuke Konishi
This splits the code to allocate root dentry into a separate routine for convenience in successive changes. Signed-off-by: Ryusuke Konishi konishi.ryus...@lab.ntt.co.jp --- fs/nilfs2/super.c | 54 ++-- 1 files changed, 35 insertions(+), 19

[PATCH 20/23] nilfs2: see state of root dentry for mount check of snapshots

2010-09-13 Thread Ryusuke Konishi
After applied the patch that unified sb instances, root dentry of snapshots can be left in dcache even after their trees are unmounted. The orphan root dentry/inode keeps a root object, and this causes false positive of nilfs_checkpoint_is_mounted function. This resolves the issue by having

[PATCH 22/23] nilfs2: get rid of back pointer to writable sb instance

2010-09-13 Thread Ryusuke Konishi
Nilfs object holds a back pointer to a writable super block instance in nilfs-ns_writer, and this became eliminable since sb is now made per device and all inodes have a valid pointer to it. This deletes the ns_writer pointer and a reader/writer semaphore protecting it. Signed-off-by: Ryusuke

[PATCH 13/23] nilfs2: allow nilfs_clear_inode to clear metadata file inodes

2010-09-13 Thread Ryusuke Konishi
Allows clear inode function (nilfs_clear_inode) to handle metadata files that uses bitmap-based object alloctor. DAT and ifile correspond to this. Signed-off-by: Ryusuke Konishi konishi.ryus...@lab.ntt.co.jp --- fs/nilfs2/inode.c |4 1 files changed, 4 insertions(+), 0 deletions(-)

[PATCH 21/23] nilfs2: get rid of mi_nilfs back pointer to nilfs object

2010-09-13 Thread Ryusuke Konishi
This removes a back pointer to nilfs object from nilfs_mdt_info structure that is attached to metadata files. Signed-off-by: Ryusuke Konishi konishi.ryus...@lab.ntt.co.jp --- fs/nilfs2/mdt.c|9 +++-- fs/nilfs2/mdt.h|8 ++-- fs/nilfs2/sufile.c |4 ++--

[PATCH 05/23] nilfs2: move inode count and block count into root object

2010-09-13 Thread Ryusuke Konishi
This moves sbi-s_inodes_count and sbi-s_blocks_count into nilfs_root object. Signed-off-by: Ryusuke Konishi konishi.ryus...@lab.ntt.co.jp --- fs/nilfs2/inode.c |4 ++-- fs/nilfs2/sb.h |2 -- fs/nilfs2/segment.c |4 ++-- fs/nilfs2/super.c | 11 ++- 4 files changed,

[PATCH 02/23] nilfs2: set pointer to root object in inodes

2010-09-13 Thread Ryusuke Konishi
This puts a pointer to nilfs_root object in the private part of on-memory inode, and makes nilfs_iget function pick up the inode with the same root object. Non-root inodes inherit its nilfs_root object from parent inode. That of the root inode is allocated through nilfs_attach_checkpoint()

[PATCH 19/23] nilfs2: use iget for all metadata files

2010-09-13 Thread Ryusuke Konishi
This makes use of iget5_locked to allocate or get inode for metadata files to stop using own inode allocator. Signed-off-by: Ryusuke Konishi konishi.ryus...@lab.ntt.co.jp --- fs/nilfs2/cpfile.c| 49 + fs/nilfs2/cpfile.h|4 +- fs/nilfs2/dat.c |

[PATCH 23/23] nilfs2: remove own inode allocator and destructor for metadata files

2010-09-13 Thread Ryusuke Konishi
This finally removes own inode allocator and destructor functions for metadata files. Several routines, nilfs_mdt_new(), nilfs_mdt_new_common(), nilfs_mdt_clear(), nilfs_mdt_destroy(), and nilfs_alloc_inode_common() will be gone. Signed-off-by: Ryusuke Konishi konishi.ryus...@lab.ntt.co.jp ---

[PATCH 17/23] nilfs2: add routines to redirect access to buffers of DAT file

2010-09-13 Thread Ryusuke Konishi
During garbage collection (GC), DAT file, which converts virtual block number to real block number, may return disk block number that is not yet written to the device. To avoid access to unwritten blocks, the current implementation stores changes to the caches of GCDAT during GC and atomically

[PATCH 07/23] nilfs2: deny write access to inodes in snapshots

2010-09-13 Thread Ryusuke Konishi
Snapshots of nilfs are read-only. After super block instances (sb) will be unified, nilfs will need to check write access by a way other than implicit test with IS_RDONLY(inode). This is because IS_RDONLY() refers to MS_RDONLY bit of inode-i_sb-s_flags and it will become inaccurate after the

[PATCH 03/23] nilfs2: make snapshots in checkpoint tree exportable

2010-09-13 Thread Ryusuke Konishi
The previous export operations cannot handle multiple versions of a filesystem if they belong to the same sb instance. This adds a new type of file handle and extends export operations so that they can get the inode specified by a checkpoint number as well as an inode number and a generation

[PATCH 16/23] nilfs2: add routines to roll back state of DAT file

2010-09-13 Thread Ryusuke Konishi
This adds optional function to metadata files which makes a copy of bmap, page caches, and b-tree node cache, and rolls back to the copy as needed. This enhancement is intended to displace gcdat inode that provides a similar function in a different way. In this patch, nilfs_shadow_map structure