aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2014-08-11 19:49:25 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2014-08-21 12:21:00 -0400
commit1e968fdfe69e4060f05fa04059ecad93a0284e32 (patch)
tree402e50b541688a5050fb7ef75ab1781ad8cd22e2
parented2e621a95d704e6a4e904cc00524e8cbddda0c2 (diff)
f2fs: introduce f2fs_cp_error for readability
This patch adds f2fs_cp_error for readability. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/checkpoint.c4
-rw-r--r--fs/f2fs/f2fs.h5
-rw-r--r--fs/f2fs/gc.c2
-rw-r--r--fs/f2fs/super.c2
4 files changed, 9 insertions, 4 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index f14af912a146..6f38aad8e654 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -162,7 +162,7 @@ static int f2fs_write_meta_page(struct page *page,
162 goto redirty_out; 162 goto redirty_out;
163 163
164 /* Should not write any meta pages, if any IO error was occurred */ 164 /* Should not write any meta pages, if any IO error was occurred */
165 if (unlikely(is_set_ckpt_flags(F2FS_CKPT(sbi), CP_ERROR_FLAG))) 165 if (unlikely(f2fs_cp_error(sbi)))
166 goto no_write; 166 goto no_write;
167 167
168 f2fs_wait_on_page_writeback(page, META); 168 f2fs_wait_on_page_writeback(page, META);
@@ -934,7 +934,7 @@ static void do_checkpoint(struct f2fs_sb_info *sbi, bool is_umount)
934 /* Here, we only have one bio having CP pack */ 934 /* Here, we only have one bio having CP pack */
935 sync_meta_pages(sbi, META_FLUSH, LONG_MAX); 935 sync_meta_pages(sbi, META_FLUSH, LONG_MAX);
936 936
937 if (!is_set_ckpt_flags(ckpt, CP_ERROR_FLAG)) { 937 if (!f2fs_cp_error(sbi)) {
938 clear_prefree_segments(sbi); 938 clear_prefree_segments(sbi);
939 release_dirty_inode(sbi); 939 release_dirty_inode(sbi);
940 F2FS_RESET_SB_DIRT(sbi); 940 F2FS_RESET_SB_DIRT(sbi);
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index cc89a7f490a6..2d009aed0c2e 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1096,6 +1096,11 @@ static inline int f2fs_readonly(struct super_block *sb)
1096 return sb->s_flags & MS_RDONLY; 1096 return sb->s_flags & MS_RDONLY;
1097} 1097}
1098 1098
1099static inline bool f2fs_cp_error(struct f2fs_sb_info *sbi)
1100{
1101 return is_set_ckpt_flags(sbi->ckpt, CP_ERROR_FLAG);
1102}
1103
1099static inline void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi) 1104static inline void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi)
1100{ 1105{
1101 set_ckpt_flags(sbi->ckpt, CP_ERROR_FLAG); 1106 set_ckpt_flags(sbi->ckpt, CP_ERROR_FLAG);
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 87c50c507461..e8507b1c8759 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -693,7 +693,7 @@ int f2fs_gc(struct f2fs_sb_info *sbi)
693gc_more: 693gc_more:
694 if (unlikely(!(sbi->sb->s_flags & MS_ACTIVE))) 694 if (unlikely(!(sbi->sb->s_flags & MS_ACTIVE)))
695 goto stop; 695 goto stop;
696 if (unlikely(is_set_ckpt_flags(F2FS_CKPT(sbi), CP_ERROR_FLAG))) 696 if (unlikely(f2fs_cp_error(sbi)))
697 goto stop; 697 goto stop;
698 698
699 if (gc_type == BG_GC && has_not_enough_free_secs(sbi, nfree)) { 699 if (gc_type == BG_GC && has_not_enough_free_secs(sbi, nfree)) {
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index e161e13958e2..8aabe3ef42f6 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -815,7 +815,7 @@ static int sanity_check_ckpt(struct f2fs_sb_info *sbi)
815 if (unlikely(fsmeta >= total)) 815 if (unlikely(fsmeta >= total))
816 return 1; 816 return 1;
817 817
818 if (unlikely(is_set_ckpt_flags(ckpt, CP_ERROR_FLAG))) { 818 if (unlikely(f2fs_cp_error(sbi))) {
819 f2fs_msg(sbi->sb, KERN_ERR, "A bug case: need to run fsck"); 819 f2fs_msg(sbi->sb, KERN_ERR, "A bug case: need to run fsck");
820 return 1; 820 return 1;
821 } 821 }