f2fs: adjust readahead block number during recovery
[linux-2.6-microblaze.git] / fs / f2fs / checkpoint.c
index deeda95..a13b6b4 100644 (file)
@@ -282,18 +282,22 @@ out:
        return blkno - start;
 }
 
-void f2fs_ra_meta_pages_cond(struct f2fs_sb_info *sbi, pgoff_t index)
+void f2fs_ra_meta_pages_cond(struct f2fs_sb_info *sbi, pgoff_t index,
+                                                       unsigned int ra_blocks)
 {
        struct page *page;
        bool readahead = false;
 
+       if (ra_blocks == RECOVERY_MIN_RA_BLOCKS)
+               return;
+
        page = find_get_page(META_MAPPING(sbi), index);
        if (!page || !PageUptodate(page))
                readahead = true;
        f2fs_put_page(page, 0);
 
        if (readahead)
-               f2fs_ra_meta_pages(sbi, index, BIO_MAX_VECS, META_POR, true);
+               f2fs_ra_meta_pages(sbi, index, ra_blocks, META_POR, true);
 }
 
 static int __f2fs_write_meta_page(struct page *page,