diff options
author | Darrick J. Wong <djwong@kernel.org> | 2021-01-27 01:33:29 +0100 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-02-03 18:18:49 +0100 |
commit | 3a1af6c317d0a55524f39079183be107be4c1f39 (patch) | |
tree | fcbd9018cd563c5e304a41ac05945ed4f2e831c7 /fs/xfs/xfs_trans.h | |
parent | xfs: reserve data and rt quota at the same time (diff) | |
download | linux-3a1af6c317d0a55524f39079183be107be4c1f39.tar.xz linux-3a1af6c317d0a55524f39079183be107be4c1f39.zip |
xfs: refactor common transaction/inode/quota allocation idiom
Create a new helper xfs_trans_alloc_inode that allocates a transaction,
locks and joins an inode to it, and then reserves the appropriate amount
of quota against that transction. Then replace all the open-coded
idioms with a single call to this helper.
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.h')
-rw-r--r-- | fs/xfs/xfs_trans.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h index 084658946cc8..aa50be244432 100644 --- a/fs/xfs/xfs_trans.h +++ b/fs/xfs/xfs_trans.h @@ -268,4 +268,7 @@ xfs_trans_item_relog( return lip->li_ops->iop_relog(lip, tp); } +int xfs_trans_alloc_inode(struct xfs_inode *ip, struct xfs_trans_res *resv, + unsigned int dblocks, bool force, struct xfs_trans **tpp); + #endif /* __XFS_TRANS_H__ */ |