From: Darrick J. Wong Date: Tue, 6 Apr 2021 20:38:10 +0000 (-0400) Subject: xfs: clean up quota reservation callsites X-Git-Tag: v5.12.0-rc0~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7cd46253fa1356086a61050609b4cca38d10c9c8;p=thirdparty%2Fxfsprogs-dev.git xfs: clean up quota reservation callsites Source kernel commit: 4abe21ad67a7b9dc6844f55e91a6e3ef81879d42 Convert a few xfs_trans_*reserve* callsites that are open-coding other convenience functions. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Brian Foster Signed-off-by: Eric Sandeen --- diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h index f1b1ca107..084da32d6 100644 --- a/libxfs/libxfs_priv.h +++ b/libxfs/libxfs_priv.h @@ -495,7 +495,11 @@ void __xfs_buf_mark_corrupt(struct xfs_buf *bp, xfs_failaddr_t fa); /* quota bits */ #define xfs_trans_mod_dquot_byino(t,i,f,d) ((void) 0) #define xfs_trans_reserve_quota_nblks(t,i,b,n,f) (0) -#define xfs_trans_unreserve_quota_nblks(t,i,b,n,f) ((void) 0) + +/* hack too silence gcc */ +static inline int retzero(void) { return 0; } +#define xfs_trans_unreserve_quota_nblks(t,i,b,n,f) retzero() + #define xfs_qm_dqattach(i) (0) #define uuid_copy(s,d) platform_uuid_copy((s),(d)) diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index 7ca22b109..dbff68d12 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -4930,8 +4930,7 @@ xfs_bmap_del_extent_delay( * sb counters as we might have to borrow some blocks for the * indirect block accounting. */ - error = xfs_trans_reserve_quota_nblks(NULL, ip, - -((long)del->br_blockcount), 0, + error = xfs_trans_unreserve_quota_nblks(NULL, ip, del->br_blockcount, 0, isrt ? XFS_QMOPT_RES_RTBLKS : XFS_QMOPT_RES_REGBLKS); if (error) return error;