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.c53
1 files changed, 8 insertions, 45 deletions
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
index 8867d0232fac..3ee0cd43edc0 100644
--- a/fs/xfs/xfs_dquot.c
+++ b/fs/xfs/xfs_dquot.c
@@ -832,47 +832,6 @@ restart:
832 return (0); 832 return (0);
833} 833}
834 834
835
836STATIC void
837xfs_qm_dqput_final(
838 struct xfs_dquot *dqp)
839{
840 struct xfs_quotainfo *qi = dqp->q_mount->m_quotainfo;
841 struct xfs_dquot *gdqp;
842 struct xfs_dquot *pdqp;
843
844 trace_xfs_dqput_free(dqp);
845
846 if (list_lru_add(&qi->qi_lru, &dqp->q_lru))
847 XFS_STATS_INC(xs_qm_dquot_unused);
848
849 /*
850 * If we just added a udquot to the freelist, then we want to release
851 * the gdquot/pdquot reference that it (probably) has. Otherwise it'll
852 * keep the gdquot/pdquot from getting reclaimed.
853 */
854 gdqp = dqp->q_gdquot;
855 if (gdqp) {
856 xfs_dqlock(gdqp);
857 dqp->q_gdquot = NULL;
858 }
859
860 pdqp = dqp->q_pdquot;
861 if (pdqp) {
862 xfs_dqlock(pdqp);
863 dqp->q_pdquot = NULL;
864 }
865 xfs_dqunlock(dqp);
866
867 /*
868 * If we had a group/project quota hint, release it now.
869 */
870 if (gdqp)
871 xfs_qm_dqput(gdqp);
872 if (pdqp)
873 xfs_qm_dqput(pdqp);
874}
875
876/* 835/*
877 * Release a reference to the dquot (decrement ref-count) and unlock it. 836 * Release a reference to the dquot (decrement ref-count) and unlock it.
878 * 837 *
@@ -888,10 +847,14 @@ xfs_qm_dqput(
888 847
889 trace_xfs_dqput(dqp); 848 trace_xfs_dqput(dqp);
890 849
891 if (--dqp->q_nrefs > 0) 850 if (--dqp->q_nrefs == 0) {
892 xfs_dqunlock(dqp); 851 struct xfs_quotainfo *qi = dqp->q_mount->m_quotainfo;
893 else 852 trace_xfs_dqput_free(dqp);
894 xfs_qm_dqput_final(dqp); 853
854 if (list_lru_add(&qi->qi_lru, &dqp->q_lru))
855 XFS_STATS_INC(xs_qm_dquot_unused);
856 }
857 xfs_dqunlock(dqp);
895} 858}
896 859
897/* 860/*