From 4aac978feb7e5ab223542141215c514f9eb8d7d6 Mon Sep 17 00:00:00 2001 From: Ryusuke Konishi Date: Thu, 19 Nov 2009 19:58:46 +0900 Subject: [PATCH] --- yaml --- r: 174715 b: refs/heads/master c: a057d2c01161444c48b12a60351ae6c7135f6e61 h: refs/heads/master i: 174713: 010cf7a4b51f57a5ab0fadd2145b243a3373b3a3 174711: 22c6bd885fb2e3d0314deb4c40131de13ba4763e v: v3 --- [refs] | 2 +- trunk/fs/nilfs2/the_nilfs.c | 6 +----- trunk/fs/nilfs2/the_nilfs.h | 10 ++++++++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index bb2622c212ab..332da64e77e6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f50a4c8149cc135921a8a0476bff8e622f59aef9 +refs/heads/master: a057d2c01161444c48b12a60351ae6c7135f6e61 diff --git a/trunk/fs/nilfs2/the_nilfs.c b/trunk/fs/nilfs2/the_nilfs.c index aea2b58ba03b..890a8d3886cf 100644 --- a/trunk/fs/nilfs2/the_nilfs.c +++ b/trunk/fs/nilfs2/the_nilfs.c @@ -261,16 +261,12 @@ int load_nilfs(struct the_nilfs *nilfs, struct nilfs_sb_info *sbi) struct nilfs_recovery_info ri; unsigned int s_flags = sbi->s_super->s_flags; int really_read_only = bdev_read_only(nilfs->ns_bdev); - unsigned valid_fs; + int valid_fs = nilfs_valid_fs(nilfs); int err; if (nilfs_loaded(nilfs)) return 0; - down_write(&nilfs->ns_sem); - valid_fs = (nilfs->ns_mount_state & NILFS_VALID_FS); - up_write(&nilfs->ns_sem); - if (!valid_fs) { printk(KERN_WARNING "NILFS warning: mounting unchecked fs\n"); if (s_flags & MS_RDONLY) { diff --git a/trunk/fs/nilfs2/the_nilfs.h b/trunk/fs/nilfs2/the_nilfs.h index 20abd55881e0..589786e33464 100644 --- a/trunk/fs/nilfs2/the_nilfs.h +++ b/trunk/fs/nilfs2/the_nilfs.h @@ -258,6 +258,16 @@ static inline void nilfs_put_sbinfo(struct nilfs_sb_info *sbi) kfree(sbi); } +static inline int nilfs_valid_fs(struct the_nilfs *nilfs) +{ + unsigned valid_fs; + + down_read(&nilfs->ns_sem); + valid_fs = (nilfs->ns_mount_state & NILFS_VALID_FS); + up_read(&nilfs->ns_sem); + return valid_fs; +} + static inline void nilfs_get_segment_range(struct the_nilfs *nilfs, __u64 segnum, sector_t *seg_start, sector_t *seg_end)