aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dquot.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_dquot.c')
-rw-r--r--fs/xfs/xfs_dquot.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
index 044e97a33c8d..0adf27ecf3f1 100644
--- a/fs/xfs/xfs_dquot.c
+++ b/fs/xfs/xfs_dquot.c
@@ -570,13 +570,13 @@ xfs_qm_dqtobp(
570 xfs_buf_t **O_bpp, 570 xfs_buf_t **O_bpp,
571 uint flags) 571 uint flags)
572{ 572{
573 xfs_bmbt_irec_t map; 573 struct xfs_bmbt_irec map;
574 int nmaps = 1, error; 574 int nmaps = 1, error;
575 xfs_buf_t *bp; 575 struct xfs_buf *bp;
576 xfs_inode_t *quotip = XFS_DQ_TO_QIP(dqp); 576 struct xfs_inode *quotip = xfs_dq_to_quota_inode(dqp);
577 xfs_mount_t *mp = dqp->q_mount; 577 struct xfs_mount *mp = dqp->q_mount;
578 xfs_dqid_t id = be32_to_cpu(dqp->q_core.d_id); 578 xfs_dqid_t id = be32_to_cpu(dqp->q_core.d_id);
579 xfs_trans_t *tp = (tpp ? *tpp : NULL); 579 struct xfs_trans *tp = (tpp ? *tpp : NULL);
580 580
581 dqp->q_fileoffset = (xfs_fileoff_t)id / mp->m_quotainfo->qi_dqperchunk; 581 dqp->q_fileoffset = (xfs_fileoff_t)id / mp->m_quotainfo->qi_dqperchunk;
582 582
@@ -804,7 +804,7 @@ xfs_qm_dqget(
804 xfs_dquot_t **O_dqpp) /* OUT : locked incore dquot */ 804 xfs_dquot_t **O_dqpp) /* OUT : locked incore dquot */
805{ 805{
806 struct xfs_quotainfo *qi = mp->m_quotainfo; 806 struct xfs_quotainfo *qi = mp->m_quotainfo;
807 struct radix_tree_root *tree = XFS_DQUOT_TREE(qi, type); 807 struct radix_tree_root *tree = xfs_dquot_tree(qi, type);
808 struct xfs_dquot *dqp; 808 struct xfs_dquot *dqp;
809 int error; 809 int error;
810 810
@@ -936,6 +936,7 @@ xfs_qm_dqput_final(
936{ 936{
937 struct xfs_quotainfo *qi = dqp->q_mount->m_quotainfo; 937 struct xfs_quotainfo *qi = dqp->q_mount->m_quotainfo;
938 struct xfs_dquot *gdqp; 938 struct xfs_dquot *gdqp;
939 struct xfs_dquot *pdqp;
939 940
940 trace_xfs_dqput_free(dqp); 941 trace_xfs_dqput_free(dqp);
941 942
@@ -949,21 +950,29 @@ xfs_qm_dqput_final(
949 950
950 /* 951 /*
951 * If we just added a udquot to the freelist, then we want to release 952 * If we just added a udquot to the freelist, then we want to release
952 * the gdquot reference that it (probably) has. Otherwise it'll keep 953 * the gdquot/pdquot reference that it (probably) has. Otherwise it'll
953 * the gdquot from getting reclaimed. 954 * keep the gdquot/pdquot from getting reclaimed.
954 */ 955 */
955 gdqp = dqp->q_gdquot; 956 gdqp = dqp->q_gdquot;
956 if (gdqp) { 957 if (gdqp) {
957 xfs_dqlock(gdqp); 958 xfs_dqlock(gdqp);
958 dqp->q_gdquot = NULL; 959 dqp->q_gdquot = NULL;
959 } 960 }
961
962 pdqp = dqp->q_pdquot;
963 if (pdqp) {
964 xfs_dqlock(pdqp);
965 dqp->q_pdquot = NULL;
966 }
960 xfs_dqunlock(dqp); 967 xfs_dqunlock(dqp);
961 968
962 /* 969 /*
963 * If we had a group quota hint, release it now. 970 * If we had a group/project quota hint, release it now.
964 */ 971 */
965 if (gdqp) 972 if (gdqp)
966 xfs_qm_dqput(gdqp); 973 xfs_qm_dqput(gdqp);
974 if (pdqp)
975 xfs_qm_dqput(pdqp);
967} 976}
968 977
969/* 978/*