diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2011-03-08 21:05:08 -0500 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2011-03-08 21:54:26 -0500 |
commit | e3154e9748f0f337e9f6ff9dc7d7bf24d426bd1a (patch) | |
tree | ac2a3f3dca6189b8a608571c49da66386fd1bdec /fs/nilfs2/inode.c | |
parent | f7545144c2e3d280139260df934043e0a6ccce6f (diff) |
nilfs2: get rid of nilfs_sb_info structure
This directly uses sb->s_fs_info to keep a nilfs filesystem object and
fully removes the intermediate nilfs_sb_info structure. With this
change, the hierarchy of on-memory structures of nilfs will be
simplified as follows:
Before:
super_block
-> nilfs_sb_info
-> the_nilfs
-> cptree --+-> nilfs_root (current file system)
+-> nilfs_root (snapshot A)
+-> nilfs_root (snapshot B)
:
-> nilfs_sc_info (log writer structure)
After:
super_block
-> the_nilfs
-> cptree --+-> nilfs_root (current file system)
+-> nilfs_root (snapshot A)
+-> nilfs_root (snapshot B)
:
-> nilfs_sc_info (log writer structure)
The reason why we didn't design so from the beginning is because the
initial shape also differed from the above. The early hierachy was
composed of "per-mount-point" super_block -> nilfs_sb_info pairs and a
shared nilfs object. On the kernel 2.6.37, it was changed to the
current shape in order to unify super block instances into one per
device, and this cleanup became applicable as the result.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/inode.c')
-rw-r--r-- | fs/nilfs2/inode.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c index 7a3dbe4f229c..d5625be236a8 100644 --- a/fs/nilfs2/inode.c +++ b/fs/nilfs2/inode.c | |||
@@ -295,7 +295,7 @@ const struct address_space_operations nilfs_aops = { | |||
295 | struct inode *nilfs_new_inode(struct inode *dir, int mode) | 295 | struct inode *nilfs_new_inode(struct inode *dir, int mode) |
296 | { | 296 | { |
297 | struct super_block *sb = dir->i_sb; | 297 | struct super_block *sb = dir->i_sb; |
298 | struct the_nilfs *nilfs = NILFS_SB(sb)->s_nilfs; | 298 | struct the_nilfs *nilfs = sb->s_fs_info; |
299 | struct inode *inode; | 299 | struct inode *inode; |
300 | struct nilfs_inode_info *ii; | 300 | struct nilfs_inode_info *ii; |
301 | struct nilfs_root *root; | 301 | struct nilfs_root *root; |
@@ -433,7 +433,7 @@ static int __nilfs_read_inode(struct super_block *sb, | |||
433 | struct nilfs_root *root, unsigned long ino, | 433 | struct nilfs_root *root, unsigned long ino, |
434 | struct inode *inode) | 434 | struct inode *inode) |
435 | { | 435 | { |
436 | struct the_nilfs *nilfs = NILFS_SB(sb)->s_nilfs; | 436 | struct the_nilfs *nilfs = sb->s_fs_info; |
437 | struct buffer_head *bh; | 437 | struct buffer_head *bh; |
438 | struct nilfs_inode *raw_inode; | 438 | struct nilfs_inode *raw_inode; |
439 | int err; | 439 | int err; |
@@ -807,7 +807,7 @@ int nilfs_permission(struct inode *inode, int mask, unsigned int flags) | |||
807 | 807 | ||
808 | int nilfs_load_inode_block(struct inode *inode, struct buffer_head **pbh) | 808 | int nilfs_load_inode_block(struct inode *inode, struct buffer_head **pbh) |
809 | { | 809 | { |
810 | struct the_nilfs *nilfs = NILFS_SB(inode->i_sb)->s_nilfs; | 810 | struct the_nilfs *nilfs = inode->i_sb->s_fs_info; |
811 | struct nilfs_inode_info *ii = NILFS_I(inode); | 811 | struct nilfs_inode_info *ii = NILFS_I(inode); |
812 | int err; | 812 | int err; |
813 | 813 | ||
@@ -836,7 +836,7 @@ int nilfs_load_inode_block(struct inode *inode, struct buffer_head **pbh) | |||
836 | int nilfs_inode_dirty(struct inode *inode) | 836 | int nilfs_inode_dirty(struct inode *inode) |
837 | { | 837 | { |
838 | struct nilfs_inode_info *ii = NILFS_I(inode); | 838 | struct nilfs_inode_info *ii = NILFS_I(inode); |
839 | struct the_nilfs *nilfs = NILFS_SB(inode->i_sb)->s_nilfs; | 839 | struct the_nilfs *nilfs = inode->i_sb->s_fs_info; |
840 | int ret = 0; | 840 | int ret = 0; |
841 | 841 | ||
842 | if (!list_empty(&ii->i_dirty)) { | 842 | if (!list_empty(&ii->i_dirty)) { |
@@ -851,7 +851,7 @@ int nilfs_inode_dirty(struct inode *inode) | |||
851 | int nilfs_set_file_dirty(struct inode *inode, unsigned nr_dirty) | 851 | int nilfs_set_file_dirty(struct inode *inode, unsigned nr_dirty) |
852 | { | 852 | { |
853 | struct nilfs_inode_info *ii = NILFS_I(inode); | 853 | struct nilfs_inode_info *ii = NILFS_I(inode); |
854 | struct the_nilfs *nilfs = NILFS_SB(inode->i_sb)->s_nilfs; | 854 | struct the_nilfs *nilfs = inode->i_sb->s_fs_info; |
855 | 855 | ||
856 | atomic_add(nr_dirty, &nilfs->ns_ndirtyblks); | 856 | atomic_add(nr_dirty, &nilfs->ns_ndirtyblks); |
857 | 857 | ||