diff mbox series

[2/4] xfs: clean up quota reservation wrappers

Message ID 161142790628.2170981.7372348604132126587.stgit@magnolia (mailing list archive)
State New, archived
Headers show
Series xfs: minor cleanups of the quota functions | expand

Commit Message

Darrick J. Wong Jan. 23, 2021, 6:51 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Replace a couple of quota reservation macros with properly typechecked
static inline functions ahead of more restructuring in the next patches.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_quota.h |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Brian Foster Jan. 25, 2021, 3:13 p.m. UTC | #1
On Sat, Jan 23, 2021 at 10:51:46AM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Replace a couple of quota reservation macros with properly typechecked
> static inline functions ahead of more restructuring in the next patches.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/xfs_quota.h |    9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> 
> diff --git a/fs/xfs/xfs_quota.h b/fs/xfs/xfs_quota.h
> index 5a62398940d0..bd28d17941e7 100644
> --- a/fs/xfs/xfs_quota.h
> +++ b/fs/xfs/xfs_quota.h
> @@ -151,8 +151,13 @@ static inline int xfs_trans_reserve_quota_bydquots(struct xfs_trans *tp,
>  #define xfs_qm_unmount_quotas(mp)
>  #endif /* CONFIG_XFS_QUOTA */
>  
> -#define xfs_trans_unreserve_quota_nblks(tp, ip, nblks, ninos, flags) \
> -	xfs_trans_reserve_quota_nblks(tp, ip, -(nblks), -(ninos), flags)
> +static inline int
> +xfs_trans_unreserve_quota_nblks(struct xfs_trans *tp, struct xfs_inode *ip,
> +		int64_t nblks, long ninos, unsigned int flags)
> +{
> +	return xfs_trans_reserve_quota_nblks(tp, ip, -nblks, -ninos, flags);
> +}
> +
>  #define xfs_trans_reserve_quota(tp, mp, ud, gd, pd, nb, ni, f) \
>  	xfs_trans_reserve_quota_bydquots(tp, mp, ud, gd, pd, nb, ni, \
>  				f | XFS_QMOPT_RES_REGBLKS)
>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_quota.h b/fs/xfs/xfs_quota.h
index 5a62398940d0..bd28d17941e7 100644
--- a/fs/xfs/xfs_quota.h
+++ b/fs/xfs/xfs_quota.h
@@ -151,8 +151,13 @@  static inline int xfs_trans_reserve_quota_bydquots(struct xfs_trans *tp,
 #define xfs_qm_unmount_quotas(mp)
 #endif /* CONFIG_XFS_QUOTA */
 
-#define xfs_trans_unreserve_quota_nblks(tp, ip, nblks, ninos, flags) \
-	xfs_trans_reserve_quota_nblks(tp, ip, -(nblks), -(ninos), flags)
+static inline int
+xfs_trans_unreserve_quota_nblks(struct xfs_trans *tp, struct xfs_inode *ip,
+		int64_t nblks, long ninos, unsigned int flags)
+{
+	return xfs_trans_reserve_quota_nblks(tp, ip, -nblks, -ninos, flags);
+}
+
 #define xfs_trans_reserve_quota(tp, mp, ud, gd, pd, nb, ni, f) \
 	xfs_trans_reserve_quota_bydquots(tp, mp, ud, gd, pd, nb, ni, \
 				f | XFS_QMOPT_RES_REGBLKS)