Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=99fc64874aad1ee0aea5c4d8c07e3529f9d03497 Commit: 99fc64874aad1ee0aea5c4d8c07e3529f9d03497 Parent: 68c817a1c4e21b893672ac73d8a498e6647453aa Author: David Teigland <[EMAIL PROTECTED]> AuthorDate: Tue Jan 9 09:44:01 2007 -0600 Committer: Steven Whitehouse <[EMAIL PROTECTED]> CommitDate: Mon Feb 5 13:36:40 2007 -0500
[DLM] add config entry to enable log_debug Add a new dlm_config_info field to enable log_debug output and change log_debug() to use it. Signed-off-by: David Teigland <[EMAIL PROTECTED]> Signed-off-by: Steven Whitehouse <[EMAIL PROTECTED]> --- fs/dlm/config.c | 4 +++- fs/dlm/config.h | 1 + fs/dlm/dlm_internal.h | 13 +++++++------ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/fs/dlm/config.c b/fs/dlm/config.c index 958021f..7cf2020 100644 --- a/fs/dlm/config.c +++ b/fs/dlm/config.c @@ -775,6 +775,7 @@ int dlm_our_addr(struct sockaddr_storage *addr, int num) #define DEFAULT_RECOVER_TIMER 5 #define DEFAULT_TOSS_SECS 10 #define DEFAULT_SCAN_SECS 5 +#define DEFAULT_LOG_DEBUG 0 struct dlm_config_info dlm_config = { .ci_tcp_port = DEFAULT_TCP_PORT, @@ -784,6 +785,7 @@ struct dlm_config_info dlm_config = { .ci_dirtbl_size = DEFAULT_DIRTBL_SIZE, .ci_recover_timer = DEFAULT_RECOVER_TIMER, .ci_toss_secs = DEFAULT_TOSS_SECS, - .ci_scan_secs = DEFAULT_SCAN_SECS + .ci_scan_secs = DEFAULT_SCAN_SECS, + .ci_log_debug = DEFAULT_LOG_DEBUG }; diff --git a/fs/dlm/config.h b/fs/dlm/config.h index ce603e1..1e97861 100644 --- a/fs/dlm/config.h +++ b/fs/dlm/config.h @@ -25,6 +25,7 @@ struct dlm_config_info { int ci_recover_timer; int ci_toss_secs; int ci_scan_secs; + int ci_log_debug; }; extern struct dlm_config_info dlm_config; diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h index 7185a13..ee993c5 100644 --- a/fs/dlm/dlm_internal.h +++ b/fs/dlm/dlm_internal.h @@ -41,6 +41,7 @@ #include <asm/uaccess.h> #include <linux/dlm.h> +#include "config.h" #define DLM_LOCKSPACE_LEN 64 @@ -69,12 +70,12 @@ struct dlm_mhandle; #define log_error(ls, fmt, args...) \ printk(KERN_ERR "dlm: %s: " fmt "\n", (ls)->ls_name , ##args) -#define DLM_LOG_DEBUG -#ifdef DLM_LOG_DEBUG -#define log_debug(ls, fmt, args...) log_error(ls, fmt, ##args) -#else -#define log_debug(ls, fmt, args...) -#endif +#define log_debug(ls, fmt, args...) \ +do { \ + if (dlm_config.ci_log_debug) \ + printk(KERN_DEBUG "dlm: %s: " fmt "\n", \ + (ls)->ls_name , ##args); \ +} while (0) #define DLM_ASSERT(x, do) \ { \ - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html