aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/mdt.c
diff options
context:
space:
mode:
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;
444static const struct file_operations def_mdt_fops; 444static const struct file_operations def_mdt_fops;
445 445
446 446
447int nilfs_mdt_init(struct inode *inode, struct the_nilfs *nilfs, 447int 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