f2fs: write node pages if checkpoint is not doing

It needs to write node pages if checkpoint is not doing in order to avoid
memory pressure.

Reviewed-by: Changman Lee <cm224.lee@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Jaegeuk Kim 2014-11-06 17:21:24 -08:00
parent e5e7ea3c86
commit 2f97c326bf
1 changed files with 6 additions and 4 deletions

View File

@ -1314,10 +1314,12 @@ static int f2fs_write_node_page(struct page *page,
return 0; return 0;
} }
if (wbc->for_reclaim) if (wbc->for_reclaim) {
goto redirty_out; if (!down_read_trylock(&sbi->node_write))
goto redirty_out;
down_read(&sbi->node_write); } else {
down_read(&sbi->node_write);
}
set_page_writeback(page); set_page_writeback(page);
write_node_page(sbi, page, &fio, nid, ni.blk_addr, &new_addr); write_node_page(sbi, page, &fio, nid, ni.blk_addr, &new_addr);
set_node_addr(sbi, &ni, new_addr, is_fsync_dnode(page)); set_node_addr(sbi, &ni, new_addr, is_fsync_dnode(page));