Skip to content

Commit 1b65d3d

Browse files
Christoph Hellwigdjwong
authored andcommitted
xfs: remove xfs_start_page_writeback
This helper only has two callers, one of them with a constant error argument. Remove it to make pending changes to the code a little easier. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
1 parent 6d465e8 commit 1b65d3d

File tree

1 file changed

+20
-26
lines changed

1 file changed

+20
-26
lines changed

fs/xfs/xfs_aops.c

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -494,30 +494,6 @@ xfs_map_blocks(
494494
return 0;
495495
}
496496

497-
STATIC void
498-
xfs_start_page_writeback(
499-
struct page *page,
500-
int clear_dirty)
501-
{
502-
ASSERT(PageLocked(page));
503-
ASSERT(!PageWriteback(page));
504-
505-
/*
506-
* if the page was not fully cleaned, we need to ensure that the higher
507-
* layers come back to it correctly. That means we need to keep the page
508-
* dirty, and for WB_SYNC_ALL writeback we need to ensure the
509-
* PAGECACHE_TAG_TOWRITE index mark is not removed so another attempt to
510-
* write this page in this writeback sweep will be made.
511-
*/
512-
if (clear_dirty) {
513-
clear_page_dirty_for_io(page);
514-
set_page_writeback(page);
515-
} else
516-
set_page_writeback_keepwrite(page);
517-
518-
unlock_page(page);
519-
}
520-
521497
/*
522498
* Submit the bio for an ioend. We are passed an ioend with a bio attached to
523499
* it, and we submit that bio. The ioend may be used for multiple bio
@@ -858,6 +834,8 @@ xfs_writepage_map(
858834
}
859835

860836
ASSERT(wpc->ioend || list_empty(&submit_list));
837+
ASSERT(PageLocked(page));
838+
ASSERT(!PageWriteback(page));
861839

862840
/*
863841
* On error, we have to fail the ioend here because we have locked
@@ -877,7 +855,21 @@ xfs_writepage_map(
877855
* treated correctly on error.
878856
*/
879857
if (count) {
880-
xfs_start_page_writeback(page, !error);
858+
/*
859+
* If the page was not fully cleaned, we need to ensure that the
860+
* higher layers come back to it correctly. That means we need
861+
* to keep the page dirty, and for WB_SYNC_ALL writeback we need
862+
* to ensure the PAGECACHE_TAG_TOWRITE index mark is not removed
863+
* so another attempt to write this page in this writeback sweep
864+
* will be made.
865+
*/
866+
if (error) {
867+
set_page_writeback_keepwrite(page);
868+
} else {
869+
clear_page_dirty_for_io(page);
870+
set_page_writeback(page);
871+
}
872+
unlock_page(page);
881873

882874
/*
883875
* Preserve the original error if there was one, otherwise catch
@@ -902,7 +894,9 @@ xfs_writepage_map(
902894
* race with a partial page truncate on a sub-page block sized
903895
* filesystem. In that case we need to mark the page clean.
904896
*/
905-
xfs_start_page_writeback(page, 1);
897+
clear_page_dirty_for_io(page);
898+
set_page_writeback(page);
899+
unlock_page(page);
906900
end_page_writeback(page);
907901
}
908902

0 commit comments

Comments
 (0)