summaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/mdt.c
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-09-05 05:20:59 +0200
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-10-23 02:24:38 +0200
commitf1e89c86fdd0f5e59f6768146c86437934202033 (patch)
treec5ba8766a3a029f0c10d6d0d09a57a7e28b7a51b /fs/nilfs2/mdt.c
parentnilfs2: get rid of GCDAT inode (diff)
downloadlinux-f1e89c86fdd0f5e59f6768146c86437934202033.tar.xz
linux-f1e89c86fdd0f5e59f6768146c86437934202033.zip
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/mdt.c')
-rw-r--r--fs/nilfs2/mdt.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/nilfs2/mdt.c b/fs/nilfs2/mdt.c
index 3bbd340a5136..44326cfe1fa9 100644
--- a/fs/nilfs2/mdt.c
+++ b/fs/nilfs2/mdt.c
@@ -444,8 +444,7 @@ static const struct inode_operations def_mdt_iops;
static const struct file_operations def_mdt_fops;
-int nilfs_mdt_init(struct inode *inode, struct the_nilfs *nilfs,
- gfp_t gfp_mask, size_t objsz)
+int nilfs_mdt_init(struct inode *inode, gfp_t gfp_mask, size_t objsz)
{
struct nilfs_mdt_info *mi;
@@ -453,13 +452,17 @@ int nilfs_mdt_init(struct inode *inode, struct the_nilfs *nilfs,
if (!mi)
return -ENOMEM;
- mi->mi_nilfs = nilfs;
+ mi->mi_nilfs = NILFS_I_NILFS(inode);
init_rwsem(&mi->mi_sem);
inode->i_private = mi;
inode->i_mode = S_IFREG;
mapping_set_gfp_mask(inode->i_mapping, gfp_mask);
- inode->i_mapping->backing_dev_info = nilfs->ns_bdi;
+ inode->i_mapping->backing_dev_info = inode->i_sb->s_bdi;
+
+ inode->i_op = &def_mdt_iops;
+ inode->i_fop = &def_mdt_fops;
+ inode->i_mapping->a_ops = &def_mdt_aops;
return 0;
}
@@ -544,13 +547,10 @@ struct inode *nilfs_mdt_new(struct the_nilfs *nilfs, struct super_block *sb,
if (!inode)
return NULL;
- if (nilfs_mdt_init(inode, nilfs, NILFS_MDT_GFP, objsz) < 0) {
+ if (nilfs_mdt_init(inode, NILFS_MDT_GFP, objsz) < 0) {
nilfs_destroy_inode(inode);
return NULL;
}
- inode->i_op = &def_mdt_iops;
- inode->i_fop = &def_mdt_fops;
- inode->i_mapping->a_ops = &def_mdt_aops;
return inode;
}