aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_qm.c
diff options
context:
space:
mode:
authorBill O'Donnell <billodo@redhat.com>2015-10-12 03:21:22 -0400
committerDave Chinner <david@fromorbit.com>2015-10-12 03:21:22 -0400
commitff6d6af2351caea7db681f4539d0d893e400557a (patch)
tree2e3d1d4a57a478183edf6e55a0c257a36a9fee04 /fs/xfs/xfs_qm.c
parent225e4635580ce9fb12f8a2dc88473161cd64dbf6 (diff)
xfs: per-filesystem stats counter implementation
This patch modifies the stats counting macros and the callers to those macros to properly increment, decrement, and add-to the xfs stats counts. The counts for global and per-fs stats are correctly advanced, and cleared by writing a "1" to the corresponding clear file. global counts: /sys/fs/xfs/stats/stats per-fs counts: /sys/fs/xfs/sda*/stats/stats global clear: /sys/fs/xfs/stats/stats_clear per-fs clear: /sys/fs/xfs/sda*/stats/stats_clear [dchinner: cleaned up macro variables, removed CONFIG_FS_PROC around stats structures and macros. ] Signed-off-by: Bill O'Donnell <billodo@redhat.com> Reviewed-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_qm.c')
-rw-r--r--fs/xfs/xfs_qm.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index eac9549efd52..7af7648c06c6 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -184,7 +184,7 @@ xfs_qm_dqpurge(
184 */ 184 */
185 ASSERT(!list_empty(&dqp->q_lru)); 185 ASSERT(!list_empty(&dqp->q_lru));
186 list_lru_del(&qi->qi_lru, &dqp->q_lru); 186 list_lru_del(&qi->qi_lru, &dqp->q_lru);
187 XFS_STATS_DEC(xs_qm_dquot_unused); 187 XFS_STATS_DEC(mp, xs_qm_dquot_unused);
188 188
189 xfs_qm_dqdestroy(dqp); 189 xfs_qm_dqdestroy(dqp);
190 return 0; 190 return 0;
@@ -448,11 +448,11 @@ xfs_qm_dquot_isolate(
448 */ 448 */
449 if (dqp->q_nrefs) { 449 if (dqp->q_nrefs) {
450 xfs_dqunlock(dqp); 450 xfs_dqunlock(dqp);
451 XFS_STATS_INC(xs_qm_dqwants); 451 XFS_STATS_INC(dqp->q_mount, xs_qm_dqwants);
452 452
453 trace_xfs_dqreclaim_want(dqp); 453 trace_xfs_dqreclaim_want(dqp);
454 list_lru_isolate(lru, &dqp->q_lru); 454 list_lru_isolate(lru, &dqp->q_lru);
455 XFS_STATS_DEC(xs_qm_dquot_unused); 455 XFS_STATS_DEC(dqp->q_mount, xs_qm_dquot_unused);
456 return LRU_REMOVED; 456 return LRU_REMOVED;
457 } 457 }
458 458
@@ -496,19 +496,19 @@ xfs_qm_dquot_isolate(
496 496
497 ASSERT(dqp->q_nrefs == 0); 497 ASSERT(dqp->q_nrefs == 0);
498 list_lru_isolate_move(lru, &dqp->q_lru, &isol->dispose); 498 list_lru_isolate_move(lru, &dqp->q_lru, &isol->dispose);
499 XFS_STATS_DEC(xs_qm_dquot_unused); 499 XFS_STATS_DEC(dqp->q_mount, xs_qm_dquot_unused);
500 trace_xfs_dqreclaim_done(dqp); 500 trace_xfs_dqreclaim_done(dqp);
501 XFS_STATS_INC(xs_qm_dqreclaims); 501 XFS_STATS_INC(dqp->q_mount, xs_qm_dqreclaims);
502 return LRU_REMOVED; 502 return LRU_REMOVED;
503 503
504out_miss_busy: 504out_miss_busy:
505 trace_xfs_dqreclaim_busy(dqp); 505 trace_xfs_dqreclaim_busy(dqp);
506 XFS_STATS_INC(xs_qm_dqreclaim_misses); 506 XFS_STATS_INC(dqp->q_mount, xs_qm_dqreclaim_misses);
507 return LRU_SKIP; 507 return LRU_SKIP;
508 508
509out_unlock_dirty: 509out_unlock_dirty:
510 trace_xfs_dqreclaim_busy(dqp); 510 trace_xfs_dqreclaim_busy(dqp);
511 XFS_STATS_INC(xs_qm_dqreclaim_misses); 511 XFS_STATS_INC(dqp->q_mount, xs_qm_dqreclaim_misses);
512 xfs_dqunlock(dqp); 512 xfs_dqunlock(dqp);
513 spin_lock(lru_lock); 513 spin_lock(lru_lock);
514 return LRU_RETRY; 514 return LRU_RETRY;