f2fs: introduce f2fs_cp_error for readability
[linux-2.6-block.git] / fs / f2fs / checkpoint.c
index 6aeed5bada52b1e6bdf9d1bc8228c9e69fb35b13..6f38aad8e6545b16c7082fdda570fdcc2b07aa73 100644 (file)
@@ -162,7 +162,7 @@ static int f2fs_write_meta_page(struct page *page,
                goto redirty_out;
 
        /* Should not write any meta pages, if any IO error was occurred */
-       if (unlikely(is_set_ckpt_flags(F2FS_CKPT(sbi), CP_ERROR_FLAG)))
+       if (unlikely(f2fs_cp_error(sbi)))
                goto no_write;
 
        f2fs_wait_on_page_writeback(page, META);
@@ -348,7 +348,7 @@ bool exist_written_data(struct f2fs_sb_info *sbi, nid_t ino, int mode)
        return e ? true : false;
 }
 
-static void release_dirty_inode(struct f2fs_sb_info *sbi)
+void release_dirty_inode(struct f2fs_sb_info *sbi)
 {
        struct ino_entry *e, *tmp;
        int i;
@@ -758,7 +758,7 @@ retry_flush_dents:
        }
 
        /*
-        * POR: we should ensure that there is no dirty node pages
+        * POR: we should ensure that there are no dirty node pages
         * until finishing nat/sit flush.
         */
 retry_flush_nodes:
@@ -934,7 +934,7 @@ static void do_checkpoint(struct f2fs_sb_info *sbi, bool is_umount)
        /* Here, we only have one bio having CP pack */
        sync_meta_pages(sbi, META_FLUSH, LONG_MAX);
 
-       if (!is_set_ckpt_flags(ckpt, CP_ERROR_FLAG)) {
+       if (!f2fs_cp_error(sbi)) {
                clear_prefree_segments(sbi);
                release_dirty_inode(sbi);
                F2FS_RESET_SB_DIRT(sbi);
@@ -942,7 +942,7 @@ static void do_checkpoint(struct f2fs_sb_info *sbi, bool is_umount)
 }
 
 /*
- * We guarantee that this checkpoint procedure should not fail.
+ * We guarantee that this checkpoint procedure will not fail.
  */
 void write_checkpoint(struct f2fs_sb_info *sbi, bool is_umount)
 {