xfs: only reclaim unwritten COW extents periodically

We only want to reclaim preallocations from our periodic work item.
Currently this is archived by looking for a dirty inode, but that check
is rather fragile.  Instead add a flag to xfs_reflink_cancel_cow_* so
that the caller can ask for just cancelling unwritten extents in the COW
fork.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
[darrick: fix typos in commit message]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:
Christoph Hellwig
2017-03-07 16:45:58 -08:00
committed by Darrick J. Wong
parent c771c14baa
commit 3802a34532
6 changed files with 22 additions and 13 deletions

View File

@@ -293,7 +293,7 @@ xfs_end_io(
goto done;
if (ioend->io_bio->bi_error) {
error = xfs_reflink_cancel_cow_range(ip,
ioend->io_offset, ioend->io_size);
ioend->io_offset, ioend->io_size, true);
goto done;
}
error = xfs_reflink_end_cow(ip, ioend->io_offset,