From: Christoph Hellwig Date: Mon, 10 Nov 2025 13:23:09 +0000 (+0100) Subject: xfs: move xfs_dquot_tree calls into xfs_qm_dqget_cache_{lookup,insert} X-Git-Tag: v6.19-rc1~164^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13d3c1a045628e8453c31bd49578053c093e7a02;p=thirdparty%2Flinux.git xfs: move xfs_dquot_tree calls into xfs_qm_dqget_cache_{lookup,insert} These are the low-level functions that needs them, so localize the (trivial) calculation of the radix tree root there. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Carlos Maiolino --- diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c index 1c9c17892874f..612ca682a5133 100644 --- a/fs/xfs/xfs_dquot.c +++ b/fs/xfs/xfs_dquot.c @@ -801,10 +801,11 @@ xfs_dq_get_next_id( static struct xfs_dquot * xfs_qm_dqget_cache_lookup( struct xfs_mount *mp, - struct xfs_quotainfo *qi, - struct radix_tree_root *tree, - xfs_dqid_t id) + xfs_dqid_t id, + xfs_dqtype_t type) { + struct xfs_quotainfo *qi = mp->m_quotainfo; + struct radix_tree_root *tree = xfs_dquot_tree(qi, type); struct xfs_dquot *dqp; restart: @@ -843,11 +844,12 @@ restart: static int xfs_qm_dqget_cache_insert( struct xfs_mount *mp, - struct xfs_quotainfo *qi, - struct radix_tree_root *tree, xfs_dqid_t id, + xfs_dqtype_t type, struct xfs_dquot *dqp) { + struct xfs_quotainfo *qi = mp->m_quotainfo; + struct radix_tree_root *tree = xfs_dquot_tree(qi, type); unsigned int nofs_flags; int error; @@ -905,8 +907,6 @@ xfs_qm_dqget( bool can_alloc, struct xfs_dquot **O_dqpp) { - struct xfs_quotainfo *qi = mp->m_quotainfo; - struct radix_tree_root *tree = xfs_dquot_tree(qi, type); struct xfs_dquot *dqp; int error; @@ -915,7 +915,7 @@ xfs_qm_dqget( return error; restart: - dqp = xfs_qm_dqget_cache_lookup(mp, qi, tree, id); + dqp = xfs_qm_dqget_cache_lookup(mp, id, type); if (dqp) goto found; @@ -923,7 +923,7 @@ restart: if (error) return error; - error = xfs_qm_dqget_cache_insert(mp, qi, tree, id, dqp); + error = xfs_qm_dqget_cache_insert(mp, id, type, dqp); if (error) { xfs_qm_dqdestroy(dqp); if (error == -EEXIST) { @@ -996,8 +996,6 @@ xfs_qm_dqget_inode( struct xfs_dquot **dqpp) { struct xfs_mount *mp = ip->i_mount; - struct xfs_quotainfo *qi = mp->m_quotainfo; - struct radix_tree_root *tree = xfs_dquot_tree(qi, type); struct xfs_dquot *dqp; xfs_dqid_t id; int error; @@ -1016,7 +1014,7 @@ xfs_qm_dqget_inode( id = xfs_qm_id_for_quotatype(ip, type); restart: - dqp = xfs_qm_dqget_cache_lookup(mp, qi, tree, id); + dqp = xfs_qm_dqget_cache_lookup(mp, id, type); if (dqp) goto found; @@ -1052,7 +1050,7 @@ restart: return -ESRCH; } - error = xfs_qm_dqget_cache_insert(mp, qi, tree, id, dqp); + error = xfs_qm_dqget_cache_insert(mp, id, type, dqp); if (error) { xfs_qm_dqdestroy(dqp); if (error == -EEXIST) {