aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/ifile.c
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2009-11-12 09:56:43 -0500
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2009-11-19 20:05:48 -0500
commit79739565e15f2adbc482207a0800fc127c84d1a0 (patch)
tree10d61f5a31e4de5c90a6c9c10f0f0bc8e68d1550 /fs/nilfs2/ifile.c
parent5731e191f254af9135ad843119804a500528ecf3 (diff)
nilfs2: separate constructor of metadata files
This will displace nilfs_mdt_new() constructor with individual metadata file constructors like nilfs_dat_new(), new_sufile_new(), nilfs_cpfile_new(), and nilfs_ifile_new(). This makes it possible for each metadata file to have own intialization code. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/ifile.c')
-rw-r--r--fs/nilfs2/ifile.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/fs/nilfs2/ifile.c b/fs/nilfs2/ifile.c
index de86401f209f..c1c1fd30c315 100644
--- a/fs/nilfs2/ifile.c
+++ b/fs/nilfs2/ifile.c
@@ -148,3 +148,24 @@ int nilfs_ifile_get_inode_block(struct inode *ifile, ino_t ino,
148 } 148 }
149 return err; 149 return err;
150} 150}
151
152/**
153 * nilfs_ifile_new - create inode file
154 * @sbi: nilfs_sb_info struct
155 * @inode_size: size of an inode
156 */
157struct inode *nilfs_ifile_new(struct nilfs_sb_info *sbi, size_t inode_size)
158{
159 struct inode *ifile;
160 int err;
161
162 ifile = nilfs_mdt_new(sbi->s_nilfs, sbi->s_super, NILFS_IFILE_INO, 0);
163 if (ifile) {
164 err = nilfs_palloc_init_blockgroup(ifile, inode_size);
165 if (unlikely(err)) {
166 nilfs_mdt_destroy(ifile);
167 return NULL;
168 }
169 }
170 return ifile;
171}