Skip to content

Commit

Permalink
ocfs2: don't use write_one_page in ocfs2_duplicate_clusters_by_page
Browse files Browse the repository at this point in the history
Use filemap_write_and_wait_range to write back the range of the dirty
page instead of write_one_page in preparation of removing write_one_page
and eventually ->writepage.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Christoph Hellwig authored and Al Viro committed Mar 13, 2023
1 parent 9e22031 commit 8e4bfd1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions fs/ocfs2/refcounttree.c
Original file line number Diff line number Diff line change
Expand Up @@ -2952,10 +2952,11 @@ int ocfs2_duplicate_clusters_by_page(handle_t *handle,
*/
if (PAGE_SIZE <= OCFS2_SB(sb)->s_clustersize) {
if (PageDirty(page)) {
/*
* write_on_page will unlock the page on return
*/
ret = write_one_page(page);
unlock_page(page);
put_page(page);

ret = filemap_write_and_wait_range(mapping,
offset, map_end - 1);
goto retry;
}
}
Expand Down

0 comments on commit 8e4bfd1

Please sign in to comment.