diff --git a/fs/nilfs2/cpfile.c b/fs/nilfs2/cpfile.c index 2aaefaec1567630fb0d31e76f5a60e028afee0ee..d5ad54e204a59f45c181990857d6977cc9b5a73b 100644 --- a/fs/nilfs2/cpfile.c +++ b/fs/nilfs2/cpfile.c @@ -927,6 +927,16 @@ int nilfs_cpfile_get_stat(struct inode *cpfile, struct nilfs_cpstat *cpstat) return ret; } +/** + * nilfs_cpfile_read - read cpfile inode + * @cpfile: cpfile inode + * @raw_inode: on-disk cpfile inode + */ +int nilfs_cpfile_read(struct inode *cpfile, struct nilfs_inode *raw_inode) +{ + return nilfs_read_inode_common(cpfile, raw_inode); +} + /** * nilfs_cpfile_new - create cpfile * @nilfs: nilfs object diff --git a/fs/nilfs2/cpfile.h b/fs/nilfs2/cpfile.h index 8ff2b4f4656b385d19f65e3651269ea6aeaf6fa0..bc0809e0ab43d15dc60efad9ed731dd870348c22 100644 --- a/fs/nilfs2/cpfile.h +++ b/fs/nilfs2/cpfile.h @@ -40,6 +40,7 @@ int nilfs_cpfile_get_stat(struct inode *, struct nilfs_cpstat *); ssize_t nilfs_cpfile_get_cpinfo(struct inode *, __u64 *, int, void *, unsigned, size_t); +int nilfs_cpfile_read(struct inode *cpfile, struct nilfs_inode *raw_inode); struct inode *nilfs_cpfile_new(struct the_nilfs *nilfs, size_t cpsize); #endif /* _NILFS_CPFILE_H */ diff --git a/fs/nilfs2/dat.c b/fs/nilfs2/dat.c index 239a422349998c6f610683f0398353cbce8b58de..eff3169ba10fd4864465e6f09189e16f540dbf05 100644 --- a/fs/nilfs2/dat.c +++ b/fs/nilfs2/dat.c @@ -426,6 +426,16 @@ ssize_t nilfs_dat_get_vinfo(struct inode *dat, void *buf, unsigned visz, return nvi; } +/** + * nilfs_dat_read - read dat inode + * @dat: dat inode + * @raw_inode: on-disk dat inode + */ +int nilfs_dat_read(struct inode *dat, struct nilfs_inode *raw_inode) +{ + return nilfs_read_inode_common(dat, raw_inode); +} + /** * nilfs_dat_new - create dat file * @nilfs: nilfs object diff --git a/fs/nilfs2/dat.h b/fs/nilfs2/dat.h index 98f33067cb828277cfc10f02436351c22290141c..d31c3aab0efefb7cb64bd7070feee322a17469a8 100644 --- a/fs/nilfs2/dat.h +++ b/fs/nilfs2/dat.h @@ -53,6 +53,7 @@ int nilfs_dat_freev(struct inode *, __u64 *, size_t); int nilfs_dat_move(struct inode *, __u64, sector_t); ssize_t nilfs_dat_get_vinfo(struct inode *, void *, unsigned, size_t); +int nilfs_dat_read(struct inode *dat, struct nilfs_inode *raw_inode); struct inode *nilfs_dat_new(struct the_nilfs *nilfs, size_t entry_size); #endif /* _NILFS_DAT_H */ diff --git a/fs/nilfs2/sufile.c b/fs/nilfs2/sufile.c index 6fb707ab7e2c0c274cc04de3199eabfcaf7f7ac0..b344f27238f054a7a148bda7a6fcd942d49cc04b 100644 --- a/fs/nilfs2/sufile.c +++ b/fs/nilfs2/sufile.c @@ -658,6 +658,16 @@ ssize_t nilfs_sufile_get_suinfo(struct inode *sufile, __u64 segnum, void *buf, return ret; } +/** + * nilfs_sufile_read - read sufile inode + * @sufile: sufile inode + * @raw_inode: on-disk sufile inode + */ +int nilfs_sufile_read(struct inode *sufile, struct nilfs_inode *raw_inode) +{ + return nilfs_read_inode_common(sufile, raw_inode); +} + /** * nilfs_sufile_new - create sufile * @nilfs: nilfs object diff --git a/fs/nilfs2/sufile.h b/fs/nilfs2/sufile.h index 50d3191ae4fda8da831046fb5e91a4c12e77bd2b..b303a80ac3b120f24617016d49adb7e3ac4b5197 100644 --- a/fs/nilfs2/sufile.h +++ b/fs/nilfs2/sufile.h @@ -62,6 +62,7 @@ void nilfs_sufile_do_cancel_free(struct inode *, __u64, struct buffer_head *, void nilfs_sufile_do_set_error(struct inode *, __u64, struct buffer_head *, struct buffer_head *); +int nilfs_sufile_read(struct inode *sufile, struct nilfs_inode *raw_inode); struct inode *nilfs_sufile_new(struct the_nilfs *nilfs, size_t susize); /** diff --git a/fs/nilfs2/the_nilfs.c b/fs/nilfs2/the_nilfs.c index d4a731fd4e3202fc3246d312044bc290625efafa..bc7760c2a8f2a27f4b361434b7aad2453d86d5b5 100644 --- a/fs/nilfs2/the_nilfs.c +++ b/fs/nilfs2/the_nilfs.c @@ -204,18 +204,18 @@ static int nilfs_load_super_root(struct the_nilfs *nilfs, nilfs_mdt_set_shadow(nilfs->ns_dat, nilfs->ns_gc_dat); - err = nilfs_mdt_read_inode_direct( - nilfs->ns_dat, bh_sr, NILFS_SR_DAT_OFFSET(inode_size)); + err = nilfs_dat_read(nilfs->ns_dat, (void *)bh_sr->b_data + + NILFS_SR_DAT_OFFSET(inode_size)); if (unlikely(err)) goto failed_sufile; - err = nilfs_mdt_read_inode_direct( - nilfs->ns_cpfile, bh_sr, NILFS_SR_CPFILE_OFFSET(inode_size)); + err = nilfs_cpfile_read(nilfs->ns_cpfile, (void *)bh_sr->b_data + + NILFS_SR_CPFILE_OFFSET(inode_size)); if (unlikely(err)) goto failed_sufile; - err = nilfs_mdt_read_inode_direct( - nilfs->ns_sufile, bh_sr, NILFS_SR_SUFILE_OFFSET(inode_size)); + err = nilfs_sufile_read(nilfs->ns_sufile, (void *)bh_sr->b_data + + NILFS_SR_SUFILE_OFFSET(inode_size)); if (unlikely(err)) goto failed_sufile;