]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: create convenience wrappers for incore quota block reservations
authorDarrick J. Wong <djwong@kernel.org>
Tue, 6 Apr 2021 20:38:16 +0000 (16:38 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Tue, 6 Apr 2021 20:38:16 +0000 (16:38 -0400)
Source kernel commit: 8554650003b8a66f3dd357692ab73101d088d938

Create a couple of convenience wrappers for creating and deleting quota
block reservations against future changes.

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 084da32d60141478584e0577fc2509e0eec97858..e37d5933f59dde2994cc3c1a3a83fd3b04afe88e 100644 (file)
@@ -499,8 +499,10 @@ void __xfs_buf_mark_corrupt(struct xfs_buf *bp, xfs_failaddr_t fa);
 /* 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_quota_unreserve_blkres(i,b)                retzero()
 
-#define xfs_qm_dqattach(i)                             (0)
+#define xfs_quota_reserve_blkres(i,b)          (0)
+#define xfs_qm_dqattach(i)                     (0)
 
 #define uuid_copy(s,d)         platform_uuid_copy((s),(d))
 #define uuid_equal(s,d)                (platform_uuid_compare((s),(d)) == 0)
index dbff68d12940c25ce097f02866da3f33e86a9e02..2866134a6d54ebaad39c27620c941e7945ce1e22 100644 (file)
@@ -4090,8 +4090,7 @@ xfs_bmapi_reserve_delalloc(
         * blocks.  This number gets adjusted later.  We return if we haven't
         * allocated blocks already inside this loop.
         */
-       error = xfs_trans_reserve_quota_nblks(NULL, ip, (long)alen, 0,
-                                               XFS_QMOPT_RES_REGBLKS);
+       error = xfs_quota_reserve_blkres(ip, alen);
        if (error)
                return error;
 
@@ -4137,8 +4136,7 @@ out_unreserve_blocks:
        xfs_mod_fdblocks(mp, alen, false);
 out_unreserve_quota:
        if (XFS_IS_QUOTA_ON(mp))
-               xfs_trans_unreserve_quota_nblks(NULL, ip, (long)alen, 0,
-                                               XFS_QMOPT_RES_REGBLKS);
+               xfs_quota_unreserve_blkres(ip, alen);
        return error;
 }
 
@@ -4930,8 +4928,8 @@ xfs_bmap_del_extent_delay(
         * sb counters as we might have to borrow some blocks for the
         * indirect block accounting.
         */
-       error = xfs_trans_unreserve_quota_nblks(NULL, ip, del->br_blockcount, 0,
-                       isrt ? XFS_QMOPT_RES_RTBLKS : XFS_QMOPT_RES_REGBLKS);
+       ASSERT(!isrt);
+       error = xfs_quota_unreserve_blkres(ip, del->br_blockcount);
        if (error)
                return error;
        ip->i_delayed_blks -= del->br_blockcount;