mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 11:37:06 +02:00
f2fs: Use a folio in __clone_blkaddrs()
Removes five hidden calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
1313057c36
commit
3dfcb2b43e
|
|
@ -1413,26 +1413,26 @@ static int __clone_blkaddrs(struct inode *src_inode, struct inode *dst_inode,
|
|||
|
||||
f2fs_put_dnode(&dn);
|
||||
} else {
|
||||
struct page *psrc, *pdst;
|
||||
struct folio *fsrc, *fdst;
|
||||
|
||||
psrc = f2fs_get_lock_data_page(src_inode,
|
||||
fsrc = f2fs_get_lock_data_folio(src_inode,
|
||||
src + i, true);
|
||||
if (IS_ERR(psrc))
|
||||
return PTR_ERR(psrc);
|
||||
pdst = f2fs_get_new_data_page(dst_inode, NULL, dst + i,
|
||||
if (IS_ERR(fsrc))
|
||||
return PTR_ERR(fsrc);
|
||||
fdst = f2fs_get_new_data_folio(dst_inode, NULL, dst + i,
|
||||
true);
|
||||
if (IS_ERR(pdst)) {
|
||||
f2fs_put_page(psrc, 1);
|
||||
return PTR_ERR(pdst);
|
||||
if (IS_ERR(fdst)) {
|
||||
f2fs_folio_put(fsrc, true);
|
||||
return PTR_ERR(fdst);
|
||||
}
|
||||
|
||||
f2fs_wait_on_page_writeback(pdst, DATA, true, true);
|
||||
f2fs_folio_wait_writeback(fdst, DATA, true, true);
|
||||
|
||||
memcpy_page(pdst, 0, psrc, 0, PAGE_SIZE);
|
||||
set_page_dirty(pdst);
|
||||
set_page_private_gcing(pdst);
|
||||
f2fs_put_page(pdst, 1);
|
||||
f2fs_put_page(psrc, 1);
|
||||
memcpy_folio(fdst, 0, fsrc, 0, PAGE_SIZE);
|
||||
folio_mark_dirty(fdst);
|
||||
set_page_private_gcing(&fdst->page);
|
||||
f2fs_folio_put(fdst, true);
|
||||
f2fs_folio_put(fsrc, true);
|
||||
|
||||
ret = f2fs_truncate_hole(src_inode,
|
||||
src + i, src + i + 1);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user