summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_trans.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-01-26 16:44:07 -0800
committerDarrick J. Wong <djwong@kernel.org>2021-02-03 09:18:49 -0800
commit3de4eb106fcc97f086b78bd17a0c3529691e8259 (patch)
treed7592a8b476426a1429fb72ee2af3b0931766c58 /fs/xfs/xfs_trans.c
parent3a1af6c317d0a55524f39079183be107be4c1f39 (diff)
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>
Diffstat (limited to 'fs/xfs/xfs_trans.c')
-rw-r--r--fs/xfs/xfs_trans.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index 156b9ed8534f..151f274eee43 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;