xfs: allow reservation of rtblocks with xfs_trans_alloc_inode
Make it so that we can reserve rt blocks with the xfs_trans_alloc_inode
wrapper function, then convert a few more callsites.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index 156b9ed..151f274 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -1038,6 +1038,7 @@ xfs_trans_alloc_inode(
struct xfs_inode *ip,
struct xfs_trans_res *resv,
unsigned int dblocks,
+ unsigned int rblocks,
bool force,
struct xfs_trans **tpp)
{
@@ -1045,7 +1046,8 @@ xfs_trans_alloc_inode(
struct xfs_mount *mp = ip->i_mount;
int error;
- error = xfs_trans_alloc(mp, resv, dblocks, 0,
+ error = xfs_trans_alloc(mp, resv, dblocks,
+ rblocks / mp->m_sb.sb_rextsize,
force ? XFS_TRANS_RESERVE : 0, &tp);
if (error)
return error;
@@ -1060,7 +1062,7 @@ xfs_trans_alloc_inode(
goto out_cancel;
}
- error = xfs_trans_reserve_quota_nblks(tp, ip, dblocks, 0, force);
+ error = xfs_trans_reserve_quota_nblks(tp, ip, dblocks, rblocks, force);
if (error)
goto out_cancel;