提交 ba803695 编写于 作者: D Darrick J. Wong 提交者: Zheng Zengkai

xfs: clean up quota reservation callsites

mainline-inclusion
from mainline-v5.13-rc4
commit 	4abe21ad
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I4KIAO
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/fs/xfs?h=v5.16-rc4&id=4abe21ad67a7b9dc6844f55e91a6e3ef81879d42

----------------------------------------------------------------------

Convert a few xfs_trans_*reserve* callsites that are open-coding other
convenience functions.
Signed-off-by: NDarrick J. Wong <djwong@kernel.org>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NBrian Foster <bfoster@redhat.com>
Signed-off-by: NLihong Kou <koulihong@huawei.com>
Reviewed-by: NZhang Yi <yi.zhang@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 8d6f9ca3
...@@ -4825,8 +4825,7 @@ xfs_bmap_del_extent_delay( ...@@ -4825,8 +4825,7 @@ xfs_bmap_del_extent_delay(
* sb counters as we might have to borrow some blocks for the * sb counters as we might have to borrow some blocks for the
* indirect block accounting. * indirect block accounting.
*/ */
error = xfs_trans_reserve_quota_nblks(NULL, ip, error = xfs_trans_unreserve_quota_nblks(NULL, ip, del->br_blockcount, 0,
-((long)del->br_blockcount), 0,
isrt ? XFS_QMOPT_RES_RTBLKS : XFS_QMOPT_RES_REGBLKS); isrt ? XFS_QMOPT_RES_RTBLKS : XFS_QMOPT_RES_REGBLKS);
if (error) if (error)
return error; return error;
......
...@@ -879,8 +879,8 @@ xfs_unmap_extent( ...@@ -879,8 +879,8 @@ xfs_unmap_extent(
} }
xfs_ilock(ip, XFS_ILOCK_EXCL); xfs_ilock(ip, XFS_ILOCK_EXCL);
error = xfs_trans_reserve_quota(tp, mp, ip->i_udquot, ip->i_gdquot, error = xfs_trans_reserve_quota_nblks(tp, ip, resblks, 0,
ip->i_pdquot, resblks, 0, XFS_QMOPT_RES_REGBLKS); XFS_QMOPT_RES_REGBLKS);
if (error) if (error)
goto out_trans_cancel; goto out_trans_cancel;
......
...@@ -508,8 +508,8 @@ xfs_reflink_cancel_cow_blocks( ...@@ -508,8 +508,8 @@ xfs_reflink_cancel_cow_blocks(
xfs_bmap_del_extent_cow(ip, &icur, &got, &del); xfs_bmap_del_extent_cow(ip, &icur, &got, &del);
/* Remove the quota reservation */ /* Remove the quota reservation */
error = xfs_trans_reserve_quota_nblks(NULL, ip, error = xfs_trans_unreserve_quota_nblks(NULL, ip,
-(long)del.br_blockcount, 0, del.br_blockcount, 0,
XFS_QMOPT_RES_REGBLKS); XFS_QMOPT_RES_REGBLKS);
if (error) if (error)
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册