data.c (ef095d19e82f25bbdead472b8b71f4ef3b7a636d) data.c (687de7f1010cb819d04b768556960d3689abe02b)
1/*
2 * fs/f2fs/data.c
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

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

1600 }
1601 done_index = page->index + 1;
1602 done = 1;
1603 break;
1604 } else if (submitted) {
1605 last_idx = page->index;
1606 }
1607
1/*
2 * fs/f2fs/data.c
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

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

1600 }
1601 done_index = page->index + 1;
1602 done = 1;
1603 break;
1604 } else if (submitted) {
1605 last_idx = page->index;
1606 }
1607
1608 if (--wbc->nr_to_write <= 0 &&
1609 wbc->sync_mode == WB_SYNC_NONE) {
1608 /* give a priority to WB_SYNC threads */
1609 if ((atomic_read(&F2FS_M_SB(mapping)->wb_sync_req) ||
1610 --wbc->nr_to_write <= 0) &&
1611 wbc->sync_mode == WB_SYNC_NONE) {
1610 done = 1;
1611 break;
1612 }
1613 }
1614 pagevec_release(&pvec);
1615 cond_resched();
1616 }
1617

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

1657 goto skip_write;
1658
1659 /* during POR, we don't need to trigger writepage at all. */
1660 if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING)))
1661 goto skip_write;
1662
1663 trace_f2fs_writepages(mapping->host, wbc, DATA);
1664
1612 done = 1;
1613 break;
1614 }
1615 }
1616 pagevec_release(&pvec);
1617 cond_resched();
1618 }
1619

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

1659 goto skip_write;
1660
1661 /* during POR, we don't need to trigger writepage at all. */
1662 if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING)))
1663 goto skip_write;
1664
1665 trace_f2fs_writepages(mapping->host, wbc, DATA);
1666
1667 /* to avoid spliting IOs due to mixed WB_SYNC_ALL and WB_SYNC_NONE */
1668 if (wbc->sync_mode == WB_SYNC_ALL)
1669 atomic_inc(&sbi->wb_sync_req);
1670 else if (atomic_read(&sbi->wb_sync_req))
1671 goto skip_write;
1672
1665 blk_start_plug(&plug);
1666 ret = f2fs_write_cache_pages(mapping, wbc);
1667 blk_finish_plug(&plug);
1673 blk_start_plug(&plug);
1674 ret = f2fs_write_cache_pages(mapping, wbc);
1675 blk_finish_plug(&plug);
1676
1677 if (wbc->sync_mode == WB_SYNC_ALL)
1678 atomic_dec(&sbi->wb_sync_req);
1668 /*
1669 * if some pages were truncated, we cannot guarantee its mapping->host
1670 * to detect pending bios.
1671 */
1672
1673 remove_dirty_inode(inode);
1674 return ret;
1675

--- 466 unchanged lines hidden ---
1679 /*
1680 * if some pages were truncated, we cannot guarantee its mapping->host
1681 * to detect pending bios.
1682 */
1683
1684 remove_dirty_inode(inode);
1685 return ret;
1686

--- 466 unchanged lines hidden ---