Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
[deliverable/linux.git] / fs / f2fs / checkpoint.c
index 8534b98c07122e8c464995661c21843766f8b3c6..f94d01e7d001f3181dd9cdae25b50eed3593f44f 100644 (file)
@@ -48,7 +48,8 @@ repeat:
                goto repeat;
        }
        f2fs_wait_on_page_writeback(page, META, true);
-       SetPageUptodate(page);
+       if (!PageUptodate(page))
+               SetPageUptodate(page);
        return page;
 }
 
@@ -63,14 +64,15 @@ static struct page *__get_meta_page(struct f2fs_sb_info *sbi, pgoff_t index,
        struct f2fs_io_info fio = {
                .sbi = sbi,
                .type = META,
-               .rw = READ_SYNC | REQ_META | REQ_PRIO,
+               .op = REQ_OP_READ,
+               .op_flags = READ_SYNC | REQ_META | REQ_PRIO,
                .old_blkaddr = index,
                .new_blkaddr = index,
                .encrypted_page = NULL,
        };
 
        if (unlikely(!is_meta))
-               fio.rw &= ~REQ_META;
+               fio.op_flags &= ~REQ_META;
 repeat:
        page = f2fs_grab_cache_page(mapping, index, false);
        if (!page) {
@@ -157,13 +159,14 @@ int ra_meta_pages(struct f2fs_sb_info *sbi, block_t start, int nrpages,
        struct f2fs_io_info fio = {
                .sbi = sbi,
                .type = META,
-               .rw = sync ? (READ_SYNC | REQ_META | REQ_PRIO) : READA,
+               .op = REQ_OP_READ,
+               .op_flags = sync ? (READ_SYNC | REQ_META | REQ_PRIO) : REQ_RAHEAD,
                .encrypted_page = NULL,
        };
        struct blk_plug plug;
 
        if (unlikely(type == META_POR))
-               fio.rw &= ~REQ_META;
+               fio.op_flags &= ~REQ_META;
 
        blk_start_plug(&plug);
        for (; nrpages-- > 0; blkno++) {
@@ -264,6 +267,7 @@ static int f2fs_write_meta_pages(struct address_space *mapping,
                                struct writeback_control *wbc)
 {
        struct f2fs_sb_info *sbi = F2FS_M_SB(mapping);
+       struct blk_plug plug;
        long diff, written;
 
        /* collect a number of dirty meta pages and write together */
@@ -276,7 +280,9 @@ static int f2fs_write_meta_pages(struct address_space *mapping,
        /* if mounting is failed, skip writing node pages */
        mutex_lock(&sbi->cp_mutex);
        diff = nr_pages_to_write(sbi, META, wbc);
+       blk_start_plug(&plug);
        written = sync_meta_pages(sbi, META, wbc->nr_to_write);
+       blk_finish_plug(&plug);
        mutex_unlock(&sbi->cp_mutex);
        wbc->nr_to_write = max((long)0, wbc->nr_to_write - written - diff);
        return 0;
@@ -364,9 +370,10 @@ static int f2fs_set_meta_page_dirty(struct page *page)
 {
        trace_f2fs_set_page_dirty(page, META);
 
-       SetPageUptodate(page);
+       if (!PageUptodate(page))
+               SetPageUptodate(page);
        if (!PageDirty(page)) {
-               __set_page_dirty_nobuffers(page);
+               f2fs_set_page_dirty_nobuffers(page);
                inc_page_count(F2FS_P_SB(page), F2FS_DIRTY_META);
                SetPagePrivate(page);
                f2fs_trace_pid(page);
@@ -897,8 +904,11 @@ static int block_operations(struct f2fs_sb_info *sbi)
                .nr_to_write = LONG_MAX,
                .for_reclaim = 0,
        };
+       struct blk_plug plug;
        int err = 0;
 
+       blk_start_plug(&plug);
+
 retry_flush_dents:
        f2fs_lock_all(sbi);
        /* write all the dirty dentry pages */
@@ -935,12 +945,15 @@ retry_flush_nodes:
                goto retry_flush_nodes;
        }
 out:
+       blk_finish_plug(&plug);
        return err;
 }
 
 static void unblock_operations(struct f2fs_sb_info *sbi)
 {
        up_write(&sbi->node_write);
+
+       build_free_nids(sbi);
        f2fs_unlock_all(sbi);
 }
 
This page took 0.027285 seconds and 5 git commands to generate.