aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/cluster
diff options
context:
space:
mode:
authorTao Ma <boyu.mt@taobao.com>2011-03-07 03:43:21 -0500
committerTao Ma <boyu.mt@taobao.com>2011-03-07 03:43:21 -0500
commitc1e8d35ef5ffb393b94a192034b5e3541e005d75 (patch)
treeb9a7f089acd3408c2835a3dfd6aa7bb0407587b3 /fs/ocfs2/cluster
parentef6b689b63b9f5227ccee6f16dd9ee3faf58a464 (diff)
ocfs2: Remove EXIT from masklog.
mlog_exit is used to record the exit status of a function. But because it is added in so many functions, if we enable it, the system logs get filled up quickly and cause too much I/O. So actually no one can open it for a production system or even for a test. This patch just try to remove it or change it. So: 1. if all the error paths already use mlog_errno, it is just removed. Otherwise, it will be replaced by mlog_errno. 2. if it is used to print some return value, it is replaced with mlog(0,...). mlog_exit_ptr is changed to mlog(0. All those mlog(0,...) will be replaced with trace events later. Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Diffstat (limited to 'fs/ocfs2/cluster')
-rw-r--r--fs/ocfs2/cluster/heartbeat.c1
-rw-r--r--fs/ocfs2/cluster/masklog.c3
-rw-r--r--fs/ocfs2/cluster/masklog.h44
3 files changed, 1 insertions, 47 deletions
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index 929178ce17a2..fc9e96a03a6b 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -1679,7 +1679,6 @@ static int o2hb_populate_slot_data(struct o2hb_region *reg)
1679 } 1679 }
1680 1680
1681out: 1681out:
1682 mlog_exit(ret);
1683 return ret; 1682 return ret;
1684} 1683}
1685 1684
diff --git a/fs/ocfs2/cluster/masklog.c b/fs/ocfs2/cluster/masklog.c
index bac64570c525..fdc302ddafe8 100644
--- a/fs/ocfs2/cluster/masklog.c
+++ b/fs/ocfs2/cluster/masklog.c
@@ -30,7 +30,7 @@
30 30
31struct mlog_bits mlog_and_bits = MLOG_BITS_RHS(MLOG_INITIAL_AND_MASK); 31struct mlog_bits mlog_and_bits = MLOG_BITS_RHS(MLOG_INITIAL_AND_MASK);
32EXPORT_SYMBOL_GPL(mlog_and_bits); 32EXPORT_SYMBOL_GPL(mlog_and_bits);
33struct mlog_bits mlog_not_bits = MLOG_BITS_RHS(MLOG_INITIAL_NOT_MASK); 33struct mlog_bits mlog_not_bits = MLOG_BITS_RHS(0);
34EXPORT_SYMBOL_GPL(mlog_not_bits); 34EXPORT_SYMBOL_GPL(mlog_not_bits);
35 35
36static ssize_t mlog_mask_show(u64 mask, char *buf) 36static ssize_t mlog_mask_show(u64 mask, char *buf)
@@ -80,7 +80,6 @@ struct mlog_attribute {
80} 80}
81 81
82static struct mlog_attribute mlog_attrs[MLOG_MAX_BITS] = { 82static struct mlog_attribute mlog_attrs[MLOG_MAX_BITS] = {
83 define_mask(EXIT),
84 define_mask(TCP), 83 define_mask(TCP),
85 define_mask(MSG), 84 define_mask(MSG),
86 define_mask(SOCKET), 85 define_mask(SOCKET),
diff --git a/fs/ocfs2/cluster/masklog.h b/fs/ocfs2/cluster/masklog.h
index 6e20877436b9..51ee790c7678 100644
--- a/fs/ocfs2/cluster/masklog.h
+++ b/fs/ocfs2/cluster/masklog.h
@@ -82,7 +82,6 @@
82 82
83/* bits that are frequently given and infrequently matched in the low word */ 83/* bits that are frequently given and infrequently matched in the low word */
84/* NOTE: If you add a flag, you need to also update masklog.c! */ 84/* NOTE: If you add a flag, you need to also update masklog.c! */
85#define ML_EXIT 0x0000000000000002ULL /* func call exit */
86#define ML_TCP 0x0000000000000004ULL /* net cluster/tcp.c */ 85#define ML_TCP 0x0000000000000004ULL /* net cluster/tcp.c */
87#define ML_MSG 0x0000000000000008ULL /* net network messages */ 86#define ML_MSG 0x0000000000000008ULL /* net network messages */
88#define ML_SOCKET 0x0000000000000010ULL /* net socket lifetime */ 87#define ML_SOCKET 0x0000000000000010ULL /* net socket lifetime */
@@ -123,7 +122,6 @@
123#define ML_KTHREAD 0x4000000000000000ULL /* kernel thread activity */ 122#define ML_KTHREAD 0x4000000000000000ULL /* kernel thread activity */
124 123
125#define MLOG_INITIAL_AND_MASK (ML_ERROR|ML_NOTICE) 124#define MLOG_INITIAL_AND_MASK (ML_ERROR|ML_NOTICE)
126#define MLOG_INITIAL_NOT_MASK (ML_EXIT)
127#ifndef MLOG_MASK_PREFIX 125#ifndef MLOG_MASK_PREFIX
128#define MLOG_MASK_PREFIX 0 126#define MLOG_MASK_PREFIX 0
129#endif 127#endif
@@ -221,48 +219,6 @@ extern struct mlog_bits mlog_and_bits, mlog_not_bits;
221 mlog(ML_ERROR, "status = %lld\n", (long long)_st); \ 219 mlog(ML_ERROR, "status = %lld\n", (long long)_st); \
222} while (0) 220} while (0)
223 221
224#if defined(CONFIG_OCFS2_DEBUG_MASKLOG)
225/*
226 * We disable this for sparse.
227 */
228#if !defined(__CHECKER__)
229#define mlog_exit(st) do { \
230 if (__builtin_types_compatible_p(typeof(st), unsigned long)) \
231 mlog(ML_EXIT, "EXIT: %lu\n", (unsigned long) (st)); \
232 else if (__builtin_types_compatible_p(typeof(st), signed long)) \
233 mlog(ML_EXIT, "EXIT: %ld\n", (signed long) (st)); \
234 else if (__builtin_types_compatible_p(typeof(st), unsigned int) \
235 || __builtin_types_compatible_p(typeof(st), unsigned short) \
236 || __builtin_types_compatible_p(typeof(st), unsigned char)) \
237 mlog(ML_EXIT, "EXIT: %u\n", (unsigned int) (st)); \
238 else if (__builtin_types_compatible_p(typeof(st), signed int) \
239 || __builtin_types_compatible_p(typeof(st), signed short) \
240 || __builtin_types_compatible_p(typeof(st), signed char)) \
241 mlog(ML_EXIT, "EXIT: %d\n", (signed int) (st)); \
242 else if (__builtin_types_compatible_p(typeof(st), long long)) \
243 mlog(ML_EXIT, "EXIT: %lld\n", (long long) (st)); \
244 else \
245 mlog(ML_EXIT, "EXIT: %llu\n", (unsigned long long) (st)); \
246} while (0)
247#else
248#define mlog_exit(st) do { \
249 mlog(ML_EXIT, "EXIT: %lld\n", (long long) (st)); \
250} while (0)
251#endif
252
253#define mlog_exit_ptr(ptr) do { \
254 mlog(ML_EXIT, "EXIT: %p\n", ptr); \
255} while (0)
256
257#define mlog_exit_void() do { \
258 mlog(ML_EXIT, "EXIT\n"); \
259} while (0)
260#else
261#define mlog_exit(...) do { } while (0)
262#define mlog_exit_ptr(...) do { } while (0)
263#define mlog_exit_void(...) do { } while (0)
264#endif /* defined(CONFIG_OCFS2_DEBUG_MASKLOG) */
265
266#define mlog_bug_on_msg(cond, fmt, args...) do { \ 222#define mlog_bug_on_msg(cond, fmt, args...) do { \
267 if (cond) { \ 223 if (cond) { \
268 mlog(ML_ERROR, "bug expression: " #cond "\n"); \ 224 mlog(ML_ERROR, "bug expression: " #cond "\n"); \