aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/the_nilfs.c
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-05-22 12:39:02 -0400
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-07-22 21:02:08 -0400
commit8b94025c00f9171b41ba9c1696943f5c935b62ef (patch)
tree97f770d1f1aa6d57c1a070514d4f933ffc4d467c /fs/nilfs2/the_nilfs.c
parent92c60ccaf3c15a06d859682b980de1066641b4d0 (diff)
nilfs2: refactor recovery logic routines
Most functions in recovery code take an argument of a super block instance or a nilfs_sb_info struct for convenience sake. This replaces them aggressively with a nilfs object by applying __bread and __breadahead against routines using sb_bread and sb_breadahead. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/the_nilfs.c')
-rw-r--r--fs/nilfs2/the_nilfs.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/nilfs2/the_nilfs.c b/fs/nilfs2/the_nilfs.c
index 870a1273e9b0..a94908e4d6d7 100644
--- a/fs/nilfs2/the_nilfs.c
+++ b/fs/nilfs2/the_nilfs.c
@@ -159,8 +159,7 @@ void put_nilfs(struct the_nilfs *nilfs)
159 kfree(nilfs); 159 kfree(nilfs);
160} 160}
161 161
162static int nilfs_load_super_root(struct the_nilfs *nilfs, 162static int nilfs_load_super_root(struct the_nilfs *nilfs, sector_t sr_block)
163 struct nilfs_sb_info *sbi, sector_t sr_block)
164{ 163{
165 struct buffer_head *bh_sr; 164 struct buffer_head *bh_sr;
166 struct nilfs_super_root *raw_sr; 165 struct nilfs_super_root *raw_sr;
@@ -169,7 +168,7 @@ static int nilfs_load_super_root(struct the_nilfs *nilfs,
169 unsigned inode_size; 168 unsigned inode_size;
170 int err; 169 int err;
171 170
172 err = nilfs_read_super_root_block(sbi->s_super, sr_block, &bh_sr, 1); 171 err = nilfs_read_super_root_block(nilfs, sr_block, &bh_sr, 1);
173 if (unlikely(err)) 172 if (unlikely(err))
174 return err; 173 return err;
175 174
@@ -285,13 +284,13 @@ int load_nilfs(struct the_nilfs *nilfs, struct nilfs_sb_info *sbi)
285 284
286 nilfs_init_recovery_info(&ri); 285 nilfs_init_recovery_info(&ri);
287 286
288 err = nilfs_search_super_root(nilfs, sbi, &ri); 287 err = nilfs_search_super_root(nilfs, &ri);
289 if (unlikely(err)) { 288 if (unlikely(err)) {
290 printk(KERN_ERR "NILFS: error searching super root.\n"); 289 printk(KERN_ERR "NILFS: error searching super root.\n");
291 goto failed; 290 goto failed;
292 } 291 }
293 292
294 err = nilfs_load_super_root(nilfs, sbi, ri.ri_super_root); 293 err = nilfs_load_super_root(nilfs, ri.ri_super_root);
295 if (unlikely(err)) { 294 if (unlikely(err)) {
296 printk(KERN_ERR "NILFS: error loading super root.\n"); 295 printk(KERN_ERR "NILFS: error loading super root.\n");
297 goto failed; 296 goto failed;