xfs: move extent zeroing to xfs_bmapi_allocate

Move the extent zeroing case there for the XFS_BMAPI_ZERO flag outside
the low-level allocator and into xfs_bmapi_allocate, where is still
is in transaction context, but outside the very lowlevel code where
it doesn't belong.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:
Christoph Hellwig
2019-10-30 12:25:00 -07:00
committed by Darrick J. Wong
parent be6cacbeea
commit fd638f1de1
4 changed files with 7 additions and 21 deletions

View File

@@ -3084,13 +3084,6 @@ xfs_alloc_vextent(
args->len);
#endif
/* Zero the extent if we were asked to do so */
if (args->datatype & XFS_ALLOC_USERDATA_ZERO) {
error = xfs_zero_extent(args->ip, args->fsbno, args->len);
if (error)
goto error0;
}
}
xfs_perag_put(args->pag);
return 0;