diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2010-09-04 23:20:59 -0400 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2010-10-22 20:24:38 -0400 |
commit | f1e89c86fdd0f5e59f6768146c86437934202033 (patch) | |
tree | c5ba8766a3a029f0c10d6d0d09a57a7e28b7a51b /fs/nilfs2/super.c | |
parent | c1c1d7092072093ad960db2f6c08f06705c57fa4 (diff) |
nilfs2: use iget for all metadata files
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.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/super.c')
-rw-r--r-- | fs/nilfs2/super.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index 5893cb27c909..39e7d7f8eda0 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c | |||
@@ -356,6 +356,10 @@ static void nilfs_put_super(struct super_block *sb) | |||
356 | up_write(&nilfs->ns_sem); | 356 | up_write(&nilfs->ns_sem); |
357 | } | 357 | } |
358 | 358 | ||
359 | iput(nilfs->ns_sufile); | ||
360 | iput(nilfs->ns_cpfile); | ||
361 | iput(nilfs->ns_dat); | ||
362 | |||
359 | destroy_nilfs(nilfs); | 363 | destroy_nilfs(nilfs); |
360 | sbi->s_super = NULL; | 364 | sbi->s_super = NULL; |
361 | sb->s_fs_info = NULL; | 365 | sb->s_fs_info = NULL; |
@@ -403,10 +407,6 @@ int nilfs_attach_checkpoint(struct nilfs_sb_info *sbi, __u64 cno, int curr_mnt, | |||
403 | if (root->ifile) | 407 | if (root->ifile) |
404 | goto reuse; /* already attached checkpoint */ | 408 | goto reuse; /* already attached checkpoint */ |
405 | 409 | ||
406 | root->ifile = nilfs_ifile_new(sbi, nilfs->ns_inode_size); | ||
407 | if (!root->ifile) | ||
408 | goto failed; | ||
409 | |||
410 | down_read(&nilfs->ns_segctor_sem); | 410 | down_read(&nilfs->ns_segctor_sem); |
411 | err = nilfs_cpfile_get_checkpoint(nilfs->ns_cpfile, cno, 0, &raw_cp, | 411 | err = nilfs_cpfile_get_checkpoint(nilfs->ns_cpfile, cno, 0, &raw_cp, |
412 | &bh_cp); | 412 | &bh_cp); |
@@ -421,8 +421,10 @@ int nilfs_attach_checkpoint(struct nilfs_sb_info *sbi, __u64 cno, int curr_mnt, | |||
421 | } | 421 | } |
422 | goto failed; | 422 | goto failed; |
423 | } | 423 | } |
424 | err = nilfs_read_inode_common(root->ifile, &raw_cp->cp_ifile_inode); | 424 | |
425 | if (unlikely(err)) | 425 | err = nilfs_ifile_read(sbi->s_super, root, nilfs->ns_inode_size, |
426 | &raw_cp->cp_ifile_inode, &root->ifile); | ||
427 | if (err) | ||
426 | goto failed_bh; | 428 | goto failed_bh; |
427 | 429 | ||
428 | atomic_set(&root->inodes_count, le64_to_cpu(raw_cp->cp_inodes_count)); | 430 | atomic_set(&root->inodes_count, le64_to_cpu(raw_cp->cp_inodes_count)); |
@@ -895,7 +897,7 @@ nilfs_fill_super(struct super_block *sb, void *data, int silent) | |||
895 | if (err) { | 897 | if (err) { |
896 | printk(KERN_ERR "NILFS: error loading last checkpoint " | 898 | printk(KERN_ERR "NILFS: error loading last checkpoint " |
897 | "(checkpoint number=%llu).\n", (unsigned long long)cno); | 899 | "(checkpoint number=%llu).\n", (unsigned long long)cno); |
898 | goto failed_nilfs; | 900 | goto failed_unload; |
899 | } | 901 | } |
900 | 902 | ||
901 | if (!(sb->s_flags & MS_RDONLY)) { | 903 | if (!(sb->s_flags & MS_RDONLY)) { |
@@ -924,6 +926,11 @@ nilfs_fill_super(struct super_block *sb, void *data, int silent) | |||
924 | failed_checkpoint: | 926 | failed_checkpoint: |
925 | nilfs_put_root(fsroot); | 927 | nilfs_put_root(fsroot); |
926 | 928 | ||
929 | failed_unload: | ||
930 | iput(nilfs->ns_sufile); | ||
931 | iput(nilfs->ns_cpfile); | ||
932 | iput(nilfs->ns_dat); | ||
933 | |||
927 | failed_nilfs: | 934 | failed_nilfs: |
928 | destroy_nilfs(nilfs); | 935 | destroy_nilfs(nilfs); |
929 | 936 | ||