Commit 1db986a839d8acf8ad809c876f1154f2e672d3af

Authored by Tao Ma
1 parent 38877a4379

ocfs2: Remove masklog ML_QUOTA.

Remove mlog(0) from fs/ocfs2/quota_global.c and
the masklog QUOTA.

Signed-off-by: Tao Ma <boyu.mt@taobao.com>

Showing 4 changed files with 90 additions and 14 deletions Side-by-side Diff

fs/ocfs2/cluster/masklog.c
... ... @@ -102,7 +102,6 @@
102 102 define_mask(CONN),
103 103 define_mask(QUORUM),
104 104 define_mask(EXPORT),
105   - define_mask(QUOTA),
106 105 define_mask(BASTS),
107 106 define_mask(CLUSTER),
108 107 define_mask(ERROR),
fs/ocfs2/cluster/masklog.h
... ... @@ -104,7 +104,6 @@
104 104 #define ML_CONN 0x0000000004000000ULL /* net connection management */
105 105 #define ML_QUORUM 0x0000000008000000ULL /* net connection quorum */
106 106 #define ML_EXPORT 0x0000000010000000ULL /* ocfs2 export operations */
107   -#define ML_QUOTA 0x0000000040000000ULL /* ocfs2 quota operations */
108 107 #define ML_BASTS 0x0000000100000000ULL /* dlmglue asts and basts */
109 108 #define ML_CLUSTER 0x0000000400000000ULL /* cluster stack */
110 109  
fs/ocfs2/ocfs2_trace.h
... ... @@ -110,6 +110,25 @@
110 110 TP_PROTO(int val1, int val2), \
111 111 TP_ARGS(val1, val2))
112 112  
  113 +DECLARE_EVENT_CLASS(ocfs2__uint_int,
  114 + TP_PROTO(unsigned int value1, int value2),
  115 + TP_ARGS(value1, value2),
  116 + TP_STRUCT__entry(
  117 + __field(unsigned int, value1)
  118 + __field(int, value2)
  119 + ),
  120 + TP_fast_assign(
  121 + __entry->value1 = value1;
  122 + __entry->value2 = value2;
  123 + ),
  124 + TP_printk("%u %d", __entry->value1, __entry->value2)
  125 +);
  126 +
  127 +#define DEFINE_OCFS2_UINT_INT_EVENT(name) \
  128 +DEFINE_EVENT(ocfs2__uint_int, name, \
  129 + TP_PROTO(unsigned int val1, int val2), \
  130 + TP_ARGS(val1, val2))
  131 +
113 132 DECLARE_EVENT_CLASS(ocfs2__uint_uint,
114 133 TP_PROTO(unsigned int value1, unsigned int value2),
115 134 TP_ARGS(value1, value2),
... ... @@ -1935,6 +1954,65 @@
1935 1954 DEFINE_OCFS2_ULL_ULL_UINT_EVENT(olq_set_dquot);
1936 1955  
1937 1956 /* End of trace events for fs/ocfs2/quota_local.c. */
  1957 +
  1958 +/* Trace events for fs/ocfs2/quota_global.c. */
  1959 +
  1960 +DEFINE_OCFS2_ULL_EVENT(ocfs2_validate_quota_block);
  1961 +
  1962 +TRACE_EVENT(ocfs2_sync_dquot,
  1963 + TP_PROTO(unsigned int dq_id, long long dqb_curspace,
  1964 + long long spacechange, long long curinodes,
  1965 + long long inodechange),
  1966 + TP_ARGS(dq_id, dqb_curspace, spacechange, curinodes, inodechange),
  1967 + TP_STRUCT__entry(
  1968 + __field(unsigned int, dq_id)
  1969 + __field(long long, dqb_curspace)
  1970 + __field(long long, spacechange)
  1971 + __field(long long, curinodes)
  1972 + __field(long long, inodechange)
  1973 + ),
  1974 + TP_fast_assign(
  1975 + __entry->dq_id = dq_id;
  1976 + __entry->dqb_curspace = dqb_curspace;
  1977 + __entry->spacechange = spacechange;
  1978 + __entry->curinodes = curinodes;
  1979 + __entry->inodechange = inodechange;
  1980 + ),
  1981 + TP_printk("%u %lld %lld %lld %lld", __entry->dq_id,
  1982 + __entry->dqb_curspace, __entry->spacechange,
  1983 + __entry->curinodes, __entry->inodechange)
  1984 +);
  1985 +
  1986 +TRACE_EVENT(ocfs2_sync_dquot_helper,
  1987 + TP_PROTO(unsigned int dq_id, unsigned int dq_type, unsigned long type,
  1988 + const char *s_id),
  1989 + TP_ARGS(dq_id, dq_type, type, s_id),
  1990 +
  1991 + TP_STRUCT__entry(
  1992 + __field(unsigned int, dq_id)
  1993 + __field(unsigned int, dq_type)
  1994 + __field(unsigned long, type)
  1995 + __string(s_id, s_id)
  1996 + ),
  1997 + TP_fast_assign(
  1998 + __entry->dq_id = dq_id;
  1999 + __entry->dq_type = dq_type;
  2000 + __entry->type = type;
  2001 + __assign_str(s_id, s_id);
  2002 + ),
  2003 + TP_printk("%u %u %lu %s", __entry->dq_id, __entry->dq_type,
  2004 + __entry->type, __get_str(s_id))
  2005 +);
  2006 +
  2007 +DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_write_dquot);
  2008 +
  2009 +DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_release_dquot);
  2010 +
  2011 +DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_acquire_dquot);
  2012 +
  2013 +DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_mark_dquot_dirty);
  2014 +
  2015 +/* End of trace events for fs/ocfs2/quota_global.c. */
1938 2016 #endif /* _TRACE_OCFS2_H */
1939 2017  
1940 2018 /* This part must be outside protection */
fs/ocfs2/quota_global.c
... ... @@ -11,7 +11,6 @@
11 11 #include <linux/writeback.h>
12 12 #include <linux/workqueue.h>
13 13  
14   -#define MLOG_MASK_PREFIX ML_QUOTA
15 14 #include <cluster/masklog.h>
16 15  
17 16 #include "ocfs2_fs.h"
... ... @@ -27,6 +26,7 @@
27 26 #include "super.h"
28 27 #include "buffer_head_io.h"
29 28 #include "quota.h"
  29 +#include "ocfs2_trace.h"
30 30  
31 31 /*
32 32 * Locking of quotas with OCFS2 is rather complex. Here are rules that
... ... @@ -132,8 +132,7 @@
132 132 struct ocfs2_disk_dqtrailer *dqt =
133 133 ocfs2_block_dqtrailer(sb->s_blocksize, bh->b_data);
134 134  
135   - mlog(0, "Validating quota block %llu\n",
136   - (unsigned long long)bh->b_blocknr);
  135 + trace_ocfs2_validate_quota_block((unsigned long long)bh->b_blocknr);
137 136  
138 137 BUG_ON(!buffer_uptodate(bh));
139 138  
... ... @@ -509,9 +508,10 @@
509 508 olditime = dquot->dq_dqb.dqb_itime;
510 509 oldbtime = dquot->dq_dqb.dqb_btime;
511 510 ocfs2_global_disk2memdqb(dquot, &dqblk);
512   - mlog(0, "Syncing global dquot %u space %lld+%lld, inodes %lld+%lld\n",
513   - dquot->dq_id, dquot->dq_dqb.dqb_curspace, (long long)spacechange,
514   - dquot->dq_dqb.dqb_curinodes, (long long)inodechange);
  511 + trace_ocfs2_sync_dquot(dquot->dq_id, dquot->dq_dqb.dqb_curspace,
  512 + (long long)spacechange,
  513 + dquot->dq_dqb.dqb_curinodes,
  514 + (long long)inodechange);
515 515 if (!test_bit(DQ_LASTSET_B + QIF_SPACE_B, &dquot->dq_flags))
516 516 dquot->dq_dqb.dqb_curspace += spacechange;
517 517 if (!test_bit(DQ_LASTSET_B + QIF_INODES_B, &dquot->dq_flags))
... ... @@ -595,8 +595,8 @@
595 595 struct ocfs2_super *osb = OCFS2_SB(sb);
596 596 int status = 0;
597 597  
598   - mlog(0, "id=%u qtype=%u type=%lu device=%s\n", dquot->dq_id,
599   - dquot->dq_type, type, sb->s_id);
  598 + trace_ocfs2_sync_dquot_helper(dquot->dq_id, dquot->dq_type,
  599 + type, sb->s_id);
600 600 if (type != dquot->dq_type)
601 601 goto out;
602 602 status = ocfs2_lock_global_qf(oinfo, 1);
... ... @@ -647,7 +647,7 @@
647 647 struct ocfs2_super *osb = OCFS2_SB(dquot->dq_sb);
648 648 int status = 0;
649 649  
650   - mlog(0, "id=%u, type=%d", dquot->dq_id, dquot->dq_type);
  650 + trace_ocfs2_write_dquot(dquot->dq_id, dquot->dq_type);
651 651  
652 652 handle = ocfs2_start_trans(osb, OCFS2_QWRITE_CREDITS);
653 653 if (IS_ERR(handle)) {
... ... @@ -685,7 +685,7 @@
685 685 struct ocfs2_super *osb = OCFS2_SB(dquot->dq_sb);
686 686 int status = 0;
687 687  
688   - mlog(0, "id=%u, type=%d", dquot->dq_id, dquot->dq_type);
  688 + trace_ocfs2_release_dquot(dquot->dq_id, dquot->dq_type);
689 689  
690 690 mutex_lock(&dquot->dq_lock);
691 691 /* Check whether we are not racing with some other dqget() */
... ... @@ -743,7 +743,7 @@
743 743 int need_alloc = ocfs2_global_qinit_alloc(sb, type);
744 744 handle_t *handle;
745 745  
746   - mlog(0, "id=%u, type=%d", dquot->dq_id, type);
  746 + trace_ocfs2_acquire_dquot(dquot->dq_id, type);
747 747 mutex_lock(&dquot->dq_lock);
748 748 /*
749 749 * We need an exclusive lock, because we're going to update use count
... ... @@ -830,7 +830,7 @@
830 830 handle_t *handle;
831 831 struct ocfs2_super *osb = OCFS2_SB(sb);
832 832  
833   - mlog(0, "id=%u, type=%d", dquot->dq_id, type);
  833 + trace_ocfs2_mark_dquot_dirty(dquot->dq_id, type);
834 834  
835 835 /* In case user set some limits, sync dquot immediately to global
836 836 * quota file so that information propagates quicker */