xfs: clean up icreate quota reservation calls

Create a proper helper so that inode creation calls can reserve quota
with a dedicated function.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
This commit is contained in:
Darrick J. Wong 2021-01-22 16:48:34 -08:00
parent 35b1101099
commit ad4a747397
4 changed files with 31 additions and 10 deletions

View file

@ -1037,8 +1037,7 @@ xfs_create(
/*
* Reserve disk quota and the inode.
*/
error = xfs_trans_reserve_quota(tp, mp, udqp, gdqp,
pdqp, resblks, 1, 0);
error = xfs_trans_reserve_quota_icreate(tp, udqp, gdqp, pdqp, resblks);
if (error)
goto out_trans_cancel;
@ -1169,8 +1168,7 @@ xfs_create_tmpfile(
if (error)
goto out_release_inode;
error = xfs_trans_reserve_quota(tp, mp, udqp, gdqp,
pdqp, resblks, 1, 0);
error = xfs_trans_reserve_quota_icreate(tp, udqp, gdqp, pdqp, resblks);
if (error)
goto out_trans_cancel;