Commit 8b94025c authored by Ryusuke Konishi's avatar Ryusuke Konishi

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: default avatarRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
parent 92c60cca
This diff is collapsed.
...@@ -234,9 +234,9 @@ extern int nilfs_attach_segment_constructor(struct nilfs_sb_info *); ...@@ -234,9 +234,9 @@ extern int nilfs_attach_segment_constructor(struct nilfs_sb_info *);
extern void nilfs_detach_segment_constructor(struct nilfs_sb_info *); extern void nilfs_detach_segment_constructor(struct nilfs_sb_info *);
/* recovery.c */ /* recovery.c */
extern int nilfs_read_super_root_block(struct super_block *, sector_t, extern int nilfs_read_super_root_block(struct the_nilfs *, sector_t,
struct buffer_head **, int); struct buffer_head **, int);
extern int nilfs_search_super_root(struct the_nilfs *, struct nilfs_sb_info *, extern int nilfs_search_super_root(struct the_nilfs *,
struct nilfs_recovery_info *); struct nilfs_recovery_info *);
extern int nilfs_recover_logical_segments(struct the_nilfs *, extern int nilfs_recover_logical_segments(struct the_nilfs *,
struct nilfs_sb_info *, struct nilfs_sb_info *,
......
...@@ -159,8 +159,7 @@ void put_nilfs(struct the_nilfs *nilfs) ...@@ -159,8 +159,7 @@ void put_nilfs(struct the_nilfs *nilfs)
kfree(nilfs); kfree(nilfs);
} }
static int nilfs_load_super_root(struct the_nilfs *nilfs, static int nilfs_load_super_root(struct the_nilfs *nilfs, sector_t sr_block)
struct nilfs_sb_info *sbi, sector_t sr_block)
{ {
struct buffer_head *bh_sr; struct buffer_head *bh_sr;
struct nilfs_super_root *raw_sr; struct nilfs_super_root *raw_sr;
...@@ -169,7 +168,7 @@ static int nilfs_load_super_root(struct the_nilfs *nilfs, ...@@ -169,7 +168,7 @@ static int nilfs_load_super_root(struct the_nilfs *nilfs,
unsigned inode_size; unsigned inode_size;
int err; int err;
err = nilfs_read_super_root_block(sbi->s_super, sr_block, &bh_sr, 1); err = nilfs_read_super_root_block(nilfs, sr_block, &bh_sr, 1);
if (unlikely(err)) if (unlikely(err))
return err; return err;
...@@ -285,13 +284,13 @@ int load_nilfs(struct the_nilfs *nilfs, struct nilfs_sb_info *sbi) ...@@ -285,13 +284,13 @@ int load_nilfs(struct the_nilfs *nilfs, struct nilfs_sb_info *sbi)
nilfs_init_recovery_info(&ri); nilfs_init_recovery_info(&ri);
err = nilfs_search_super_root(nilfs, sbi, &ri); err = nilfs_search_super_root(nilfs, &ri);
if (unlikely(err)) { if (unlikely(err)) {
printk(KERN_ERR "NILFS: error searching super root.\n"); printk(KERN_ERR "NILFS: error searching super root.\n");
goto failed; goto failed;
} }
err = nilfs_load_super_root(nilfs, sbi, ri.ri_super_root); err = nilfs_load_super_root(nilfs, ri.ri_super_root);
if (unlikely(err)) { if (unlikely(err)) {
printk(KERN_ERR "NILFS: error loading super root.\n"); printk(KERN_ERR "NILFS: error loading super root.\n");
goto failed; goto failed;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment