]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: open code end_buffer_async_write in xfs_finish_page_writeback
authorChristoph Hellwig <hch@lst.de>
Sat, 2 Sep 2017 16:53:41 +0000 (09:53 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Sun, 3 Sep 2017 17:40:45 +0000 (10:40 -0700)
commitc6732ea58adfda27630a5808536eda5eddf0e299
treec0acfb3c83991b4fba5b98a907a1cba0fe75310c
parent9c95852ff0a3668a8b52a08704c4383fc952dff3
xfs: open code end_buffer_async_write in xfs_finish_page_writeback

Our loop in xfs_finish_page_writeback, which iterates over all buffer
heads in a page and then calls end_buffer_async_write, which also
iterates over all buffers in the page to check if any I/O is in flight
is not only inefficient, but also potentially dangerous as
end_buffer_async_write can cause the page and all buffers to be freed.

Replace it with a single loop that does the work of end_buffer_async_write
on a per-page basis.

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>
fs/xfs/xfs_aops.c