Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'dlm-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm

Pull dlm updates from David Teigland:
"This set includes two trivial changes, one to use kmemdup and another
to control the log level of recovery messages"

* tag 'dlm-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm:
dlm: Use kmemdup instead of kmalloc and memcpy
dlm: add log_info config option

+18 -3
+7
fs/dlm/config.c
··· 73 73 unsigned int cl_toss_secs; 74 74 unsigned int cl_scan_secs; 75 75 unsigned int cl_log_debug; 76 + unsigned int cl_log_info; 76 77 unsigned int cl_protocol; 77 78 unsigned int cl_timewarn_cs; 78 79 unsigned int cl_waitwarn_us; ··· 96 95 CLUSTER_ATTR_TOSS_SECS, 97 96 CLUSTER_ATTR_SCAN_SECS, 98 97 CLUSTER_ATTR_LOG_DEBUG, 98 + CLUSTER_ATTR_LOG_INFO, 99 99 CLUSTER_ATTR_PROTOCOL, 100 100 CLUSTER_ATTR_TIMEWARN_CS, 101 101 CLUSTER_ATTR_WAITWARN_US, ··· 168 166 CLUSTER_ATTR(toss_secs, 1); 169 167 CLUSTER_ATTR(scan_secs, 1); 170 168 CLUSTER_ATTR(log_debug, 0); 169 + CLUSTER_ATTR(log_info, 0); 171 170 CLUSTER_ATTR(protocol, 0); 172 171 CLUSTER_ATTR(timewarn_cs, 1); 173 172 CLUSTER_ATTR(waitwarn_us, 0); ··· 183 180 [CLUSTER_ATTR_TOSS_SECS] = &cluster_attr_toss_secs, 184 181 [CLUSTER_ATTR_SCAN_SECS] = &cluster_attr_scan_secs, 185 182 [CLUSTER_ATTR_LOG_DEBUG] = &cluster_attr_log_debug, 183 + [CLUSTER_ATTR_LOG_INFO] = &cluster_attr_log_info, 186 184 [CLUSTER_ATTR_PROTOCOL] = &cluster_attr_protocol, 187 185 [CLUSTER_ATTR_TIMEWARN_CS] = &cluster_attr_timewarn_cs, 188 186 [CLUSTER_ATTR_WAITWARN_US] = &cluster_attr_waitwarn_us, ··· 369 365 cl->cl_toss_secs = dlm_config.ci_toss_secs; 370 366 cl->cl_scan_secs = dlm_config.ci_scan_secs; 371 367 cl->cl_log_debug = dlm_config.ci_log_debug; 368 + cl->cl_log_info = dlm_config.ci_log_info; 372 369 cl->cl_protocol = dlm_config.ci_protocol; 373 370 cl->cl_timewarn_cs = dlm_config.ci_timewarn_cs; 374 371 cl->cl_waitwarn_us = dlm_config.ci_waitwarn_us; ··· 855 850 #define DEFAULT_TOSS_SECS 10 856 851 #define DEFAULT_SCAN_SECS 5 857 852 #define DEFAULT_LOG_DEBUG 0 853 + #define DEFAULT_LOG_INFO 1 858 854 #define DEFAULT_PROTOCOL 0 859 855 #define DEFAULT_TIMEWARN_CS 500 /* 5 sec = 500 centiseconds */ 860 856 #define DEFAULT_WAITWARN_US 0 ··· 871 865 .ci_toss_secs = DEFAULT_TOSS_SECS, 872 866 .ci_scan_secs = DEFAULT_SCAN_SECS, 873 867 .ci_log_debug = DEFAULT_LOG_DEBUG, 868 + .ci_log_info = DEFAULT_LOG_INFO, 874 869 .ci_protocol = DEFAULT_PROTOCOL, 875 870 .ci_timewarn_cs = DEFAULT_TIMEWARN_CS, 876 871 .ci_waitwarn_us = DEFAULT_WAITWARN_US,
+1
fs/dlm/config.h
··· 31 31 int ci_toss_secs; 32 32 int ci_scan_secs; 33 33 int ci_log_debug; 34 + int ci_log_info; 34 35 int ci_protocol; 35 36 int ci_timewarn_cs; 36 37 int ci_waitwarn_us;
+9 -1
fs/dlm/dlm_internal.h
··· 65 65 printk(KERN_ERR "dlm: "fmt"\n" , ##args) 66 66 #define log_error(ls, fmt, args...) \ 67 67 printk(KERN_ERR "dlm: %s: " fmt "\n", (ls)->ls_name , ##args) 68 + 68 69 #define log_rinfo(ls, fmt, args...) \ 69 - printk(KERN_INFO "dlm: %s: " fmt "\n", (ls)->ls_name , ##args); 70 + do { \ 71 + if (dlm_config.ci_log_info) \ 72 + printk(KERN_INFO "dlm: %s: " fmt "\n", \ 73 + (ls)->ls_name, ##args); \ 74 + else if (dlm_config.ci_log_debug) \ 75 + printk(KERN_DEBUG "dlm: %s: " fmt "\n", \ 76 + (ls)->ls_name , ##args); \ 77 + } while (0) 70 78 71 79 #define log_debug(ls, fmt, args...) \ 72 80 do { \
+1 -2
fs/dlm/lowcomms.c
··· 1279 1279 if (dlm_our_addr(&sas, i)) 1280 1280 break; 1281 1281 1282 - addr = kmalloc(sizeof(*addr), GFP_NOFS); 1282 + addr = kmemdup(&sas, sizeof(*addr), GFP_NOFS); 1283 1283 if (!addr) 1284 1284 break; 1285 - memcpy(addr, &sas, sizeof(*addr)); 1286 1285 dlm_local_addr[dlm_local_count++] = addr; 1287 1286 } 1288 1287 }