]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: clean up quota reservation callsites
authorDarrick J. Wong <djwong@kernel.org>
Tue, 6 Apr 2021 20:38:10 +0000 (16:38 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Tue, 6 Apr 2021 20:38:10 +0000 (16:38 -0400)
Source kernel commit: 4abe21ad67a7b9dc6844f55e91a6e3ef81879d42

Convert a few xfs_trans_*reserve* callsites that are open-coding other
convenience functions.

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>
libxfs/libxfs_priv.h
libxfs/xfs_bmap.c

index f1b1ca1074e6b08017b55f6d2203857da1c76a1f..084da32d60141478584e0577fc2509e0eec97858 100644 (file)
@@ -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))
index 7ca22b10974a29177f159a3886a6d8413ac700ec..dbff68d12940c25ce097f02866da3f33e86a9e02 100644 (file)
@@ -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;