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/mdt.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/mdt.c')
-rw-r--r-- | fs/nilfs2/mdt.c | 16 |
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; | |||
444 | static const struct file_operations def_mdt_fops; | 444 | static const struct file_operations def_mdt_fops; |
445 | 445 | ||
446 | 446 | ||
447 | int nilfs_mdt_init(struct inode *inode, struct the_nilfs *nilfs, | 447 | int nilfs_mdt_init(struct inode *inode, gfp_t gfp_mask, size_t objsz) |
448 | gfp_t gfp_mask, size_t objsz) | ||
449 | { | 448 | { |
450 | struct nilfs_mdt_info *mi; | 449 | struct nilfs_mdt_info *mi; |
451 | 450 | ||
@@ -453,13 +452,17 @@ int nilfs_mdt_init(struct inode *inode, struct the_nilfs *nilfs, | |||
453 | if (!mi) | 452 | if (!mi) |
454 | return -ENOMEM; | 453 | return -ENOMEM; |
455 | 454 | ||
456 | mi->mi_nilfs = nilfs; | 455 | mi->mi_nilfs = NILFS_I_NILFS(inode); |
457 | init_rwsem(&mi->mi_sem); | 456 | init_rwsem(&mi->mi_sem); |
458 | inode->i_private = mi; | 457 | inode->i_private = mi; |
459 | 458 | ||
460 | inode->i_mode = S_IFREG; | 459 | inode->i_mode = S_IFREG; |
461 | mapping_set_gfp_mask(inode->i_mapping, gfp_mask); | 460 | mapping_set_gfp_mask(inode->i_mapping, gfp_mask); |
462 | inode->i_mapping->backing_dev_info = nilfs->ns_bdi; | 461 | inode->i_mapping->backing_dev_info = inode->i_sb->s_bdi; |
462 | |||
463 | inode->i_op = &def_mdt_iops; | ||
464 | inode->i_fop = &def_mdt_fops; | ||
465 | inode->i_mapping->a_ops = &def_mdt_aops; | ||
463 | 466 | ||
464 | return 0; | 467 | return 0; |
465 | } | 468 | } |
@@ -544,13 +547,10 @@ struct inode *nilfs_mdt_new(struct the_nilfs *nilfs, struct super_block *sb, | |||
544 | if (!inode) | 547 | if (!inode) |
545 | return NULL; | 548 | return NULL; |
546 | 549 | ||
547 | if (nilfs_mdt_init(inode, nilfs, NILFS_MDT_GFP, objsz) < 0) { | 550 | if (nilfs_mdt_init(inode, NILFS_MDT_GFP, objsz) < 0) { |
548 | nilfs_destroy_inode(inode); | 551 | nilfs_destroy_inode(inode); |
549 | return NULL; | 552 | return NULL; |
550 | } | 553 | } |
551 | inode->i_op = &def_mdt_iops; | ||
552 | inode->i_fop = &def_mdt_fops; | ||
553 | inode->i_mapping->a_ops = &def_mdt_aops; | ||
554 | return inode; | 554 | return inode; |
555 | } | 555 | } |
556 | 556 | ||