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>
This commit is contained in:
@ -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__ */
|
||||
|
Reference in New Issue
Block a user