Source kernel commit:
3de4eb106fcc97f086b78bd17a0c3529691e8259
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>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
uint blocks, uint rtextents, uint flags,
struct xfs_trans **tpp);
int libxfs_trans_alloc_inode(struct xfs_inode *ip, struct xfs_trans_res *resv,
- unsigned int dblocks, bool force, struct xfs_trans **tpp);
+ unsigned int dblocks, unsigned int rblocks, bool force,
+ struct xfs_trans **tpp);
int libxfs_trans_alloc_rollable(struct xfs_mount *mp, uint blocks,
struct xfs_trans **tpp);
int libxfs_trans_alloc_empty(struct xfs_mount *mp, struct xfs_trans **tpp);
struct xfs_inode *ip,
struct xfs_trans_res *resv,
unsigned int dblocks,
+ unsigned int rblocks,
bool force,
struct xfs_trans **tpp)
{
struct xfs_mount *mp = ip->i_mount;
int error;
- error = libxfs_trans_alloc(mp, resv, dblocks, 0,
+ error = libxfs_trans_alloc(mp, resv, dblocks,
+ rblocks / mp->m_sb.sb_rextsize,
force ? XFS_TRANS_RESERVE : 0, &tp);
if (error)
return error;
* Root fork attributes can use reserved data blocks for this
* operation if necessary
*/
- error = xfs_trans_alloc_inode(dp, &tres, total, rsvd, &args->trans);
+ error = xfs_trans_alloc_inode(dp, &tres, total, 0, rsvd, &args->trans);
if (error)
return error;
blks = XFS_ADDAFORK_SPACE_RES(mp);
- error = xfs_trans_alloc_inode(ip, &M_RES(mp)->tr_addafork, blks,
+ error = xfs_trans_alloc_inode(ip, &M_RES(mp)->tr_addafork, blks, 0,
rsvd, &tp);
if (error)
return error;