Merge tag 'mac80211-for-davem-2016-06-01' of git://git.kernel.org/pub/scm/linux/kerne...
[deliverable/linux.git] / fs / f2fs / checkpoint.c
index d04113b9ac1804f94a907d0b96303022a3f9dc80..3891600499939895600bfc9aed37c6f2b5e1d53d 100644 (file)
 static struct kmem_cache *ino_entry_slab;
 struct kmem_cache *inode_entry_slab;
 
+void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io)
+{
+       set_ckpt_flags(sbi->ckpt, CP_ERROR_FLAG);
+       sbi->sb->s_flags |= MS_RDONLY;
+       if (!end_io)
+               f2fs_flush_merged_bios(sbi);
+}
+
 /*
  * We guarantee no failure on the returned page.
  */
@@ -91,7 +99,7 @@ repeat:
         * meta page.
         */
        if (unlikely(!PageUptodate(page)))
-               f2fs_stop_checkpoint(sbi);
+               f2fs_stop_checkpoint(sbi, false);
 out:
        return page;
 }
@@ -914,7 +922,7 @@ static void wait_on_all_pages_writeback(struct f2fs_sb_info *sbi)
        for (;;) {
                prepare_to_wait(&sbi->cp_wait, &wait, TASK_UNINTERRUPTIBLE);
 
-               if (!get_pages(sbi, F2FS_WRITEBACK))
+               if (!atomic_read(&sbi->nr_wb_bios))
                        break;
 
                io_schedule_timeout(5*HZ);
@@ -1079,7 +1087,7 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
 
        /* update user_block_counts */
        sbi->last_valid_block_count = sbi->total_valid_block_count;
-       sbi->alloc_valid_block_count = 0;
+       percpu_counter_set(&sbi->alloc_valid_block_count, 0);
 
        /* Here, we only have one bio having CP pack */
        sync_meta_pages(sbi, META_FLUSH, LONG_MAX);
This page took 0.034463 seconds and 5 git commands to generate.