f2fs: call redirty_page_for_writepage
This patch replace some general codes with redirty_page_for_writepage, which can be enabled after consideration on additional procedure like counting dirty pages appropriately. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
This commit is contained in:
Родитель
1e87a78d95
Коммит
76f60268e7
|
@ -174,10 +174,7 @@ no_write:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
redirty_out:
|
redirty_out:
|
||||||
dec_page_count(sbi, F2FS_DIRTY_META);
|
redirty_page_for_writepage(wbc, page);
|
||||||
wbc->pages_skipped++;
|
|
||||||
account_page_redirty(page);
|
|
||||||
set_page_dirty(page);
|
|
||||||
return AOP_WRITEPAGE_ACTIVATE;
|
return AOP_WRITEPAGE_ACTIVATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -798,10 +798,8 @@ static int f2fs_write_data_page(struct page *page,
|
||||||
* this page does not have to be written to disk.
|
* this page does not have to be written to disk.
|
||||||
*/
|
*/
|
||||||
offset = i_size & (PAGE_CACHE_SIZE - 1);
|
offset = i_size & (PAGE_CACHE_SIZE - 1);
|
||||||
if ((page->index >= end_index + 1) || !offset) {
|
if ((page->index >= end_index + 1) || !offset)
|
||||||
inode_dec_dirty_dents(inode);
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
|
||||||
|
|
||||||
zero_user_segment(page, offset, PAGE_CACHE_SIZE);
|
zero_user_segment(page, offset, PAGE_CACHE_SIZE);
|
||||||
write:
|
write:
|
||||||
|
@ -810,7 +808,6 @@ write:
|
||||||
|
|
||||||
/* Dentry blocks are controlled by checkpoint */
|
/* Dentry blocks are controlled by checkpoint */
|
||||||
if (S_ISDIR(inode->i_mode)) {
|
if (S_ISDIR(inode->i_mode)) {
|
||||||
inode_dec_dirty_dents(inode);
|
|
||||||
err = do_write_data_page(page, &fio);
|
err = do_write_data_page(page, &fio);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
@ -832,15 +829,14 @@ done:
|
||||||
|
|
||||||
clear_cold_data(page);
|
clear_cold_data(page);
|
||||||
out:
|
out:
|
||||||
|
inode_dec_dirty_dents(inode);
|
||||||
unlock_page(page);
|
unlock_page(page);
|
||||||
if (need_balance_fs)
|
if (need_balance_fs)
|
||||||
f2fs_balance_fs(sbi);
|
f2fs_balance_fs(sbi);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
redirty_out:
|
redirty_out:
|
||||||
wbc->pages_skipped++;
|
redirty_page_for_writepage(wbc, page);
|
||||||
account_page_redirty(page);
|
|
||||||
set_page_dirty(page);
|
|
||||||
return AOP_WRITEPAGE_ACTIVATE;
|
return AOP_WRITEPAGE_ACTIVATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1227,10 +1227,7 @@ static int f2fs_write_node_page(struct page *page,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
redirty_out:
|
redirty_out:
|
||||||
dec_page_count(sbi, F2FS_DIRTY_NODES);
|
redirty_page_for_writepage(wbc, page);
|
||||||
wbc->pages_skipped++;
|
|
||||||
account_page_redirty(page);
|
|
||||||
set_page_dirty(page);
|
|
||||||
return AOP_WRITEPAGE_ACTIVATE;
|
return AOP_WRITEPAGE_ACTIVATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче