aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dquot.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2012-03-13 04:52:33 -0400
committerBen Myers <bpm@sgi.com>2012-03-14 12:09:06 -0400
commit48776fd22344ad80adcbac0abc9c0da60c6481d2 (patch)
tree8ab09fce19aab58e0e451d16c98ff7d1e84dcc53 /fs/xfs/xfs_dquot.c
parent8f639ddea0c4978ae9b4e46ea041c9e5afe0ee8d (diff)
xfs: use common code for quota statistics
Switch the quota code over to use the generic XFS statistics infrastructure. While the legacy /proc/fs/xfs/xqm and /proc/fs/xfs/xqmstats interfaces are preserved for now the statistics that still have a meaning with the current code are now also available from /proc/fs/xfs/stats. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_dquot.c')
-rw-r--r--fs/xfs/xfs_dquot.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
index 71e615fef174..98d7e25947fa 100644
--- a/fs/xfs/xfs_dquot.c
+++ b/fs/xfs/xfs_dquot.c
@@ -74,7 +74,7 @@ xfs_qm_dqdestroy(
74 mutex_destroy(&dqp->q_qlock); 74 mutex_destroy(&dqp->q_qlock);
75 kmem_zone_free(xfs_Gqm->qm_dqzone, dqp); 75 kmem_zone_free(xfs_Gqm->qm_dqzone, dqp);
76 76
77 atomic_dec(&xfs_Gqm->qm_totaldquots); 77 XFS_STATS_DEC(xs_qm_dquot);
78} 78}
79 79
80/* 80/*
@@ -516,7 +516,7 @@ xfs_qm_dqread(
516 if (!(type & XFS_DQ_USER)) 516 if (!(type & XFS_DQ_USER))
517 lockdep_set_class(&dqp->q_qlock, &xfs_dquot_other_class); 517 lockdep_set_class(&dqp->q_qlock, &xfs_dquot_other_class);
518 518
519 atomic_inc(&xfs_Gqm->qm_totaldquots); 519 XFS_STATS_INC(xs_qm_dquot);
520 520
521 trace_xfs_dqread(dqp); 521 trace_xfs_dqread(dqp);
522 522
@@ -712,12 +712,12 @@ restart:
712 */ 712 */
713 switch (xfs_qm_dqlookup(mp, id, h, O_dqpp)) { 713 switch (xfs_qm_dqlookup(mp, id, h, O_dqpp)) {
714 case -1: 714 case -1:
715 XQM_STATS_INC(xqmstats.xs_qm_dquot_dups); 715 XFS_STATS_INC(xs_qm_dquot_dups);
716 mutex_unlock(&h->qh_lock); 716 mutex_unlock(&h->qh_lock);
717 delay(1); 717 delay(1);
718 goto restart; 718 goto restart;
719 case 0: 719 case 0:
720 XQM_STATS_INC(xqmstats.xs_qm_dqcachehits); 720 XFS_STATS_INC(xs_qm_dqcachehits);
721 /* 721 /*
722 * The dquot was found, moved to the front of the chain, 722 * The dquot was found, moved to the front of the chain,
723 * taken off the freelist if it was on it, and locked 723 * taken off the freelist if it was on it, and locked
@@ -729,7 +729,7 @@ restart:
729 trace_xfs_dqget_hit(*O_dqpp); 729 trace_xfs_dqget_hit(*O_dqpp);
730 return 0; /* success */ 730 return 0; /* success */
731 default: 731 default:
732 XQM_STATS_INC(xqmstats.xs_qm_dqcachemisses); 732 XFS_STATS_INC(xs_qm_dqcachemisses);
733 break; 733 break;
734 } 734 }
735 735
@@ -804,7 +804,7 @@ restart:
804 xfs_qm_dqput(tmpdqp); 804 xfs_qm_dqput(tmpdqp);
805 mutex_unlock(&h->qh_lock); 805 mutex_unlock(&h->qh_lock);
806 xfs_qm_dqdestroy(dqp); 806 xfs_qm_dqdestroy(dqp);
807 XQM_STATS_INC(xqmstats.xs_qm_dquot_dups); 807 XFS_STATS_INC(xs_qm_dquot_dups);
808 goto restart; 808 goto restart;
809 default: 809 default:
810 break; 810 break;
@@ -873,6 +873,7 @@ recurse:
873 if (list_empty(&dqp->q_freelist)) { 873 if (list_empty(&dqp->q_freelist)) {
874 list_add_tail(&dqp->q_freelist, &xfs_Gqm->qm_dqfrlist); 874 list_add_tail(&dqp->q_freelist, &xfs_Gqm->qm_dqfrlist);
875 xfs_Gqm->qm_dqfrlist_cnt++; 875 xfs_Gqm->qm_dqfrlist_cnt++;
876 XFS_STATS_INC(xs_qm_dquot_unused);
876 } 877 }
877 mutex_unlock(&xfs_Gqm->qm_dqfrlist_lock); 878 mutex_unlock(&xfs_Gqm->qm_dqfrlist_lock);
878 879
@@ -1178,6 +1179,7 @@ xfs_qm_dqpurge(
1178 ASSERT(!list_empty(&dqp->q_freelist)); 1179 ASSERT(!list_empty(&dqp->q_freelist));
1179 list_del_init(&dqp->q_freelist); 1180 list_del_init(&dqp->q_freelist);
1180 xfs_Gqm->qm_dqfrlist_cnt--; 1181 xfs_Gqm->qm_dqfrlist_cnt--;
1182 XFS_STATS_DEC(xs_qm_dquot_unused);
1181 mutex_unlock(&xfs_Gqm->qm_dqfrlist_lock); 1183 mutex_unlock(&xfs_Gqm->qm_dqfrlist_lock);
1182 1184
1183 xfs_qm_dqdestroy(dqp); 1185 xfs_qm_dqdestroy(dqp);