From: David Teigland <teigland@redhat.com> Subject: [RHEL5.1 PATCH] dlm: add config entry to enable log_debug Date: Thu, 25 Jan 2007 09:14:39 -0600 Bugzilla: 239040 Message-Id: <20070125151439.GC21980@redhat.com> Changelog: [dlm] add config entry to enable log_debug bz 221326 (patch 2 of 3) Add a new dlm_config_info field to enable log_debug output and change log_debug() to use it. patch is in upstream gfs2 git tree Index: linux-rhel5-quilt/fs/dlm/config.c =================================================================== --- linux-rhel5-quilt.orig/fs/dlm/config.c 2007-01-24 14:58:29.000000000 -0600 +++ linux-rhel5-quilt/fs/dlm/config.c 2007-01-24 15:01:05.000000000 -0600 @@ -775,6 +775,7 @@ #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 @@ .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 }; Index: linux-rhel5-quilt/fs/dlm/config.h =================================================================== --- linux-rhel5-quilt.orig/fs/dlm/config.h 2007-01-24 14:58:29.000000000 -0600 +++ linux-rhel5-quilt/fs/dlm/config.h 2007-01-24 15:01:05.000000000 -0600 @@ -25,6 +25,7 @@ int ci_recover_timer; int ci_toss_secs; int ci_scan_secs; + int ci_log_debug; }; extern struct dlm_config_info dlm_config; Index: linux-rhel5-quilt/fs/dlm/dlm_internal.h =================================================================== --- linux-rhel5-quilt.orig/fs/dlm/dlm_internal.h 2007-01-24 14:57:10.000000000 -0600 +++ linux-rhel5-quilt/fs/dlm/dlm_internal.h 2007-01-24 15:02:10.000000000 -0600 @@ -41,6 +41,7 @@ #include <asm/uaccess.h> #include <linux/dlm.h> +#include "config.h" #define DLM_LOCKSPACE_LEN 64 @@ -69,11 +70,12 @@ #define log_error(ls, fmt, args...) \ printk(KERN_ERR "dlm: %s: " fmt "\n", (ls)->ls_name , ##args) -#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) \ { \