Merge branch 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux
[linux-2.6-microblaze.git] / fs / f2fs / compress.c
index 77fa342..53b1378 100644 (file)
@@ -76,12 +76,6 @@ bool f2fs_is_compressed_page(struct page *page)
                return false;
        if (IS_ATOMIC_WRITTEN_PAGE(page) || IS_DUMMY_WRITTEN_PAGE(page))
                return false;
-       /*
-        * page->private may be set with pid.
-        * pid_max is enough to check if it is traced.
-        */
-       if (IS_IO_TRACED_PAGE(page))
-               return false;
 
        f2fs_bug_on(F2FS_M_SB(page->mapping),
                *((u32 *)page_private(page)) != F2FS_COMPRESSED_PAGE_MAGIC);
@@ -896,7 +890,6 @@ bool f2fs_cluster_can_merge_page(struct compress_ctx *cc, pgoff_t index)
 
 static bool __cluster_may_compress(struct compress_ctx *cc)
 {
-       struct f2fs_sb_info *sbi = F2FS_I_SB(cc->inode);
        loff_t i_size = i_size_read(cc->inode);
        unsigned nr_pages = DIV_ROUND_UP(i_size, PAGE_SIZE);
        int i;
@@ -904,12 +897,7 @@ static bool __cluster_may_compress(struct compress_ctx *cc)
        for (i = 0; i < cc->cluster_size; i++) {
                struct page *page = cc->rpages[i];
 
-               f2fs_bug_on(sbi, !page);
-
-               if (unlikely(f2fs_cp_error(sbi)))
-                       return false;
-               if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING)))
-                       return false;
+               f2fs_bug_on(F2FS_I_SB(cc->inode), !page);
 
                /* beyond EOF */
                if (page->index >= nr_pages)
@@ -1353,6 +1341,7 @@ unlock_continue:
        if (fio.compr_blocks)
                f2fs_i_compr_blocks_update(inode, fio.compr_blocks - 1, false);
        f2fs_i_compr_blocks_update(inode, cc->nr_cpages, true);
+       add_compr_block_stat(inode, cc->nr_cpages);
 
        set_inode_flag(cc->inode, FI_APPEND_WRITE);
        if (cc->cluster_idx == 0)