checkpoint.c (8ec18bff7b90b56eba5986555c174721ebd5670b) checkpoint.c (bae0ee7a767ceeea6d8e170da3f228fbc7480331)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * fs/f2fs/checkpoint.c
4 *
5 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
6 * http://www.samsung.com/
7 */
8#include <linux/fs.h>

--- 30 unchanged lines hidden (view full) ---

39 struct address_space *mapping = META_MAPPING(sbi);
40 struct page *page = NULL;
41repeat:
42 page = f2fs_grab_cache_page(mapping, index, false);
43 if (!page) {
44 cond_resched();
45 goto repeat;
46 }
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * fs/f2fs/checkpoint.c
4 *
5 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
6 * http://www.samsung.com/
7 */
8#include <linux/fs.h>

--- 30 unchanged lines hidden (view full) ---

39 struct address_space *mapping = META_MAPPING(sbi);
40 struct page *page = NULL;
41repeat:
42 page = f2fs_grab_cache_page(mapping, index, false);
43 if (!page) {
44 cond_resched();
45 goto repeat;
46 }
47 f2fs_wait_on_page_writeback(page, META, true);
47 f2fs_wait_on_page_writeback(page, META, true, true);
48 if (!PageUptodate(page))
49 SetPageUptodate(page);
50 return page;
51}
52
53/*
54 * We guarantee no failure on the returned page.
55 */

--- 309 unchanged lines hidden (view full) ---

365 unlock_page(page);
366 continue;
367 }
368 if (!PageDirty(page)) {
369 /* someone wrote it for us */
370 goto continue_unlock;
371 }
372
48 if (!PageUptodate(page))
49 SetPageUptodate(page);
50 return page;
51}
52
53/*
54 * We guarantee no failure on the returned page.
55 */

--- 309 unchanged lines hidden (view full) ---

365 unlock_page(page);
366 continue;
367 }
368 if (!PageDirty(page)) {
369 /* someone wrote it for us */
370 goto continue_unlock;
371 }
372
373 f2fs_wait_on_page_writeback(page, META, true);
373 f2fs_wait_on_page_writeback(page, META, true, true);
374
374
375 BUG_ON(PageWriteback(page));
376 if (!clear_page_dirty_for_io(page))
377 goto continue_unlock;
378
379 if (__f2fs_write_meta_page(page, &wbc, io_type)) {
380 unlock_page(page);
381 break;
382 }
383 nwritten++;

--- 901 unchanged lines hidden (view full) ---

1285 /*
1286 * pagevec_lookup_tag and lock_page again will take
1287 * some extra time. Therefore, f2fs_update_meta_pages and
1288 * f2fs_sync_meta_pages are combined in this function.
1289 */
1290 struct page *page = f2fs_grab_meta_page(sbi, blk_addr);
1291 int err;
1292
375 if (!clear_page_dirty_for_io(page))
376 goto continue_unlock;
377
378 if (__f2fs_write_meta_page(page, &wbc, io_type)) {
379 unlock_page(page);
380 break;
381 }
382 nwritten++;

--- 901 unchanged lines hidden (view full) ---

1284 /*
1285 * pagevec_lookup_tag and lock_page again will take
1286 * some extra time. Therefore, f2fs_update_meta_pages and
1287 * f2fs_sync_meta_pages are combined in this function.
1288 */
1289 struct page *page = f2fs_grab_meta_page(sbi, blk_addr);
1290 int err;
1291
1293 f2fs_wait_on_page_writeback(page, META, true);
1294 f2fs_bug_on(sbi, PageWriteback(page));
1292 f2fs_wait_on_page_writeback(page, META, true, true);
1295
1296 memcpy(page_address(page), src, PAGE_SIZE);
1297
1298 set_page_dirty(page);
1299 if (unlikely(!clear_page_dirty_for_io(page)))
1300 f2fs_bug_on(sbi, 1);
1301
1302 /* writeout cp pack 2 page */

--- 317 unchanged lines hidden ---
1293
1294 memcpy(page_address(page), src, PAGE_SIZE);
1295
1296 set_page_dirty(page);
1297 if (unlikely(!clear_page_dirty_for_io(page)))
1298 f2fs_bug_on(sbi, 1);
1299
1300 /* writeout cp pack 2 page */

--- 317 unchanged lines hidden ---