You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(16) |
Nov
(10) |
Dec
(7) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(26) |
Jun
(23) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(2) |
| 2004 |
Jan
(13) |
Feb
(25) |
Mar
(9) |
Apr
(25) |
May
(25) |
Jun
(4) |
Jul
(5) |
Aug
(3) |
Sep
(7) |
Oct
(22) |
Nov
|
Dec
(15) |
| 2005 |
Jan
|
Feb
|
Mar
(29) |
Apr
(42) |
May
(62) |
Jun
(8) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <cao...@us...> - 2005-07-08 16:19:59
|
Update of /cvsroot/opendlm/opendlm/src/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6432 Removed Files: Makefile.am Log Message: Header and CCCP cleanups --- Makefile.am DELETED --- |
|
From: <cao...@us...> - 2005-07-08 16:17:51
|
Update of /cvsroot/opendlm/opendlm/src/user/dlmdu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5108/src/user/dlmdu Modified Files: dlm_cmdline.c dlm_config.c dlm_daemon.c dlm_device.c Log Message: Header and CCCP cleanups Index: dlm_cmdline.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/user/dlmdu/dlm_cmdline.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** dlm_cmdline.c 3 Jun 2005 19:27:17 -0000 1.10 --- dlm_cmdline.c 8 Jul 2005 16:17:12 -0000 1.11 *************** *** 47,62 **** #include "dlm_log.h" #include <stdio.h> #include <string.h> #include <sys/resource.h> - #include "dlm.h" - #include "dlm_kernel.h" - #include "dlm_version.h" #include "clmstructs.h" - #include "dlm_log.h" - - - #undef LOCK_FREE /* ============================================================ */ --- 47,56 ---- #include "dlm_log.h" + #include <stdlib.h> #include <stdio.h> #include <string.h> #include <sys/resource.h> #include "clmstructs.h" /* ============================================================ */ Index: dlm_config.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/user/dlmdu/dlm_config.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** dlm_config.c 3 Jun 2005 19:27:17 -0000 1.6 --- dlm_config.c 8 Jul 2005 16:17:12 -0000 1.7 *************** *** 57,64 **** #include <string.h> - #include "dlm_cluster.h" #include "clmstructs.h" #include "dlm_devmsg.h" - #include "dlm_kernel.h" #include "dlm_log.h" --- 57,62 ---- Index: dlm_daemon.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/user/dlmdu/dlm_daemon.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** dlm_daemon.c 3 Jun 2005 19:27:17 -0000 1.10 --- dlm_daemon.c 8 Jul 2005 16:17:12 -0000 1.11 *************** *** 116,120 **** #include <stdlib.h> #include <string.h> - #include <unistd.h> #include <errno.h> #include <sys/stat.h> --- 116,119 ---- *************** *** 126,133 **** #endif /* !DIRECT_CLUSTINT */ - #include "dlm.h" #include "dlm_devmsg.h" ! #include "dlm_kernel.h" ! #include "cltrc.h" #include "dlm_list.h" #include "dlm_log.h" --- 125,130 ---- #endif /* !DIRECT_CLUSTINT */ #include "dlm_devmsg.h" ! #include "clmstructs.h" #include "dlm_list.h" #include "dlm_log.h" *************** *** 985,988 **** --- 982,987 ---- * removed from the "end" of the list. */ + #define TRUE 1 + #define FALSE 0 bool_t dlm_notify_deliver(int nodeid, struct in_addr saddr, char *hostname, haDLM_state_t node_state, haDLM_state_t comm_state) Index: dlm_device.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/user/dlmdu/dlm_device.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dlm_device.c 3 Jun 2005 19:27:17 -0000 1.8 --- dlm_device.c 8 Jul 2005 16:17:12 -0000 1.9 *************** *** 59,64 **** #include "config.h" #include <stdio.h> - #include <sys/stat.h> #include <fcntl.h> #include <string.h> --- 59,64 ---- #include "config.h" + #include <stdlib.h> #include <stdio.h> #include <fcntl.h> #include <string.h> *************** *** 66,70 **** #include "clmstructs.h" - #include "dlm_kernel.h" #include "dlm_log.h" --- 66,69 ---- |
|
From: <cao...@us...> - 2005-07-08 16:17:46
|
Update of /cvsroot/opendlm/opendlm/src/kernel/dlmcccp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5108/src/kernel/dlmcccp Modified Files: Makefile.in cccp_deliver.c cccp_init.c cccp_msg.c cccp_ports.c cccp_private.h cccp_proto.c cccp_proto.h cccp_queue.c cccp_udp.c Removed Files: cccp_input.c cccp_kernel.c cccp_output.c Log Message: Header and CCCP cleanups Index: Makefile.in =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/Makefile.in,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.in 3 Jun 2005 19:27:15 -0000 1.4 --- Makefile.in 8 Jul 2005 16:17:04 -0000 1.5 *************** *** 79,84 **** PROGRAMS = $(module_PROGRAMS) am_cccp_o_OBJECTS = cccp_deliver.$(OBJEXT) cccp_init.$(OBJEXT) \ ! cccp_input.$(OBJEXT) cccp_kernel.$(OBJEXT) cccp_msg.$(OBJEXT) \ ! cccp_output.$(OBJEXT) cccp_ports.$(OBJEXT) \ cccp_proto.$(OBJEXT) cccp_queue.$(OBJEXT) cccp_udp.$(OBJEXT) am__objects_1 = dlm_timestamp.$(OBJEXT) --- 79,83 ---- PROGRAMS = $(module_PROGRAMS) am_cccp_o_OBJECTS = cccp_deliver.$(OBJEXT) cccp_init.$(OBJEXT) \ ! cccp_msg.$(OBJEXT) cccp_ports.$(OBJEXT) \ cccp_proto.$(OBJEXT) cccp_queue.$(OBJEXT) cccp_udp.$(OBJEXT) am__objects_1 = dlm_timestamp.$(OBJEXT) *************** *** 91,97 **** am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cccp_deliver.Po \ ! @AMDEP_TRUE@ ./$(DEPDIR)/cccp_init.Po ./$(DEPDIR)/cccp_input.Po \ ! @AMDEP_TRUE@ ./$(DEPDIR)/cccp_kernel.Po ./$(DEPDIR)/cccp_msg.Po \ ! @AMDEP_TRUE@ ./$(DEPDIR)/cccp_output.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/cccp_ports.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/cccp_proto.Po \ --- 90,95 ---- am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cccp_deliver.Po \ ! @AMDEP_TRUE@ ./$(DEPDIR)/cccp_init.Po \ ! @AMDEP_TRUE@ ./$(DEPDIR)/cccp_msg.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/cccp_ports.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/cccp_proto.Po \ *************** *** 234,239 **** cccp_pkt.h cccp_private.h cccp_proto.h cccp_queue.h\ \ ! cccp_deliver.c cccp_init.c cccp_input.c cccp_kernel.c cccp_msg.c \ ! cccp_output.c cccp_ports.c cccp_proto.c cccp_queue.c cccp_udp.c else #This is ugly, I know but I couldn't get a for-loop to work properly -dcz --- 232,237 ---- cccp_pkt.h cccp_private.h cccp_proto.h cccp_queue.h\ \ ! cccp_deliver.c cccp_init.c cccp_msg.c \ ! cccp_ports.c cccp_proto.c cccp_queue.c cccp_udp.c else #This is ugly, I know but I couldn't get a for-loop to work properly -dcz *************** *** 241,246 **** $(src)/cccp_pkt.h $(src)/cccp_private.h $(src)/cccp_proto.h \ $(src)/cccp_queue.h $(src)/cccp_deliver.c $(src)/cccp_init.c \ ! $(src)/cccp_input.c $(src)/cccp_kernel.c $(src)/cccp_msg.c \ ! $(src)/cccp_output.c $(src)/cccp_ports.c $(src)/cccp_proto.c \ $(src)/cccp_queue.c $(src)/cccp_udp.c endif --- 239,243 ---- $(src)/cccp_pkt.h $(src)/cccp_private.h $(src)/cccp_proto.h \ $(src)/cccp_queue.h $(src)/cccp_deliver.c $(src)/cccp_init.c \ ! $(src)/cccp_msg.c $(src)/cccp_ports.c $(src)/cccp_proto.c \ $(src)/cccp_queue.c $(src)/cccp_udp.c endif *************** *** 317,324 **** @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cccp_deliver.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cccp_init.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cccp_input.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cccp_kernel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cccp_msg.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cccp_output.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cccp_ports.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cccp_proto.Po@am__quote@ --- 314,318 ---- Index: cccp_deliver.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/cccp_deliver.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** cccp_deliver.c 25 May 2005 16:25:18 -0000 1.12 --- cccp_deliver.c 8 Jul 2005 16:17:05 -0000 1.13 *************** *** 56,80 **** #include <cltrc.h> - #include <dlm_cluster.h> #include <cccp.h> #include "cccp_pkt.h" #include "cccp_queue.h" - #include "cccp_private.h" #include "cccp_proto.h" /* Semaphore used to let the delivery thread know that there maybe another * message available that needs to be processed. */ ! cccp_sem_t cccp_delivery_sem; #ifdef __KERNEL__ #ifdef __linux__ #include <linux/completion.h> ! extern struct completion cccp_delivery_thread_done; #endif #endif /****************************************************************************/ --- 56,122 ---- #include <cltrc.h> #include <cccp.h> + #include "cccp_private.h" #include "cccp_pkt.h" #include "cccp_queue.h" #include "cccp_proto.h" + /* prototypes */ + void *cccp_msg_delivery_loop( void * arg ); + /* Semaphore used to let the delivery thread know that there maybe another * message available that needs to be processed. */ ! static cccp_sem_t cccp_delivery_sem; ! static cccp_pid_t cccp_delivery_thread=0; #ifdef __KERNEL__ #ifdef __linux__ #include <linux/completion.h> ! static DECLARE_COMPLETION(cccp_delivery_thread_done); #endif #endif + int cccp_deliver_start() + { + if (!cccp_running()) + return CPERR_NOCCCP; + + if (cccp_delivery_thread != 0) + return CPERR_ILLEGAL; + + CCCP_SEM_INIT( & cccp_delivery_sem ); + CCCP_NEW_THREAD( cccp_delivery_thread, NULL, cccp_msg_delivery_loop, + NULL ); + + return CPERR_OK; + } + + int cccp_deliver_stop() + { + clm_msg_t *msg; + + if (cccp_running()) + return CPERR_ILLEGAL; + + if (cccp_delivery_thread == 0) + return CPERR_ILLEGAL; + + CCCP_SEM_UP( & cccp_delivery_sem ); + #ifdef __KERNEL__ + #ifdef __linux__ + wait_for_completion( &cccp_delivery_thread_done ); + #endif + #endif + cccp_delivery_thread=0; + + /* flush remaining messages */ + while ((msg = cccp_port_dequeue_message()) != NULL) + finishMessage( msg, CPERR_NODEDOWN ); + + return CPERR_OK; + } /****************************************************************************/ *************** *** 148,152 **** msg_done = TRUE; dlm_dbprintf(DBG_CCCP, ! "[%s:%s] NULL receive callback for port %u", PROCESS_NAME, __FUNCTION__, msg->cm_port ); } --- 190,194 ---- msg_done = TRUE; dlm_dbprintf(DBG_CCCP, ! "[%s:%s] NULL receive callback for port %u\n", PROCESS_NAME, __FUNCTION__, msg->cm_port ); } *************** *** 161,165 **** /****************************************************************************/ ! bool_t cccp_deliver_all_from_port( void ) { --- 203,207 ---- /****************************************************************************/ ! static bool_t cccp_deliver_all_from_port( void ) { *************** *** 228,235 **** cccp_msg_delivery_loop( void * arg ) { - int post_die_messages=0; - - #ifdef __KERNEL__ dlm_daemonize("CCCP delivery"); #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41) #else --- 270,275 ---- cccp_msg_delivery_loop( void * arg ) { dlm_daemonize("CCCP delivery"); + #ifdef __KERNEL__ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41) #else *************** *** 238,242 **** #endif ! while ( !cccp_time_to_die ) { CCCP_SEM_DOWN( & cccp_delivery_sem ); --- 278,282 ---- #endif ! while ( cccp_running() ) { CCCP_SEM_DOWN( & cccp_delivery_sem ); *************** *** 247,270 **** } - /* if it's time to die, finish processing all the messages. - * all the ports should be closed now, so this should be - * rather quick, in theory. The reason for this, is the - * _data_ inside the message has allocated memory that - * needs to be deallocated by the appropriate callback - * called by finishMessage() - */ - while ((cccp_deliver_all_from_port()) && (++post_die_messages < 100)); - - /* - * breakout condition: - * 1 - if after 100 messages, just accept we didn't turn - * off the faucet properly and break - * (100 is arbituary) - * 2 - otherwise if count went through all the ports - * and didn't find any messages, break - */ - if (post_die_messages > 100) - printk("cccp_msg_delivery_loop: has over 100 post_die_messages\n"); - dlm_log(LOG_INFO, "%s termination, CCCP shutdown.", __FUNCTION__ ); #ifdef __KERNEL__ --- 287,290 ---- *************** *** 450,454 **** */ ! if (!cccp_time_to_die) { CCCP_MUTEX_LOCK( & cccp_global_lock ); --- 470,474 ---- */ ! if (cccp_running()) { CCCP_MUTEX_LOCK( & cccp_global_lock ); Index: cccp_init.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/cccp_init.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** cccp_init.c 25 May 2005 16:25:18 -0000 1.13 --- cccp_init.c 8 Jul 2005 16:17:05 -0000 1.14 *************** *** 58,62 **** #include <cltrc.h> - #include <dlm_cluster.h> #include <cccp.h> --- 58,61 ---- *************** *** 73,94 **** /* socket for accepting connections (TCP) or reading packets (UDP)*/ - cccp_sock_t cccp_our_sock = CCCP_SOCK_INVALID; - DECLARE_MUTEX( cccp_global_lock ); - cccp_pid_t cccp_poll_thread; - cccp_pid_t cccp_retransmit_thread; - cccp_pid_t cccp_msg_delivery_thread; - - #ifdef __KERNEL__ - #ifdef __linux__ - #include <linux/completion.h> - DECLARE_COMPLETION(cccp_poll_thread_done); - DECLARE_COMPLETION(cccp_retransmit_thread_done); - DECLARE_COMPLETION(cccp_delivery_thread_done); - #endif - #endif - - volatile bool_t cccp_time_to_die = FALSE; static bool_t cccp_started=FALSE; --- 72,77 ---- *************** *** 191,196 **** cccp_init( void ) { - int status; - TRCHKL0T(CPTRC_UINIT_ENTRY); CCCP_MUTEX_LOCK( & cccp_global_lock ); --- 174,177 ---- *************** *** 207,210 **** --- 188,192 ---- #if ! defined( __KERNEL__ ) + /*** FIXME Need to test this path someday */ (void) cccp_minimal_init(); read_node_cfg_file(); *************** *** 218,239 **** #endif - cccp_time_to_die = FALSE; - - status = cccp_ip_init(); - - dlm_dbprintf(DBG_CCCP, "cccp_ip_init status = %d\n", status ); - - CCCP_ASSERT( status == CPERR_OK, - "failed to get socket for IP between cllockds" ); - - CCCP_SEM_INIT( & cccp_poll_sem ); - CCCP_SEM_INIT( & cccp_delivery_sem ); - - CCCP_NEW_THREAD( cccp_poll_thread, NULL, cccp_poll_loop, NULL ); - CCCP_NEW_THREAD( cccp_retransmit_thread, NULL, cccp_retransmit_loop, - NULL ); - CCCP_NEW_THREAD( cccp_msg_delivery_thread, NULL, cccp_msg_delivery_loop, - NULL ); - /* set local flag to signify cccp has been started */ cccp_started = TRUE; --- 200,203 ---- *************** *** 241,246 **** CCCP_MUTEX_UNLOCK( & cccp_global_lock ); ! TRCHKL2T(CPTRC_UINIT_EXIT,status,cccp_our_id); ! return( status ); } --- 205,210 ---- CCCP_MUTEX_UNLOCK( & cccp_global_lock ); ! TRCHKL2T(CPTRC_UINIT_EXIT,0,cccp_our_id); ! return( CPERR_OK ); } *************** *** 296,359 **** cccp_stop ( void ) { - int err; - TRCHKL0T(CPTRC_USTOP_ENTRY); /* zero is a special case to shut down everything for cccp_node_down() */ ! cccp_node_down(0); ! ! /* we have gracefully left our cluster world, tell everyone to start ! * flushing all messages and clean up ! */ ! CCCP_MUTEX_LOCK( & cccp_global_lock ); ! ! /* check to make the cccp was actually started */ ! if (!cccp_started) ! { ! /* nothing to do here */ ! CCCP_MUTEX_UNLOCK( & cccp_global_lock ); ! return; ! } ! ! cccp_time_to_die = TRUE; ! #ifdef __KERNEL__ ! #ifdef __linux__ ! wmb(); /* smp sync else NO-OP */ ! #endif ! #endif ! ! CCCP_MUTEX_UNLOCK( & cccp_global_lock ); ! ! /* kill all the cccp threads, starting with the read thread. ! * wait for all them to complete before returning. ! */ ! ! /* interrupt the read connection to close it */ ! err = kill_proc( cccp_poll_thread, SIGINT, 1 ); ! if ( err < 0 ) ! { ! dlm_log(LOG_CRIT, "[%s:%s] Unable to kill CCCP poll thread " ! "(pid=%u), error = %u\n", PROCESS_NAME, __FUNCTION__, ! cccp_poll_thread, -err ); ! } ! #ifdef __KERNEL__ ! #ifdef __linux__ ! else ! wait_for_completion( &cccp_poll_thread_done ); ! #endif ! #endif ! ! CCCP_SEM_UP( & cccp_poll_sem ); ! CCCP_SEM_UP( & cccp_delivery_sem ); ! #ifdef __KERNEL__ ! #ifdef __linux__ ! wait_for_completion( &cccp_retransmit_thread_done ); ! wait_for_completion( &cccp_delivery_thread_done ); ! #endif ! #endif - /* let the cccp know it is now shutdown */ - cccp_started = FALSE; - TRCHKL0T(CPTRC_USTOP_EXIT); } --- 260,268 ---- cccp_stop ( void ) { TRCHKL0T(CPTRC_USTOP_ENTRY); /* zero is a special case to shut down everything for cccp_node_down() */ ! // cccp_node_down(0); TRCHKL0T(CPTRC_USTOP_EXIT); } Index: cccp_msg.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/cccp_msg.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** cccp_msg.c 25 May 2005 16:25:18 -0000 1.5 --- cccp_msg.c 8 Jul 2005 16:17:05 -0000 1.6 *************** *** 50,57 **** #include <cltrc.h> - #include <dlm_cluster.h> #include <cccp.h> - #include "cccp_private.h" --- 50,56 ---- #include <cltrc.h> #include <cccp.h> #include "cccp_private.h" + #include "cccp_proto.h" *************** *** 159,166 **** } } - else - { - SUGGEST((src->cm_data != NULL),"cm_data set with cm_length==0"); - } } --- 158,161 ---- *************** *** 193,197 **** pkt->cp_version = CCCP_VERSION; ! pkt->cp_header_length = sizeof( clm_pkt_t ); pkt->cp_srcnode = thisNode(); } --- 188,192 ---- pkt->cp_version = CCCP_VERSION; ! pkt->cp_header_length = sizeof( *pkt ); pkt->cp_srcnode = thisNode(); } *************** *** 240,245 **** if ( pkt != NULL ) { pkt->cp_flags = CPF_MSG_PRESENT; - pkt->cp_version = CCCP_VERSION; pkt->cp_port = msg->cm_port; pkt->cp_prio = msg->cm_prio; --- 235,240 ---- if ( pkt != NULL ) { + cccp_init_pkt(pkt); pkt->cp_flags = CPF_MSG_PRESENT; pkt->cp_port = msg->cm_port; pkt->cp_prio = msg->cm_prio; *************** *** 248,252 **** pkt->cp_hops = msg->cm_hops; pkt->cp_node = msg->cm_node; - pkt->cp_srcnode = thisNode(); } --- 243,246 ---- *************** *** 255,259 **** --- 249,311 ---- } + /* FUNCTION: cccp_send*/ + /**/ + /* PURPOSE: API function to send a message to another node/port, as*/ + /* defined in the spec.*/ + /**/ + /* INPUT: msg pointer to a clm_msg_t describing the message*/ + /**/ + /* OUTPUT: CPERR_OK if packet sent, error code otherwise*/ + /**/ + /* NOTE: Errors are reported by invoking the callback function*/ + /* specified in the clm_msg_t, if there is one.*/ + + static int + cccp_send_guts ( clm_msg_t *msg ) + { + if ( ! cccp_running() ) + { + return( CPERR_NOCCCP ); + } + + /* there is no node zero*/ + if ( (msg == NULL) || (msg->cm_node == 0) || (msg->cm_port == 0) ) { + return( CPERR_ILLEGAL ); + } + + /* insanity check */ + if ( node_idx( msg->cm_node ) < 0 ) + return( CPERR_NODEDOWN ); + + /* Deliver the message locally. If localForward returns FALSE, then + * the message still needs to be sent to a remote node. + */ + + msg->cm_packet = NULL; + msg->cm_sender = thisNode(); + + cccp_msg_deliver_local( msg, NULL, + (cccp_forward_callback_t *) cccp_msg_do_remote_send ); + + return( CPERR_OK ); + } + + int + cccp_send ( clm_msg_t *msg ) + { + int status; + + status = cccp_send_guts(msg); + + dlm_dbprintf(DBG_CCCP, "[%s:%s] exit, msg[%p] status[%d]\n", + PROCESS_NAME, __FUNCTION__, + msg, status ); + + TRCHKL2T(CPTRC_SEND_EXIT,msg,status); + return(status); + } + EXPORT_SYMBOL(cccp_msg_duplicate); EXPORT_SYMBOL(cccp_msg_destroy); EXPORT_SYMBOL(cccp_msg_create); + EXPORT_SYMBOL(cccp_send); Index: cccp_ports.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/cccp_ports.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** cccp_ports.c 25 May 2005 16:25:18 -0000 1.10 --- cccp_ports.c 8 Jul 2005 16:17:05 -0000 1.11 *************** *** 54,61 **** #include <cltrc.h> - #include <dlm_cluster.h> - #include <cccp.h> #include "cccp_private.h" static cccp_callback_t *port_table[ (CCCP_MAX_PORT + 1) ]; --- 54,60 ---- #include <cltrc.h> #include "cccp_private.h" + #include "dlm_list.h" static cccp_callback_t *port_table[ (CCCP_MAX_PORT + 1) ]; *************** *** 191,195 **** dlm_dbprintf(DBG_CCCP, ! "[%s:%s] Qeue the message from node %d for delivering at port %d\n", PROCESS_NAME, __FUNCTION__ ,msg->cm_sender,msg->cm_port); --- 190,194 ---- dlm_dbprintf(DBG_CCCP, ! "[%s:%s] Queue the message from node %d for delivering at port %d\n", PROCESS_NAME, __FUNCTION__ ,msg->cm_sender,msg->cm_port); *************** *** 220,226 **** if( msg ) { dlm_dbprintf(DBG_CCCP, ! "[%s:%s] Deqeue the message from node %d for " ! "delivery\n", /* at port %d\n",*/ ! PROCESS_NAME, __FUNCTION__ ,msg->cm_sender/*,port_index*/); } return( msg ); --- 219,225 ---- if( msg ) { dlm_dbprintf(DBG_CCCP, ! "[%s:%s] Dequeue the message from node %d for " ! "delivery at port %d\n", ! PROCESS_NAME, __FUNCTION__ ,msg->cm_sender,msg->cm_port); } return( msg ); Index: cccp_private.h =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/cccp_private.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** cccp_private.h 25 May 2005 16:25:18 -0000 1.14 --- cccp_private.h 8 Jul 2005 16:17:05 -0000 1.15 *************** *** 37,46 **** #if defined( __KERNEL__ ) # include <linux/in.h> - # include <linux/inet.h> # include <linux/net.h> # include <linux/socket.h> # include <asm/semaphore.h> # include <asm/processor.h> # include <asm/uaccess.h> #else # include <netinet/in.h> --- 37,48 ---- #if defined( __KERNEL__ ) # include <linux/in.h> # include <linux/net.h> + # include <linux/inet.h> # include <linux/socket.h> # include <asm/semaphore.h> # include <asm/processor.h> # include <asm/uaccess.h> + # include <linux/slab.h> + #else # include <netinet/in.h> *************** *** 52,58 **** #include <cccp.h> - #include <dlm_cluster.h> - #include <dlm_kernel.h> #include "cccp_pkt.h" /****************************************************************************/ --- 54,59 ---- #include <cccp.h> #include "cccp_pkt.h" + #include "../dlmdk/dlm_utilities.h" /****************************************************************************/ *************** *** 60,77 **** #define CCCP_PROTO PF_INET, SOCK_DGRAM, IPPROTO_UDP #define SUBCHANNELS 32 #if defined(DEBUG) - # if defined( __KERNEL__ ) - # define ABORT(m) do { int * xx = 0; *xx = 0xdeadbeefUL; } while( 0 ) - # else - # define ABORT(m) \ - do { extern void stack_dump( void ); \ - stack_dump(); \ - exit( 1 ); \ - } while( 0 ) - # endif - # define NO_ELSE(msg) \ else { \ --- 61,74 ---- #define CCCP_PROTO PF_INET, SOCK_DGRAM, IPPROTO_UDP #define SUBCHANNELS 32 + #define CCCP_MAX_PORT 15 + #define CCCP_MAX_NODES 16 + #ifndef FALSE + #define FALSE 0 + #define TRUE 1 + #endif #if defined(DEBUG) # define NO_ELSE(msg) \ else { \ *************** *** 79,91 **** (msg), __FILE__, __LINE__); \ } - - # define SUGGEST(cond,msg) \ - if (cond) { \ - ; \ - } NO_ELSE(msg); - #else /* DEBUG */ - # define SUGGEST(cond,msg) # define NO_ELSE(msg) --- 76,81 ---- *************** *** 224,235 **** (unsigned long) flags ); } while( 0 ) - # if defined( DEBUG ) - # define ASSERT_GLOBAL_LOCKED() \ - CCCP_ASSERT( down_trylock( & cccp_global_lock ) != 0, \ - "global lock not held" ) - # else - # define ASSERT_GLOBAL_LOCKED() - # endif - # define PROCESS_NAME current->comm --- 214,217 ---- *************** *** 267,278 **** do { (void) pthread_create( & (pid), flags, func, arg ); } while( 0 ) - # if defined( DEBUG ) - # define ASSERT_GLOBAL_LOCKED() \ - CCCP_ASSERT( pthread_mutex_trylock( & cccp_global_lock ) == EBUSY, \ - "global lock not held" ) - # else - # define ASSERT_GLOBAL_LOCKED() - # endif - # define PROCESS_NAME "CCCP" --- 249,252 ---- *************** *** 313,342 **** /* from cccp_init.c*/ extern int cccp_our_id; - extern volatile bool_t cccp_time_to_die; static inline unsigned thisNode( void ) { return( cccp_our_id ); } ! static inline int checkInit ( void ) { return (cccp_our_id != (-1)); } /* from cccp_kernel.c */ extern int cccp_time ( void ); ! extern int cccp_sock_write( cccp_sock_t sock, struct sockaddr_in *addr, ! void * data, size_t bytes ); ! extern void cccp_set_timer( unsigned long msec ); extern size_t cccp_timeout_status( char * buf, unsigned limit ); - extern void cccp_timer_release( void ); /* from cccp_init.c */ - extern cccp_sock_t cccp_our_sock; extern cccp_mutex_t cccp_global_lock; /* from cccp_udp.c */ ! extern int cccp_ip_init( void ); ! extern void * cccp_poll_loop( void * arg ); ! extern void * cccp_retransmit_loop( void * arg ); ! extern void cccp_poll_timer_handler( unsigned long unused ); ! extern cccp_sem_t cccp_poll_sem; ! extern void cccp_set_port(int port); ! extern int cccp_port_number; /* from cccp_proto.c */ --- 287,308 ---- /* from cccp_init.c*/ extern int cccp_our_id; static inline unsigned thisNode( void ) { return( cccp_our_id ); } ! static inline int cccp_running ( void ) { return (cccp_our_id != (-1)); } /* from cccp_kernel.c */ extern int cccp_time ( void ); ! extern int cccp_sock_write( clm_pkt_t *pkt, struct sockaddr_in *addr, ! void * data); ! extern void cccp_set_timer( unsigned long ticks); extern size_t cccp_timeout_status( char * buf, unsigned limit ); /* from cccp_init.c */ extern cccp_mutex_t cccp_global_lock; /* from cccp_udp.c */ ! extern int cccp_udp_start( int port ); ! extern int cccp_udp_stop( void ); /* from cccp_proto.c */ *************** *** 344,351 **** extern size_t cccp_node_list( char * buf, unsigned limit ); extern void finishMessage ( clm_msg_t * msg, int acktype ); - extern int ipConn(void); - - /* from cccp_input.c */ - extern int handlePacket( uint, clm_msg_t *, clm_pkt_t * ); /* from cccp_msg.c */ --- 310,313 ---- *************** *** 366,369 **** --- 328,333 ---- /* from cccp_deliver.c */ + extern int cccp_deliver_start(void); + extern int cccp_deliver_stop(void); extern void cccp_msg_deliver_local( clm_msg_t * msg, cccp_forward_callback_t * not_forwarded, *************** *** 393,419 **** (unsigned) (& ((( structure * ) 0)-> field)) ! /****************************************************************************/ ! /* id2server - Convert node ID to a server TCP/UDP port ! * ! * Convert a node ID to a port number for accepting connections (TCP) or ! * receiving packets (UDP). ! * ! * RETURNS ! * ! * Port number. ! * ! * NOTES ! * ! * The port number returned by this function is a constant not derived from ! * the node id. I don't really know if there'll ever be a case where we want ! * to return a node-specific value, but this function is included anyway for ! * symmetry and possible future debugging. ! */ ! static inline uint ! id2server ( void ) ! { ! return( htons(cccp_port_number) ); ! } #endif /* CCCP_PRIVATE_H */ --- 357,451 ---- (unsigned) (& ((( structure * ) 0)-> field)) ! #if defined(DEBUG) ! #ifdef __KERNEL__ ! ! #ifdef CCCP_ASSERT ! #undef CCCP_ASSERT ! #endif ! ! #define as_str(a) as_str_b(a) ! #define as_str_b(a) #a ! #define CCCP_ASSERT(cond,msg) \ ! if (cond) { \ ! ; \ ! } else { \ ! dlm_log(LOG_CRIT,"ASSERT FAILED: %s: %s, file %s, line %d\n", \ ! (msg), __FUNCTION__, __FILE__, __LINE__); \ ! BUG(); \ ! } ! ! ! #else /* i.e. !defined(__KERNEL__)*/ ! ! #ifdef CCCP_ASSERT ! #undef CCCP_ASSERT ! #endif ! #define CCCP_ASSERT(cond,msg) \ ! if (cond) { \ ! ; \ ! } else { \ ! fflush(stdout); \ ! fprintf(stderr,"ASSERT FAILED: %s: %s, file %s, line %d\n", \ ! (msg), __FUNCTION__, __FILE__, __LINE__); \ ! fflush(stderr); \ ! BUG(); \ ! } ! ! ! ! #endif /* __KERNEL__ */ ! ! #else /* i.e. !defined(DEBUG)*/ ! ! #ifdef CCCP_ASSERT ! #undef CCCP_ASSERT ! #endif ! #define CCCP_ASSERT(cond,msg) ! ! #endif ! ! ! ! #define CPTRC_BASE 0x90000000 ! ! #define CPTRC_UINIT_ENTRY (CPTRC_BASE + 0x00) ! #define CPTRC_UINIT_EXIT (CPTRC_BASE + 0x01) ! #define CPTRC_USTOP_ENTRY (CPTRC_BASE + 0x02) ! #define CPTRC_USTOP_EXIT (CPTRC_BASE + 0x03) ! #define CPTRC_KINIT_ENTRY (CPTRC_BASE + 0x04) ! #define CPTRC_KINIT_EXIT (CPTRC_BASE + 0x05) ! #define CPTRC_KSTOP_ENTRY (CPTRC_BASE + 0x06) ! #define CPTRC_KSTOP_EXIT (CPTRC_BASE + 0x07) ! ! #define CPTRC_SEND_ENTRY (CPTRC_BASE + 0x10) ! #define CPTRC_SEND_EXIT (CPTRC_BASE + 0x11) ! #define CPTRC_LISTEN_ENTRY (CPTRC_BASE + 0x12) ! #define CPTRC_LISTEN_EXIT (CPTRC_BASE + 0x13) ! #define CPTRC_SEND_ENTRY_LK (CPTRC_BASE + 0x14) ! ! #define CPTRC_SNDCB_INVOKE (CPTRC_BASE + 0x20) ! #define CPTRC_SNDCB_RETURN (CPTRC_BASE + 0x21) ! #define CPTRC_RCVCB_INVOKE (CPTRC_BASE + 0x22) ! #define CPTRC_RCVCB_RETURN (CPTRC_BASE + 0x23) ! #define CPTRC_FORWARDED (CPTRC_BASE + 0x24) ! ! #define CPTRC_TRANSMIT (CPTRC_BASE + 0x30) ! #define CPTRC_GOTREDIR (CPTRC_BASE + 0x31) ! #define CPTRC_RETRY (CPTRC_BASE + 0x32) ! #define CPTRC_ENQUEUE (CPTRC_BASE + 0x33) ! #define CPTRC_DEQUEUE (CPTRC_BASE + 0x34) ! #define CPTRC_GOTACKS (CPTRC_BASE + 0x35) ! ! #define CPTRC_WRITE (CPTRC_BASE + 0x40) ! #define CPTRC_READ (CPTRC_BASE + 0x41) ! #define CPTRC_DUPLICATE (CPTRC_BASE + 0x42) ! ! #define CPTRC_POLL_ENTRY (CPTRC_BASE + 0x50) ! #define CPTRC_POLL_PROC (CPTRC_BASE + 0x51) ! #define CPTRC_POLL_ERROR (CPTRC_BASE + 0x52) ! #define CPTRC_POLL_DONE (CPTRC_BASE + 0x53) ! ! #define CPTRC_ACQUIRE_LOCK (CPTRC_BASE + 0x60) #endif /* CCCP_PRIVATE_H */ Index: cccp_proto.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/cccp_proto.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** cccp_proto.c 3 Jun 2005 19:27:15 -0000 1.20 --- cccp_proto.c 8 Jul 2005 16:17:05 -0000 1.21 *************** *** 78,87 **** #include <cltrc.h> - #include <dlm_cluster.h> #include <cccp.h> #include "cccp_pkt.h" #include "cccp_queue.h" - #include "cccp_private.h" #include "cccp_proto.h" --- 78,86 ---- #include <cltrc.h> #include <cccp.h> + #include "cccp_private.h" #include "cccp_pkt.h" #include "cccp_queue.h" #include "cccp_proto.h" *************** *** 136,147 **** #define ORIG_STATE NS_NEED2SENDACK #define RESTART_STATE NS_NEED2SENDACK - #define MARK_SOCK_CLOSED(n) \ - do { \ - CCCP_ASSERT( (n)->old_fd == CCCP_SOCK_INVALID, \ - "old_fd set twice" ); \ - (n)->old_fd = node->fd; \ - (n)->fd = CCCP_SOCK_INVALID; \ - } while( 0 ) - #if defined( SHOW_RETRANS ) # define LOG_RETRANS(s, i, n ) \ --- 135,138 ---- *************** *** 160,166 **** typedef struct cccp_nodelist { ! cccp_sock_t sock; int num_nodes; ! struct cccp_node_info *nodes[MAXNODES]; }cccp_nodelist_t; --- 151,158 ---- typedef struct cccp_nodelist { ! int localid; ! int port_number; int num_nodes; ! struct cccp_node_info *nodes[CCCP_MAX_NODES]; }cccp_nodelist_t; *************** *** 206,210 **** } } ! nodeList.sock = oldl.sock; nodeList.num_nodes = oldl.num_nodes; } --- 198,203 ---- } } ! nodeList.localid = oldl.localid; ! nodeList.port_number = oldl.port_number; nodeList.num_nodes = oldl.num_nodes; } *************** *** 378,382 **** /* configure the dest addr */ ni->addr.sin_family = AF_INET; ! ni->addr.sin_port = id2server(); ni->addr.sin_addr = *saddr; ni->nextredirslot = OFFSET_REDIR; --- 371,375 ---- /* configure the dest addr */ ni->addr.sin_family = AF_INET; ! ni->addr.sin_port = nodeList.port_number; ni->addr.sin_addr = *saddr; ni->nextredirslot = OFFSET_REDIR; *************** *** 396,454 **** } - - /****************************************************************************/ - /* ipConn - Make a socke connection to a node - * - * Make a TCP connection to a particular node. - * - * RETURNS - * - * Zero on success, or a negative-errno value on failure. - */ - - int - ipConn( void ) - { - int status; - struct sockaddr_in addr; - cccp_sock_t * sock; - - /* if socket is already created just return */ - if (nodeList.sock != NULL) - { - dlm_log(LOG_INFO, "Send socket already created\n"); - return( 0 ); - } - /* create a new socket */ - sock = &nodeList.sock; - CCCP_SOCK_CREATE( sock, status ); - if ( status < 0 ) { - dlm_log(LOG_CRIT, "Unable to obtain new send socket\n"); - return( status ); - } - - - /* bind to a well-known address so the other side will recognize us*/ - addr.sin_family = AF_INET; - addr.sin_addr.s_addr = INADDR_ANY; - addr.sin_port = 0; - - status = CCCP_SOCK_BIND( *sock, (struct sockaddr *) &addr,sizeof( addr ) ); - if ( status < 0 ) - { - dlm_log(LOG_CRIT, - "%s failed sock 0x%08lx bind for send socket, errno %u", - __FUNCTION__, (unsigned long) *sock, -status ); - - CCCP_SOCK_CLOSE( *sock ); - return(status); - } - - dlm_dbprintf(DBG_CCCP, "binded to send socket\n"); - - /* everything's OK*/ - return( CPERR_OK ); - } - /****************************************************************************/ /* finishMessage - --- 389,392 ---- *************** *** 484,491 **** TRCHKL1T(CPTRC_SNDCB_RETURN,msg); } else { - /* free everything ourselves*/ - SUGGEST( msg->cm_private == NULL, - "cm_private with no send callback" ); - if ( msg->cm_data != NULL ) { CLM_FREE(msg->cm_data); --- 422,425 ---- *************** *** 604,613 **** cccp_our_id = -1; - if (CCCP_SOCK_IS_VALID(nodeList.sock)) - { - CCCP_SOCK_CLOSE(nodeList.sock); - nodeList.sock = NULL; - } - /* de-establish connections for all remote nodes */ for (i=0; i<nodeList.num_nodes; i++) --- 538,541 ---- *************** *** 617,620 **** --- 545,551 ---- node->node_int = NULL; } + + cccp_udp_stop(); + cccp_deliver_stop(); } *************** *** 647,652 **** uint nodeid, ! struct in_addr saddr, ! uint localid ) { --- 578,582 ---- uint nodeid, ! struct in_addr *saddr ) { *************** *** 656,663 **** /* make sure we don't exceed our max */ ! if (nodeList.num_nodes >= MAXNODES) { ! dlm_log(LOG_CRIT, "[%s:%s] nodeid=%d has exceeded MAXNODES=%d\n", ! PROCESS_NAME, __FUNCTION__, nodeid, MAXNODES); goto done; } --- 586,593 ---- /* make sure we don't exceed our max */ ! if (nodeList.num_nodes >= CCCP_MAX_NODES) { ! dlm_log(LOG_CRIT, "[%s:%s] nodeid=%d has exceeded CCCP_MAX_NODES=%d\n", ! PROCESS_NAME, __FUNCTION__, nodeid, CCCP_MAX_NODES); goto done; } *************** *** 672,676 **** } ni->nodeid = nodeid; ! ni->saddr = saddr; ni->node_int = NULL; --- 602,606 ---- } ni->nodeid = nodeid; ! ni->saddr = *saddr; ni->node_int = NULL; *************** *** 685,689 **** /* hook the node into the master list */ nodeList.nodes[nodeList.num_nodes++] = ni; ! if (cccp_our_id > 0) { ni->node_int = updateNodeInfo(ni->nodeid, &ni->saddr); --- 615,619 ---- /* hook the node into the master list */ nodeList.nodes[nodeList.num_nodes++] = ni; ! if (cccp_running()) { ni->node_int = updateNodeInfo(ni->nodeid, &ni->saddr); *************** *** 699,703 **** * any connections for previously established cccp nodes */ ! if (localid == ni->nodeid) { int i; --- 629,633 ---- * any connections for previously established cccp nodes */ ! if (nodeList.localid == ni->nodeid) { int i; *************** *** 705,712 **** /* assign the local id */ ! cccp_our_id = localid; /* open the output port */ ! ipConn(); /* establish connections for all remote nodes */ --- 635,643 ---- /* assign the local id */ ! cccp_our_id = nodeList.localid; /* open the output port */ ! cccp_udp_start(nodeList.port_number); ! cccp_deliver_start(); /* establish connections for all remote nodes */ *************** *** 745,751 **** { int status; - struct iovec iov[2]; - size_t total_len; - struct msghdr msg_header; #if defined( STRESS ) clm_pkt_t corrupt_pkt; --- 676,679 ---- *************** *** 757,811 **** pkt->cp_session = ++(node->session); pkt->cp_acks = node->incolor; ! pkt->cp_header_length = sizeof( clm_pkt_t ); ! LOG_PACKET( pkt ); ! if ( ! CCCP_SOCK_IS_VALID( nodeList.sock ) ) ! { ! dlm_log(LOG_WARNING, "[%s:%s] Send socket not enabled yet!!\n", ! PROCESS_NAME, __FUNCTION__ ); ! ! return( FALSE ); ! } ! ! ! msg_header.msg_name = &node->addr; ! msg_header.msg_namelen = sizeof(node->addr); ! msg_header.msg_iov = iov; ! msg_header.msg_control = NULL; ! msg_header.msg_controllen = 0; ! msg_header.msg_flags = MSG_NOSIGNAL; ! ! iov[0].iov_base = pkt; ! iov[0].iov_len = pkt->cp_header_length; ! ! total_len = 0; ! if ( ((pkt->cp_flags & CPF_MSG_PRESENT) != 0) ! && (pkt->cp_length != 0) ) ! { ! CCCP_ASSERT( udata != NULL, "missing message body in transmitPacket" ); ! ! iov[1].iov_base = udata; ! iov[1].iov_len = pkt->cp_length; ! msg_header.msg_iovlen = 2; ! } ! else ! { ! msg_header.msg_iovlen = 1; ! ! pkt->cp_length = 0; ! if ( (pkt->cp_flags & CPF_REDIR_VALID) == 0) ! { ! /* If there is no message data, and there is no redirect, then we ! * don't need to send that part of the header. ! */ ! ! /* this seems fishy?? it breaks with iov_len above .. -DCZ */ ! // pkt->cp_header_length = offset_of( clm_pkt_t, cp_redirect ); ! } ! } ! ! total_len = pkt->cp_length + pkt->cp_header_length; #if defined( STRESS ) ! if ( (msg_header.msg_iovlen == 2) && ((random() % 1000) < 7) ) { corrupt_pkt = *pkt; --- 685,692 ---- pkt->cp_session = ++(node->session); pkt->cp_acks = node->incolor; ! pkt->cp_node = node->nodeid; #if defined( STRESS ) ! if ( (msg_header.msg_iovlen == 2) && ((cccp_time() % 1000) < 7) ) { corrupt_pkt = *pkt; *************** *** 817,832 **** #endif /* STRESS */ ! status = CCCP_SOCK_SENDMSG( nodeList.sock, & msg_header, total_len ); if (status < 0) { ! dlm_log(LOG_ERR, "[%s:%s] failed sock 0x%08lx, errno %d", ! PROCESS_NAME, __FUNCTION__, ! (unsigned long) nodeList.sock, -status ); } - - dlm_dbprintf(DBG_CCCP, "[%s:%s] returning %s\n", - PROCESS_NAME, __FUNCTION__, - (status >= 0) ? "success" : "failure" ); return( status >= 0 ); } --- 698,708 ---- #endif /* STRESS */ ! status = cccp_sock_write(pkt, &node->addr, udata); if (status < 0) { ! dlm_log(LOG_ERR, "%s: write to %d failed, errno %d", __FUNCTION__, ! node->nodeid, -status ); } return( status >= 0 ); } *************** *** 1021,1025 **** /* OUTPUT: TRUE if packet queued/sent, FALSE otherwise*/ /* took this out of the Makefile, not sure why this is special.. -dcz */ - #define OLD_MARSHAL 1 int queuePacket ( clm_msg_t *msg, clm_pkt_t *pkt, uint dest_node ) --- 897,900 ---- *************** *** 1035,1042 **** node = getNodeInfo( dest_node ); if ( node != NULL ) { - #if defined( OLD_MARSHAL ) - pkt->cp_node = dest_node; - pkt->cp_srcnode = thisNode(); - #endif status = sendPacket( msg, pkt, node ); if ( ! status && (msg != NULL) ) --- 910,913 ---- *************** *** 1104,1108 **** PROCESS_NAME, __FUNCTION__, ack_mask, i ); ! i = NEXT_CHANNEL( i, offset ); continue; } --- 975,979 ---- PROCESS_NAME, __FUNCTION__, ack_mask, i ); ! i = NEXT_CHANNEL(i, offset ); continue; } *************** *** 1145,1151 **** (queue_flush_func_t *) sendPacket, 0); } } CCCP_ASSERT( i >= offset, "Invalid slot!" ); ! i = NEXT_CHANNEL( i, offset ); } while (i != start); } --- 1016,1024 ---- (queue_flush_func_t *) sendPacket, 0); } + CLRBIT(ack_mask, i); } CCCP_ASSERT( i >= offset, "Invalid slot!" ); ! if (ack_mask == 0) break; ! i = NEXT_CHANNEL(i, offset ); } while (i != start); } *************** *** 1604,1614 **** cccp_init_pkt( & mypkt ); ! mypkt.cp_session = ++node->session; ! mypkt.cp_node = node->nodeid; ! mypkt.cp_acks = node->incolor; ! mypkt.cp_header_length = offset_of( clm_pkt_t, cp_redirect ); ! ! status = cccp_sock_write( nodeList.sock, &node->addr, & mypkt, ! mypkt.cp_header_length ); if ( status < 0 ) { --- 1477,1481 ---- cccp_init_pkt( & mypkt ); ! status = transmitPacket( node, &mypkt, NULL ); if ( status < 0 ) { *************** *** 1666,1670 **** { node = nodeList.nodes[i]->node_int; ! if ( (node != NULL) && CCCP_SOCK_IS_VALID( nodeList.sock ) ) { temp = ackTimeout( node ); --- 1533,1537 ---- { node = nodeList.nodes[i]->node_int; ! if (node != NULL) { temp = ackTimeout( node ); *************** *** 1715,1719 **** pkt->cp_redirect.cr_port = msg->cm_port; pkt->cp_redirect.cr_oldchan = chan; ! /* free the clm_msg_t*/ cccp_msg_free( msg, CPERR_OK ); --- 1582,1587 ---- pkt->cp_redirect.cr_port = msg->cm_port; pkt->cp_redirect.cr_oldchan = chan; ! pkt->cp_srcnode = thisNode(); ! /* free the clm_msg_t*/ cccp_msg_free( msg, CPERR_OK ); *************** *** 1882,1892 **** #endif - /* - * it is possible to generate a NACK before connection is open. If file - * descriptor is invalid, we can't send a NACK - */ - if ( ! CCCP_SOCK_IS_VALID( nodeList.sock ) ) - return; - cccp_init_pkt( & mypkt ); --- 1750,1753 ---- *************** *** 1953,1957 **** } ! status = cccp_sock_write(nodeList.sock, &(node->addr), &mypkt, sizeof mypkt); if ( status < 0 ) { --- 1814,1818 ---- } ! status = cccp_sock_write(&mypkt, &(node->addr), NULL); if ( status < 0 ) { *************** *** 2157,2161 **** } ! EXPORT_SYMBOL(cccp_node_down); ! EXPORT_SYMBOL(cccp_node_up); EXPORT_SYMBOL(cccp_change_topology); --- 2018,2059 ---- } ! int cccp_configure( int cmd, int data, void *private) ! { ! if ((cmd < 0) || (cmd > CCCP_CONFIG_CMD_MAX)) ! return CPERR_ILLEGAL; ! ! switch (cmd) { ! case CCCP_SET_PORT: ! nodeList.port_number = data; ! break; ! ! case CCCP_SET_LOCAL: ! nodeList.localid = data; ! break; ! ! case CCCP_NODE_UP: ! if (private == NULL) ! return CPERR_ILLEGAL; ! ! if (!cccp_node_up(data, private)) ! return CPERR_UNKNOWN; ! ! break; ! ! case CCCP_NODE_DOWN: ! cccp_node_down(data); ! break; ! ! case CCCP_SHUTDOWN: ! cccp_node_down(0); ! break; ! ! default: ! return CPERR_ILLEGAL; ! } ! ! return CPERR_OK; ! } ! ! EXPORT_SYMBOL(cccp_configure); EXPORT_SYMBOL(cccp_change_topology); Index: cccp_proto.h =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/cccp_proto.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** cccp_proto.h 14 Mar 2005 20:33:16 -0000 1.5 --- cccp_proto.h 8 Jul 2005 16:17:05 -0000 1.6 *************** *** 30,35 **** #ident "$Id$" - #include <dlm.h> - struct cccp_node; typedef struct cccp_node cccp_node_t; --- 30,33 ---- Index: cccp_queue.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/cccp_queue.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** cccp_queue.c 25 May 2005 16:25:19 -0000 1.4 --- cccp_queue.c 8 Jul 2005 16:17:05 -0000 1.5 *************** *** 66,75 **** #include <cltrc.h> - #include <dlm_cluster.h> #include <cccp.h> #include "cccp_pkt.h" #include "cccp_queue.h" - #include "cccp_private.h" /* FUNCTION: traverseQueue*/ --- 66,74 ---- #include <cltrc.h> #include <cccp.h> + #include "cccp_private.h" #include "cccp_pkt.h" #include "cccp_queue.h" /* FUNCTION: traverseQueue*/ Index: cccp_udp.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/cccp_udp.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** cccp_udp.c 25 May 2005 16:25:19 -0000 1.14 --- cccp_udp.c 8 Jul 2005 16:17:05 -0000 1.15 *************** *** 47,65 **** # include <linux/sched.h> #else # include <errno.h> - # include <signal.h> # include <unistd.h> # include <string.h> # include <sys/poll.h> # include <sys/uio.h> [...977 lines suppressed...] ! if ( next_timeout < 4 ) ! { ! dlm_dbprintf(DBG_CCCP, "next_timeout = %lu", next_timeout ); ! } ! #endif ! } while( ! cccp_time_to_die ); /* cleanup timer */ --- 851,855 ---- CCCP_MUTEX_UNLOCK( & cccp_global_lock ); ! } while( cccp_running() ); /* cleanup timer */ *************** *** 475,477 **** return( NULL ); } - EXPORT_SYMBOL(cccp_set_port); --- 867,868 ---- --- cccp_input.c DELETED --- --- cccp_kernel.c DELETED --- --- cccp_output.c DELETED --- |
|
From: <cao...@us...> - 2005-07-08 16:17:45
|
Update of /cvsroot/opendlm/opendlm/src/api In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5108/src/api Modified Files: api_ais_lock.c api_domain.c api_errno.c api_glue.c api_group.c api_init.c api_purge.c api_resource.c api_scn.c api_setnotify.c api_syscall.c api_tune.c api_unix.c api_vms.c ast_stub.c print.c Log Message: Header and CCCP cleanups Index: api_ais_lock.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_ais_lock.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** api_ais_lock.c 25 May 2005 16:25:17 -0000 1.6 --- api_ais_lock.c 8 Jul 2005 16:17:03 -0000 1.7 *************** *** 12,23 **** - #include "dlm.h" - #include "ast.h" #include "clmstructs.h" ! #include "dlm_kernel.h" ! #include "pti.h" #include "api_ais_lock.h" - #include "api_data.h" #include "api_init.h" --- 12,19 ---- #include "clmstructs.h" ! #include "dlm_log.h" #include "api_ais_lock.h" #include "api_data.h" #include "api_init.h" *************** *** 595,599 **** if (response.clm_status == DLM_WORKING) { ! printf("DLM_WORKING_TER returned from API call!!\n"); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); --- 591,595 ---- if (response.clm_status == DLM_WORKING) { ! dlm_log(LOG_WARNING, "DLM_WORKING_TER returned from API call!!\n"); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); *************** *** 606,610 **** #if defined(DEBUG) if (debug) { ! fprintf(stderr, "dlmunlock: grace sleep(%d)\n", GRACE_SLEEP); } #endif --- 602,606 ---- #if defined(DEBUG) if (debug) { ! dlm_log(LOG_INFO, "dlmunlock: grace sleep(%d)\n", GRACE_SLEEP); } #endif *************** *** 676,680 **** #if defined(DEBUG) if (debug) { ! fprint_debug("dlmunlock: grace sleep(%d)\n", GRACE_SLEEP); } #endif --- 672,676 ---- #if defined(DEBUG) if (debug) { ! dlm_log(LOG_INFO, "dlmunlock: grace sleep(%d)\n", GRACE_SLEEP); } #endif *************** *** 722,726 **** #if defined(DEBUG) if (debug) { ! fprintf(stderr, "dlm_purge: grace sleep(%d)\n", GRACE_SLEEP); } #endif --- 718,722 ---- #if defined(DEBUG) if (debug) { ! dlm_log(LOG_INFO, "dlm_purge: grace sleep(%d)\n", GRACE_SLEEP); } #endif Index: api_domain.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_domain.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** api_domain.c 5 May 2005 18:55:01 -0000 1.4 --- api_domain.c 8 Jul 2005 16:17:03 -0000 1.5 *************** *** 35,58 **** #ifdef __KERNEL__ ! ! # ifndef MODULE ! # define MODULE ! # endif ! ! # include <linux/kernel.h> ! # define __NO_VERSION__ ! # include <linux/module.h> ! # ifdef USING_FULL_VERSIONING ! # if CONFIG_MODVERSIONS==1 ! # define MODVERSIONS ! # include <linux/modversions.h> ! # endif ! # endif /* USING_FULL_VERSIONING */ ! ! ! #endif /* __KERNEL__ */ ! ! ! #ifndef __KERNEL__ #include <stdio.h> #include <string.h> --- 35,41 ---- #ifdef __KERNEL__ ! #include "dlm_module.h" ! #include <linux/string.h> ! #else #include <stdio.h> #include <string.h> *************** *** 61,70 **** - #include "dlm.h" #include "clmstructs.h" #include "api_data.h" #include "api_init.h" - #include "api_glue.h" #include "api_proto.h" /* Should be LAST included file. */ --- 44,52 ---- #include "clmstructs.h" + #include "dlm_log.h" #include "api_data.h" #include "api_init.h" #include "api_proto.h" /* Should be LAST included file. */ *************** *** 76,84 **** { if (app_domain_id != 0) ! #ifndef __KERNEL__ ! printf("dlm_set_domain: Modifying a set recovery domain!!\n"); ! #else ! printk("dlm_set_domain: Modifying a set recovery domain!!\n"); ! #endif app_domain_id = domain_id; } --- 58,63 ---- { if (app_domain_id != 0) ! dlm_log(LOG_WARNING, "dlm_set_domain: Modifying a set recovery domain!!\n"); ! app_domain_id = domain_id; } Index: api_errno.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_errno.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** api_errno.c 5 May 2005 18:55:01 -0000 1.3 --- api_errno.c 8 Jul 2005 16:17:03 -0000 1.4 *************** *** 37,59 **** #ifdef __KERNEL__ ! ! # ifndef MODULE ! # define MODULE ! # endif ! ! # include <linux/kernel.h> ! # define __NO_VERSION__ ! # include <linux/module.h> ! # ifdef USING_FULL_VERSIONING ! # if CONFIG_MODVERSIONS==1 ! # define MODVERSIONS ! # include <linux/modversions.h> ! # endif ! # endif /* USING_FULL_VERSIONING */ #endif /* __KERNEL__ */ - - - #ifdef dlm_errno #undef dlm_errno --- 37,43 ---- #ifdef __KERNEL__ ! #include "dlm_module.h" #endif /* __KERNEL__ */ #ifdef dlm_errno #undef dlm_errno Index: api_glue.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_glue.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** api_glue.c 25 May 2005 16:25:17 -0000 1.7 --- api_glue.c 8 Jul 2005 16:17:03 -0000 1.8 *************** *** 40,60 **** #include <stdio.h> #include <stdlib.h> - #include <time.h> #include <errno.h> #include <fcntl.h> - #include <unistd.h> #include <string.h> - #include <sys/time.h> - #include <sys/param.h> - #include <sys/types.h> - #include <sys/stat.h> - #include <sys/socket.h> - #include <sys/un.h> - #include "dlm.h" #include "dlm_devmsg.h" - #include "ast.h" - #include "ast_stub.h" #include "clmstructs.h" #include "clmutex_r.h" #include "api_data.h" --- 40,50 ---- #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <fcntl.h> #include <string.h> #include "dlm_devmsg.h" #include "clmstructs.h" + #include "dlm_log.h" #include "clmutex_r.h" #include "api_data.h" *************** *** 177,181 **** if (MAXNAMLEN <= strlen(OVERRIDE_DLM_NAME)) { #ifdef NOT_DEFINED ! fprintf(stderr, "Overriding DLM name too long len/val[%d/%s]\n", strlen(OVERRIDE_DLM_NAME), --- 167,171 ---- if (MAXNAMLEN <= strlen(OVERRIDE_DLM_NAME)) { #ifdef NOT_DEFINED ! dlm_log(LOG_WARNING, "Overriding DLM name too long len/val[%d/%s]\n", strlen(OVERRIDE_DLM_NAME), *************** *** 193,197 **** if (MAXNAMLEN <= strlen(OVERRIDE_LOCKS_NAME)) { #ifdef NOT_DEFINED ! fprintf(stderr, "Overriding DLM/LOCKS name too long len/val[%d/%s]\n", strlen(OVERRIDE_LOCKS_NAME), --- 183,187 ---- if (MAXNAMLEN <= strlen(OVERRIDE_LOCKS_NAME)) { #ifdef NOT_DEFINED ! dlm_log(LOG_WARNING, "Overriding DLM/LOCKS name too long len/val[%d/%s]\n", strlen(OVERRIDE_LOCKS_NAME), *************** *** 215,219 **** */ #ifdef NOT_DEFINED ! fprintf(stderr, "Attempt to open lock device [%s]\n", lock_device); --- 205,209 ---- */ #ifdef NOT_DEFINED ! dlm_log(LOG_INFO, "Attempt to open lock device [%s]\n", lock_device); *************** *** 224,228 **** if (-1 == rc) { #ifdef NOT_DEFINED ! fprintf(stderr, "Error opening lock device, [%d/%s]\n", errno, --- 214,218 ---- if (-1 == rc) { #ifdef NOT_DEFINED ! dlm_log(LOG_ERR, "Error opening lock device, [%d/%s]\n", errno, *************** *** 260,264 **** rc = fcntl(locks_fd, F_SETFD, flags); if (-1 == rc) { ! fprintf(stderr, "Cannot set close on exec, err [%d/%s]\n", errno, --- 250,254 ---- rc = fcntl(locks_fd, F_SETFD, flags); if (-1 == rc) { ! dlm_log(LOG_ERR, "Cannot set close on exec, err [%d/%s]\n", errno, *************** *** 270,274 **** }else{ ! fprintf(stderr, "Cannot get flags to set close on exec, err [%d/%s]\n", errno, --- 260,264 ---- }else{ ! dlm_log(LOG_ERR, "Cannot get flags to set close on exec, err [%d/%s]\n", errno, *************** *** 285,289 **** sockfd = socket(AF_LOCAL, SOCK_STREAM, 0); if (!sockfd) { ! fprintf(stderr, "Error opening socket for poll\n"); return -1; } --- 275,279 ---- sockfd = socket(AF_LOCAL, SOCK_STREAM, 0); if (!sockfd) { ! dlm_log(LOG_ERR, "Error opening socket for poll\n"); return -1; } *************** *** 392,396 **** #ifdef NOT_DEFINED ! fprintf(stderr, "Retrieve AST to address [%p]\n", p); #endif --- 382,386 ---- #ifdef NOT_DEFINED ! dlm_log(LOG_INFO, "Retrieve AST to address [%p]\n", p); #endif Index: api_group.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_group.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** api_group.c 25 May 2005 16:25:17 -0000 1.2 --- api_group.c 8 Jul 2005 16:17:03 -0000 1.3 *************** *** 36,67 **** #ifdef __KERNEL__ ! # ifndef MODULE ! # define MODULE ! # endif ! ! # include <linux/kernel.h> ! # define __NO_VERSION__ ! # include <linux/module.h> ! # ifdef USING_FULL_VERSIONING ! # if CONFIG_MODVERSIONS==1 ! # define MODVERSIONS ! # include <linux/modversions.h> ! # endif ! # endif /* USING_FULL_VERSIONING */ ! #else - - #include <stdio.h> - #include <unistd.h> - #include <sys/types.h> - #include <sys/file.h> - #include <sys/stat.h> - - #include "dlm.h" - #include "ast.h" #include "clmstructs.h" - #include "pti.h" #endif /* __KERNEL__ */ --- 36,44 ---- #ifdef __KERNEL__ ! #include "dlm_module.h" #else #include "clmstructs.h" #endif /* __KERNEL__ */ Index: api_init.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_init.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** api_init.c 25 May 2005 16:25:17 -0000 1.10 --- api_init.c 8 Jul 2005 16:17:03 -0000 1.11 *************** *** 44,90 **** #ifdef __KERNEL__ ! #ifndef MODULE ! # define MODULE ! #endif ! ! #include <linux/kernel.h> ! #include <linux/module.h> ! #include "clmstructs.h" ! #ifdef USING_FULL_VERSIONING ! ! #if CONFIG_MODVERSIONS==1 ! #define MODVERSIONS ! #include <linux/modversions.h> ! #endif ! #endif /* USING_FULL_VERSIONING */ ! ! extern int OurSiteID; ! extern clm_client_t * findclientbypid(int site, int pid); #else - #include <stdio.h> #include <stdlib.h> - #include <unistd.h> - #include <string.h> - #include <signal.h> - #include <sys/types.h> - #include <sys/file.h> - #include <sys/ioctl.h> - #include <sys/stat.h> - - #endif /* __KERNEL__ */ - #include "dlm.h" - #include "ast.h" #include "clmstructs.h" - #include "dlm_kernel.h" - #include "pti.h" #include "clmutex_r.h" #include "api_data.h" - #include "api_glue.h" #include "api_proto.h" /* Should be LAST included file. */ --- 44,60 ---- #ifdef __KERNEL__ ! #define MODULE_DEFINITION_FILE ! #include "dlm_module.h" #else #include <stdlib.h> #endif /* __KERNEL__ */ #include "clmstructs.h" #include "clmutex_r.h" #include "api_data.h" #include "api_proto.h" /* Should be LAST included file. */ *************** *** 93,97 **** static spinlock_t clminit_mutex = SPIN_LOCK_UNLOCKED; static spinlock_t sequence_mutex = SPIN_LOCK_UNLOCKED; - static void dlm_init_tq ( void *, kmem_cache_t *, unsigned long); #else /* __KERNEL__ */ /* clminit_mutex protects OurPid, HostName and sequence */ --- 63,66 ---- *************** *** 117,120 **** --- 86,93 ---- #endif + #include <linux/slab.h> + extern kmem_cache_t * dlm_keventd_cache; + static void dlm_init_tq ( void *, kmem_cache_t *, unsigned long); + /* * Name: dlm_init_tq *************** *** 226,229 **** --- 199,205 ---- register int pid; dlm_stats_t _init; + #else + extern int OurSiteID; + extern clm_client_t * findclientbypid(int site, int pid); #endif /* __KERNEL__ */ *************** *** 277,281 **** lvb_old_behave = 0; if (getenv("CLM_LVB_VAR")) { ! fprintf(stderr, "Lock value behavior variable [%s] set, ignoring.\n", "CLM_LVB_VAR"); --- 253,257 ---- lvb_old_behave = 0; if (getenv("CLM_LVB_VAR")) { ! dlm_log(LOG_WARNING, "Lock value behavior variable [%s] set, ignoring.\n", "CLM_LVB_VAR"); *************** *** 364,373 **** } if (response->clm_sequence != seq) { ! fprintf(stderr, "Transaction mismatch detected in API\n"); return -1; } if (transdebug) ! printf("RECV TRANSACTION %d\n", response->clm_sequence); return 0; } --- 340,349 ---- } if (response->clm_sequence != seq) { ! dlm_log(LOG_ERR , "Transaction mismatch detected in API\n"); return -1; } if (transdebug) ! dlm_log(LOG_DEBUG, "RECV TRANSACTION %d\n", response->clm_sequence); return 0; } *************** *** 401,405 **** if (transdebug) ! print_debug("[%s] SEND TRANSACTION %d\n", __FUNCTION__, request->clm_sequence); #ifdef __KERNEL__ --- 377,381 ---- if (transdebug) ! dlm_log(LOG_DEBUG, "[%s] SEND TRANSACTION %d\n", __FUNCTION__, request->clm_sequence); #ifdef __KERNEL__ *************** *** 431,440 **** if (response->clm_sequence != seq) { ! fprint_error("Transaction mismatch detected in API\n"); return -1; } if (transdebug) ! print_debug("[%s] RECV TRANSACTION %d\n", __FUNCTION__, response->clm_sequence); return 0; } --- 407,416 ---- if (response->clm_sequence != seq) { ! dlm_log(LOG_ERR, "Transaction mismatch detected in API\n"); return -1; } if (transdebug) ! dlm_log(LOG_DEBUG, "[%s] RECV TRANSACTION %d\n", __FUNCTION__, response->clm_sequence); return 0; } Index: api_purge.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_purge.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** api_purge.c 25 May 2005 16:25:17 -0000 1.3 --- api_purge.c 8 Jul 2005 16:17:03 -0000 1.4 *************** *** 36,70 **** #ifdef __KERNEL__ ! ! # ifndef MODULE ! # define MODULE ! # endif ! ! # include <linux/kernel.h> ! # define __NO_VERSION__ ! # include <linux/module.h> ! # ifdef USING_FULL_VERSIONING ! # if CONFIG_MODVERSIONS==1 ! # define MODVERSIONS ! # include <linux/modversions.h> ! # endif ! # endif /* USING_FULL_VERSIONING */ ! ! #else ! ! ! #include <stdio.h> ! #include <unistd.h> ! #include <string.h> ! #include <sys/types.h> ! #include <sys/file.h> ! #include <sys/stat.h> ! #endif /*__KERNEL__*/ - #include "dlm.h" - #include "ast.h" #include "clmstructs.h" ! #include "pti.h" #include "api_data.h" --- 36,44 ---- #ifdef __KERNEL__ ! #include "dlm_module.h" #endif /*__KERNEL__*/ #include "clmstructs.h" ! #include "dlm_log.h" #include "api_data.h" *************** *** 119,123 **** #ifndef __KERNEL__ if (debug) { ! fprintf(stderr, "dlm_purge: grace sleep(%d)\n", GRACE_SLEEP); } #endif /* not __KERNEL__ */ --- 93,97 ---- #ifndef __KERNEL__ if (debug) { ! dlm_log(LOG_INFO, "dlm_purge: grace sleep(%d)\n", GRACE_SLEEP); } #endif /* not __KERNEL__ */ Index: api_resource.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_resource.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** api_resource.c 5 May 2005 18:55:01 -0000 1.2 --- api_resource.c 8 Jul 2005 16:17:03 -0000 1.3 *************** *** 34,47 **** #include "config.h" - #include <stdio.h> #include <string.h> - #include <sys/types.h> - #include <sys/file.h> - #include <sys/stat.h> - #include "dlm.h" - #include "ast.h" #include "clmstructs.h" ! #include "pti.h" #include "api_data.h" --- 34,41 ---- #include "config.h" #include <string.h> #include "clmstructs.h" ! #include "dlm_log.h" #include "api_data.h" *************** *** 75,79 **** #if defined(DEBUG) if (debug) { ! fprintf(stderr, "dlmregister(%s, %d)\n", name, type); } #endif --- 69,73 ---- #if defined(DEBUG) if (debug) { ! dlm_log(LOG_INFO, "dlmregister(%s, %d)\n", name, type); } #endif *************** *** 111,115 **** #if defined(DEBUG) if (debug) { ! fprintf(stderr, "dlmregister() returning 0x%lX\n", response.clm_handle.rh); } --- 105,109 ---- #if defined(DEBUG) if (debug) { ! dlm_log(LOG_INFO, "dlmregister() returning 0x%lX\n", response.clm_handle.rh); } Index: api_scn.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_scn.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** api_scn.c 25 May 2005 16:25:17 -0000 1.2 --- api_scn.c 8 Jul 2005 16:17:03 -0000 1.3 *************** *** 35,49 **** #include "config.h" - #include <stdio.h> - #include <unistd.h> #include <string.h> - #include <sys/types.h> - #include <sys/file.h> - #include <sys/stat.h> - #include "dlm.h" - #include "ast.h" #include "clmstructs.h" ! #include "pti.h" #include "api_data.h" --- 35,42 ---- #include "config.h" #include <string.h> #include "clmstructs.h" ! #include "dlm_log.h" #include "api_data.h" *************** *** 109,113 **** if (response.clm_status == DLM_WORKING) { ! printf("DLM_WORKING_TER returned from API call!!\n"); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); --- 102,106 ---- if (response.clm_status == DLM_WORKING) { ! dlm_log(LOG_WARNING, "DLM_WORKING_TER returned from API call!!\n"); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); *************** *** 120,124 **** #if defined(DEBUG) if (debug) { ! fprintf(stderr, "clmunlock: grace sleep(%d)\n", GRACE_SLEEP); } #endif --- 113,117 ---- #if defined(DEBUG) if (debug) { ! dlm_log(LOG_INFO, "clmunlock: grace sleep(%d)\n", GRACE_SLEEP); } #endif Index: api_setnotify.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_setnotify.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** api_setnotify.c 5 May 2005 18:55:01 -0000 1.4 --- api_setnotify.c 8 Jul 2005 16:17:03 -0000 1.5 *************** *** 34,47 **** #include "config.h" - #include <stdio.h> #include <signal.h> - #include <sys/types.h> - #include <sys/file.h> - #include <sys/stat.h> - #include "dlm.h" - #include "ast.h" #include "clmstructs.h" - #include "pti.h" #include "clmutex_r.h" --- 34,40 ---- Index: api_syscall.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_syscall.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** api_syscall.c 27 Sep 2002 11:52:42 -0000 1.1.1.1 --- api_syscall.c 8 Jul 2005 16:17:03 -0000 1.2 *************** *** 35,45 **** #include "config.h" - #include <sys/types.h> - #include <errno.h> - - #include "dlm.h" - #include "ast.h" #include "clmstructs.h" - #include "pti.h" #include "api_proto.h" /* Should be LAST included file. */ --- 35,39 ---- Index: api_tune.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_tune.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** api_tune.c 25 May 2005 16:25:17 -0000 1.2 --- api_tune.c 8 Jul 2005 16:17:03 -0000 1.3 *************** *** 39,53 **** #include "config.h" - #include <stdio.h> - #include <unistd.h> #include <string.h> - #include <sys/types.h> - #include <sys/file.h> - #include <sys/stat.h> - #include "dlm.h" - #include "ast.h" #include "clmstructs.h" ! #include "pti.h" #include "api_data.h" --- 39,46 ---- #include "config.h" #include <string.h> #include "clmstructs.h" ! #include "dlm_log.h" #include "api_data.h" *************** *** 119,123 **** if (response.clm_status == DLM_WORKING) { ! printf("DLM_WORKING_TER returned from API call!!\n"); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); --- 112,116 ---- if (response.clm_status == DLM_WORKING) { ! dlm_log(LOG_WARNING, "DLM_WORKING_TER returned from API call!!\n"); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); *************** *** 215,219 **** if (response.clm_status == DLM_WORKING) { ! printf("DLM_WORKING_TER returned from API call!!\n"); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); --- 208,212 ---- if (response.clm_status == DLM_WORKING) { ! dlm_log(LOG_WARNING, "DLM_WORKING_TER returned from API call!!\n"); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); Index: api_unix.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_unix.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** api_unix.c 5 May 2005 18:55:01 -0000 1.2 --- api_unix.c 8 Jul 2005 16:17:03 -0000 1.3 *************** *** 46,83 **** #ifdef __KERNEL__ ! # ifndef MODULE ! # define MODULE ! # endif ! ! # include <linux/kernel.h> ! # define __NO_VERSION__ ! # include <linux/module.h> ! # ifdef USING_FULL_VERSIONING ! # if CONFIG_MODVERSIONS==1 ! # define MODVERSIONS ! # include <linux/modversions.h> ! # endif ! # endif /* USING_FULL_VERSIONING */ #else - - #include <stdio.h> - #include <unistd.h> #include <string.h> - #include <limits.h> - #include <sys/types.h> #include <sys/file.h> - #include <sys/stat.h> #endif /*__KERNEL__*/ - #include "dlm.h" - #include "ast.h" #include "clmstructs.h" ! #include "pti.h" #include "api_data.h" - #include "api_init.h" #include "api_resource.h" #include "api_proto.h" /* Should be LAST included file. */ --- 46,64 ---- #ifdef __KERNEL__ ! #include "dlm_module.h" ! #include <linux/string.h> ! #include <linux/fcntl.h> #else #include <string.h> #include <sys/file.h> #endif /*__KERNEL__*/ #include "clmstructs.h" ! #include "dlm_log.h" #include "api_data.h" #include "api_resource.h" #include "api_proto.h" /* Should be LAST included file. */ *************** *** 116,120 **** #if defined(DEBUG) if (debug) { ! fprintf(stderr, "dlmregionlock(0x%lx,%lu,%lu,%lu)\n", rh.rh, offset, len, flags); --- 97,101 ---- #if defined(DEBUG) if (debug) { ! dlm_log(LOG_WARNING, "dlmregionlock(0x%lx,%lu,%lu,%lu)\n", rh.rh, offset, len, flags); Index: api_vms.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_vms.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** api_vms.c 25 May 2005 16:25:17 -0000 1.11 --- api_vms.c 8 Jul 2005 16:17:03 -0000 1.12 *************** *** 44,81 **** #ifdef __KERNEL__ ! # ifndef MODULE ! # define MODULE ! # endif ! ! # include <linux/kernel.h> ! # define __NO_VERSION__ ! # include <linux/module.h> ! # ifdef USING_FULL_VERSIONING ! # if CONFIG_MODVERSIONS==1 ! # define MODVERSIONS ! # include <linux/modversions.h> ! # endif ! # endif /* USING_FULL_VERSIONING */ #else # include <pthread.h> - # include <stdio.h> - # include <unistd.h> # include <string.h> - # include <sys/types.h> - # include <sys/file.h> - # include <sys/stat.h> #endif /* __KERNEL__ */ - #include "dlm.h" - #include "ast.h" #include "clmstructs.h" ! #include "dlm_kernel.h" ! #include "pti.h" #include "api_data.h" - #include "api_init.h" #include "api_proto.h" /* Should be LAST included file. */ --- 44,61 ---- #ifdef __KERNEL__ ! #include "dlm_module.h" ! #include <linux/string.h> #else # include <pthread.h> # include <string.h> #endif /* __KERNEL__ */ #include "clmstructs.h" ! #include "dlm_log.h" #include "api_data.h" #include "api_proto.h" /* Should be LAST included file. */ *************** *** 591,595 **** if (response.clm_status == DLM_WORKING) { ! printf("DLM_WORKING_TER returned from API call!!\n"); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); --- 571,575 ---- if (response.clm_status == DLM_WORKING) { ! dlm_log(LOG_WARNING, "DLM_WORKING_TER returned from API call!!\n"); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); *************** *** 602,606 **** #if defined(DEBUG) if (debug) { ! fprintf(stderr, "dlmunlock: grace sleep(%d)\n", GRACE_SLEEP); } #endif --- 582,586 ---- #if defined(DEBUG) if (debug) { ! dlm_log(LOG_INFO, "dlmunlock: grace sleep(%d)\n", GRACE_SLEEP); } #endif *************** *** 681,685 **** #if defined(DEBUG) if (debug) { ! fprint_debug("dlmunlock: grace sleep(%d)\n", GRACE_SLEEP); } #endif --- 661,665 ---- #if defined(DEBUG) if (debug) { ! dlm_log(LOG_INFO, "dlmunlock: grace sleep(%d)\n", GRACE_SLEEP); } #endif Index: ast_stub.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/ast_stub.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ast_stub.c 22 Oct 2004 21:38:25 -0000 1.4 --- ast_stub.c 8 Jul 2005 16:17:04 -0000 1.5 *************** *** 34,43 **** #include "config.h" - #include "dlm.h" - #include "ast.h" #include "clmstructs.h" - #include "pti.h" - #include "clmutex_r.h" - #include "ast_stub.h" /* --- 34,38 ---- Index: print.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/print.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** print.c 25 May 2005 16:25:17 -0000 1.2 --- print.c 8 Jul 2005 16:17:04 -0000 1.3 *************** *** 38,41 **** --- 38,42 ---- #include "dlm.h" + #include "dlm_log.h" /* ============================================================ */ *************** *** 63,66 **** dlm_perror(const char *s) { ! fprintf(stderr, "%1$s: %2$s\n", s, dlm_errmsg(dlm_errno)); } --- 64,67 ---- dlm_perror(const char *s) { ! dlm_log(LOG_ERR, "%1$s: %2$s\n", s, dlm_errmsg(dlm_errno)); } |
|
From: <cao...@us...> - 2005-07-08 16:17:45
|
Update of /cvsroot/opendlm/opendlm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5108 Modified Files: ChangeLog configure.ac Log Message: Header and CCCP cleanups Index: ChangeLog =================================================================== RCS file: /cvsroot/opendlm/opendlm/ChangeLog,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** ChangeLog 3 Jun 2005 19:27:13 -0000 1.89 --- ChangeLog 8 Jul 2005 16:17:02 -0000 1.90 *************** *** 1,2 **** --- 1,14 ---- + 2005-07-08 Don Zickus <don...@ca...> + * touched all the C files to add/remove appropriate header files + * converted all api files to use new dlm_log for logging + * cleaned up the cccp directory; started to incorporate layers + - bottom layer for direct OS communication + - middle layer for protocol stuff + - top layer for api to the dlm + - removed cccp_input.c, cccp_output.c, cccp_kernel.c + * more separation of the cccp from the dlmdk layer, only the + memory and daemon infrastructure are left, I believe + * fixed module warnings when compiling on 2.6 kernel by utilizing + a Makefile.in instead of Makefile.am in the src/kernel directory 2005-05-31 Don Zickus <don...@ca...> * Makefile.am Index: configure.ac =================================================================== RCS file: /cvsroot/opendlm/opendlm/configure.ac,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** configure.ac 3 Jun 2005 19:27:14 -0000 1.33 --- configure.ac 8 Jul 2005 16:17:02 -0000 1.34 *************** *** 553,572 **** AC_CHECK_LIB(dl, dlopen, , [ AC_MSG_ERROR("error: failed to detect libdl")]) - # check for glib - AC_PATH_PROGS(GLIBCONFIG, glib-config, glib12-config) - AC_PATH_PROGS(GLIBCONFIG, glib12-config, glib13-config) - AC_PATH_PROGS(GLIBCONFIG, glib13-config) - AC_MSG_CHECKING(which glib config exists) - if test "X${GLIBCONFIG}" = "X"; then - AC_MSG_ERROR(You need the glib development package to continue. - You can get the source from ftp://ftp.gtk.org/pub/gtk/v1.2/ - or you can locate it via http://www.gtk.org/download/) - else - AC_MSG_RESULT("using $GLIBCONFIG") - fi - GLHEAD=`$GLIBCONFIG --cflags` - GLIBLIB=`$GLIBCONFIG --libs` - LIBS="$LIBS $GLIBLIB" - CPPFLAGS="$CPPFLAGS $GLHEAD" fi --- 553,556 ---- |
|
From: <cao...@us...> - 2005-07-08 16:17:44
|
Update of /cvsroot/opendlm/opendlm/src/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5108/src/include Modified Files: ast.h cccp.h clm_data.h clm_info.h clm_locksw.h clmstructs.h dlm_kernel.h Log Message: Header and CCCP cleanups Index: ast.h =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/include/ast.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ast.h 26 Oct 2004 20:27:51 -0000 1.2 --- ast.h 8 Jul 2005 16:17:04 -0000 1.3 *************** *** 35,39 **** #define AST_H ! #include "dlm.h" #include <dlm_list.h> #include "ast_stub.h" --- 35,39 ---- #define AST_H ! //#include "dlm.h" #include <dlm_list.h> #include "ast_stub.h" Index: cccp.h =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/include/cccp.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** cccp.h 25 May 2005 16:25:18 -0000 1.10 --- cccp.h 8 Jul 2005 16:17:04 -0000 1.11 *************** *** 37,40 **** --- 37,45 ---- #define CCCP_H + #ifdef __KERNEL__ + #include <linux/in.h> + #else + #include <netinet/in.h> + #endif #include "dlm_list.h" *************** *** 52,55 **** --- 57,70 ---- }; + /* cccp_configure commands */ + enum { + CCCP_SET_PORT = 0, + CCCP_SET_LOCAL, + CCCP_NODE_UP, + CCCP_NODE_DOWN, + CCCP_SHUTDOWN, + CCCP_CONFIG_CMD_MAX + }; + /* Valid port numbers are 1-255. */ #define CCCP_MAX_PORT 15 *************** *** 65,69 **** struct clm_msg { ! dlm_listnode_t cm_link; unsigned cm_port; unsigned cm_prio; --- 80,84 ---- struct clm_msg { ! dlm_listnode_t cm_link; unsigned cm_port; unsigned cm_prio; *************** *** 95,207 **** void * private ); extern void cccp_msg_destroy( clm_msg_t * msg ); ! extern void cccp_set_port(int port); ! extern bool_t cccp_node_up( uint nodeid, struct in_addr saddr, uint localid ); ! extern void cccp_node_down( uint id ); ! extern int cccp_init( void ); ! extern void cccp_stop( void ); ! ! #ifdef __KERNEL__ ! #include <asm/semaphore.h> ! #include <linux/slab.h> ! #include <linux/vmalloc.h> ! #else ! #define acquire_lock(a) printf ("ACQUIRE_LOCK ( NOOP )\n"); ! #define release_lock(a) printf ("RELEASE_LOCK ( NOOP )\n"); ! #endif ! ! #if defined(DEBUG) ! ! #ifdef __KERNEL__ ! #include "dlm_kernel.h" ! void dlm_abort( const char * ); ! ! ! #ifdef CCCP_ASSERT ! #undef CCCP_ASSERT ! #endif ! ! #define as_str(a) as_str_b(a) ! #define as_str_b(a) #a ! #define CCCP_ASSERT(cond,msg) \ ! if (cond) { \ ! ; \ ! } else { \ ! dlm_log(LOG_CRIT,"ASSERT FAILED: %s: %s, file %s, line %d\n", \ ! (msg), __FUNCTION__, __FILE__, __LINE__); \ ! dlm_abort("ASSERT: " __FILE__ ", line " as_str(__LINE__)); \ ! } ! ! ! #else /* i.e. !defined(__KERNEL__)*/ ! ! #ifdef CCCP_ASSERT ! #undef CCCP_ASSERT ! #endif ! #define CCCP_ASSERT(cond,msg) \ ! if (cond) { \ ! ; \ ! } else { \ ! fflush(stdout); \ ! fprintf(stderr,"ASSERT FAILED: %s: %s, file %s, line %d\n", \ ! (msg), __FUNCTION__, __FILE__, __LINE__); \ ! fflush(stderr); \ ! dlm_abort(); \ ! } ! ! ! ! #endif /* __KERNEL__ */ ! ! #else /* i.e. !defined(DEBUG)*/ ! ! #ifdef CCCP_ASSERT ! #undef CCCP_ASSERT ! #endif ! #define CCCP_ASSERT(cond,msg) ! ! #endif ! ! ! ! #define CPTRC_BASE 0x90000000 ! ! #define CPTRC_UINIT_ENTRY (CPTRC_BASE + 0x00) ! #define CPTRC_UINIT_EXIT (CPTRC_BASE + 0x01) ! #define CPTRC_USTOP_ENTRY (CPTRC_BASE + 0x02) ! #define CPTRC_USTOP_EXIT (CPTRC_BASE + 0x03) ! #define CPTRC_KINIT_ENTRY (CPTRC_BASE + 0x04) ! #define CPTRC_KINIT_EXIT (CPTRC_BASE + 0x05) ! #define CPTRC_KSTOP_ENTRY (CPTRC_BASE + 0x06) ! #define CPTRC_KSTOP_EXIT (CPTRC_BASE + 0x07) ! ! #define CPTRC_SEND_ENTRY (CPTRC_BASE + 0x10) ! #define CPTRC_SEND_EXIT (CPTRC_BASE + 0x11) ! #define CPTRC_LISTEN_ENTRY (CPTRC_BASE + 0x12) ! #define CPTRC_LISTEN_EXIT (CPTRC_BASE + 0x13) ! #define CPTRC_SEND_ENTRY_LK (CPTRC_BASE + 0x14) ! ! #define CPTRC_SNDCB_INVOKE (CPTRC_BASE + 0x20) ! #define CPTRC_SNDCB_RETURN (CPTRC_BASE + 0x21) ! #define CPTRC_RCVCB_INVOKE (CPTRC_BASE + 0x22) ! #define CPTRC_RCVCB_RETURN (CPTRC_BASE + 0x23) ! #define CPTRC_FORWARDED (CPTRC_BASE + 0x24) ! ! #define CPTRC_TRANSMIT (CPTRC_BASE + 0x30) ! #define CPTRC_GOTREDIR (CPTRC_BASE + 0x31) ! #define CPTRC_RETRY (CPTRC_BASE + 0x32) ! #define CPTRC_ENQUEUE (CPTRC_BASE + 0x33) ! #define CPTRC_DEQUEUE (CPTRC_BASE + 0x34) ! #define CPTRC_GOTACKS (CPTRC_BASE + 0x35) ! ! #define CPTRC_WRITE (CPTRC_BASE + 0x40) ! #define CPTRC_READ (CPTRC_BASE + 0x41) ! #define CPTRC_DUPLICATE (CPTRC_BASE + 0x42) ! ! #define CPTRC_POLL_ENTRY (CPTRC_BASE + 0x50) ! #define CPTRC_POLL_PROC (CPTRC_BASE + 0x51) ! #define CPTRC_POLL_ERROR (CPTRC_BASE + 0x52) ! #define CPTRC_POLL_DONE (CPTRC_BASE + 0x53) ! ! #define CPTRC_ACQUIRE_LOCK (CPTRC_BASE + 0x60) #endif /* defined CCCP_H */ --- 110,114 ---- void * private ); extern void cccp_msg_destroy( clm_msg_t * msg ); ! extern int cccp_configure(int cmd, int data, void *private); #endif /* defined CCCP_H */ Index: clm_data.h =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/include/clm_data.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** clm_data.h 26 Oct 2004 20:27:51 -0000 1.2 --- clm_data.h 8 Jul 2005 16:17:04 -0000 1.3 *************** *** 68,80 **** * module from the user-side daemon via a write. */ - extern int res_seg_size; /* size of resource segments */ extern int lock_seg_size; /* lock table segment size */ - extern int res_seg_count ; /* number of res segs on primary */ - extern int clm_reclocks_used ; /* reclock structs currently in use */ - extern int clm_reclocks_denied ; /* # times lock denied because no more space */ - extern int clm_reclocks_max ; /* reclock structs allocated from lock_heap */ extern int clm_lock_warned ; extern int clm_res_warned ; /* # times warning sent for no more space for resources */ - extern int clm_rescount ; /* number of struct dlm_resource in use */ /* sum of reclocks & resources must be < than this */ extern int clm_items_max ; --- 68,74 ---- *************** *** 100,105 **** extern int batchsize ; /* send after this many pending */ - extern clm_msg_t *bounce_list ; - extern int clm_active ; /* TRUE is lock manager is running */ --- 94,97 ---- Index: clm_info.h =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/include/clm_info.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** clm_info.h 26 Oct 2004 20:27:51 -0000 1.2 --- clm_info.h 8 Jul 2005 16:17:04 -0000 1.3 *************** *** 35,39 **** #define CLM_INFO_H 1 ! #include "dlm.h" #include "dlm_devmsg.h" --- 35,39 ---- #define CLM_INFO_H 1 ! //#include "dlm.h" #include "dlm_devmsg.h" Index: clm_locksw.h =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/include/clm_locksw.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** clm_locksw.h 26 Oct 2004 20:27:51 -0000 1.2 --- clm_locksw.h 8 Jul 2005 16:17:04 -0000 1.3 *************** *** 40,44 **** #endif /* __KERNEL__ */ ! #include "dlm.h" #include "clmstructs.h" --- 40,44 ---- #endif /* __KERNEL__ */ ! //#include "dlm.h" #include "clmstructs.h" Index: clmstructs.h =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/include/clmstructs.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** clmstructs.h 25 May 2005 16:25:18 -0000 1.16 --- clmstructs.h 8 Jul 2005 16:17:04 -0000 1.17 *************** *** 54,59 **** --- 54,61 ---- #endif /* __KERNEL__ */ + #include "dlm.h" #include "cccp.h" #include "ast.h" + #include "dlm_list.h" /* ============================================================ */ *************** *** 939,942 **** --- 941,978 ---- + typedef struct arg_struct { + int debug; /* debug mask */ + int local_debug; /* local debug mask */ + int batch_sleep; /* batch_sleep -not used- */ + int locksegsize; /* lock table segment size */ + int ressegsize; /* size of resource segments */ + int resprealloc; /* number of res segs to preallocate */ + int hashsize; /* number of record in the resource hash table */ + int msg_key; /* message queue key */ + int kmem_cutoff; /* percentage of remaining kmem to use */ + unsigned int recalc_time; /* recalc time for migration */ + uint64_t decay_rate; /* decay rate for migration */ + int dlmdevicemajor; /* Major number for DLM device */ + int dlmadminminor; /* Minor number for DLM "admin" port */ + int dlmlocksminor; /* Minor number for DLM "locks" port */ + char dlmconfigfile[128]; /* Absolute name of configuration file */ + char dumpfilename[128]; /* Absolute name of diagnostic dump file */ + char dlmdevicebase[64]; /* Base name of the DLM device */ + char dlmdevicename[128]; /* Absolute name of the DLM device */ + char dlmprocname[128]; /* DLM base dirname in /proc */ + char dlmclustermgr[128]; /* Cluster manager load module */ + char dlmadminbase[32]; /* DLM "admin" base name */ + char dlmadminname[128]; /* DLM "admin" absolute name */ + char dlmlocksbase[32]; /* DLM "locks" base name */ + char dlmlocksname[128]; /* DLM "locks" absolute name */ + int dlmport; /* DLM UDP port number */ + } arg_struct_t; + + #ifdef __KERNEL__ + extern arg_struct_t *args; + #else + extern arg_struct_t args; + #endif /* __KERNEL__ */ + #define LOAD_STARTUP 1 /* "Loaded startup code.\n" */ #define INTERNAL_ERR 1 /* "Internal error (could not find start_func).\n" */ Index: dlm_kernel.h =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/include/dlm_kernel.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** dlm_kernel.h 25 May 2005 16:25:18 -0000 1.16 --- dlm_kernel.h 8 Jul 2005 16:17:04 -0000 1.17 *************** *** 60,63 **** --- 60,65 ---- #endif /* __KERNEL__ */ + #include "dlm_utilities.h" + #if !defined(ERROR) #define ERROR (-1) *************** *** 85,126 **** #endif /* __linux__ */ - typedef struct arg_struct { - int debug; /* debug mask */ - int local_debug; /* local debug mask */ - int batch_sleep; /* batch_sleep -not used- */ - int locksegsize; /* lock table segment size */ - int ressegsize; /* size of resource segments */ - int resprealloc; /* number of res segs to preallocate */ - int hashsize; /* number of record in the resource hash table */ - int msg_key; /* message queue key */ - int kmem_cutoff; /* percentage of remaining kmem to use */ - unsigned int recalc_time; /* recalc time for migration */ - uint64_t decay_rate; /* decay rate for migration */ - int dlmdevicemajor; /* Major number for DLM device */ - int dlmadminminor; /* Minor number for DLM "admin" port */ - int dlmlocksminor; /* Minor number for DLM "locks" port */ - char dlmconfigfile[128]; /* Absolute name of configuration file */ - char dumpfilename[128]; /* Absolute name of diagnostic dump file */ - char dlmdevicebase[64]; /* Base name of the DLM device */ - char dlmdevicename[128]; /* Absolute name of the DLM device */ - char dlmprocname[128]; /* DLM base dirname in /proc */ - char dlmclustermgr[128]; /* Cluster manager load module */ - char dlmadminbase[32]; /* DLM "admin" base name */ - char dlmadminname[128]; /* DLM "admin" absolute name */ - char dlmlocksbase[32]; /* DLM "locks" base name */ - char dlmlocksname[128]; /* DLM "locks" absolute name */ - int dlmport; /* DLM UDP port number */ - } arg_struct_t; - - #ifdef __KERNEL__ - extern arg_struct_t *args; - #else - extern arg_struct_t args; - #endif /* __KERNEL__ */ - #ifdef __KERNEL__ #include <linux/slab.h> #include <linux/vmalloc.h> #define LOCK_FREE 0 --- 87,95 ---- #endif /* __linux__ */ #ifdef __KERNEL__ #include <linux/slab.h> #include <linux/vmalloc.h> + extern kmem_cache_t * dlm_keventd_cache; #define LOCK_FREE 0 *************** *** 175,250 **** #ifdef __KERNEL__ - - #define MALLOC(size) my_malloc(size) - #define REALLOC(ptr,old,new) my_realloc((ptr),(old),(new)) - #define FREE(ptr) my_free(ptr) - - extern void * my_malloc(int); - extern unsigned int my_free( void * ); - extern kmem_cache_t * dlm_keventd_cache; - - #else - - #define MALLOC(size) malloc(size) - #define REALLOC(ptr,old,new) realloc((ptr),(old),(new)) - #define FREE(ptr) free(ptr) - - #endif /* __KERNEL__ */ - - /* memory allocation macros used for memory checking */ - #if defined(MEMCHK) - #define CLM_MALLOC(size) bmalloc((size), __FILE__, __LINE__) - #define CLM_FREE(ptr) bfree((ptr), __FILE__, __LINE__) - #else - #define CLM_MALLOC(size) MALLOC((size)) - #define CLM_FREE(ptr) FREE((ptr)) - #endif - - /* signal handling routines */ - #ifdef __linux__ - - #ifdef CONFIG_SIGNALS_FOR_2_6 - - /* do not lock for flush signals, this is built-in to the function */ - #define DLM_SIG_LOCK - #define DLM_SIG_UNLOCK - #define DLM_SIG_CHECK(task, signo) \ - (sigismember(&task->pending.signal, signo) || \ - sigismember(&task->signal->shared_pending.signal, signo)) - - #elif defined CONFIG_SIGNALS_FOR_2_4_MOD - - #define DLM_SIG_LOCK(current, flags) \ - spin_lock_irqsave(¤t->sighand->siglock, flags) - #define DLM_SIG_UNLOCK(current, flags) \ - spin_unlock_irqrestore(¤t->sighand->siglock, flags) - #define DLM_SIG_CHECK(task, signo) \ - (sigismember(&task->pending.signal, signo) || \ - sigismember(&task->signal->shared_pending.signal, signo)) - - #else /* regular linux 2.4 signal struct */ - - #define DLM_SIG_LOCK(current, flags) \ - spin_lock_irqsave(¤t->sigmask_lock, flags) - #define DLM_SIG_UNLOCK(current, flags) \ - spin_unlock_irqrestore(¤t->sigmask_lock, flags) - #define DLM_SIG_CHECK(task, signo) \ - (sigismember(&task->pending.signal, signo)) - - #endif /* CONFIG_SIGNALS */ - #else - - /* BUGBUG Don't know the signal handlers for AIX */ - /* BUGBUG Will use the originals as defaults */ - #define DLM_SIG_LOCK(current, flags) \ - spin_lock_irqsave(¤t->sigmask_lock, flags) - #define DLM_SIG_UNLOCK(current, flags) \ - spin_unlock_irqsave(¤t->sigmask_lock, flags) - #define DLM_SIG_CHECK(task, signo) \ - (sigismember(&task->pending.signal, signo)) - - #endif /* __linux__ */ - - #ifdef __KERNEL__ #ifdef __linux__ --- 144,147 ---- *************** *** 264,272 **** size_t size, int(*compar)(const void *, const void *)); - char *printbin( const unsigned char * data, unsigned len ); - int getpid(void); - int timeval_sub(struct timeval *t0, - struct timeval *t1, - struct timeval *t2); #ifndef LINUX_VERSION_CODE --- 161,164 ---- *************** *** 285,301 **** int kfl_ftofi(/*uint64_t*/ unsigned long long int f) ; char *kfl_ftos(/*uint64_t*/ unsigned long long int f) ; - /*uint64_t*/ - unsigned long long int kfl_fitof(int i) ; - /*uint64_t*/ - unsigned long long int kfl_mul(/*uint64_t*/ unsigned long long int a, - /*uint64_t*/ unsigned long long int b) ; - /*uint64_t*/ - unsigned long long int kfl_add(/*uint64_t*/ unsigned long long int a, - /*uint64_t*/ unsigned long long int b) ; - /*uint64_t*/ - unsigned long long int kfl_sub(/*uint64_t*/ unsigned long long int a, - /*uint64_t*/ unsigned long long int b) ; - /*uint64_t*/ - unsigned long long int kfl_idivi(int i, int j) ; /* --- 177,180 ---- *************** *** 389,407 **** bool_t clm_node_reachable( int nodeid ); - /* Configures the thread's resources for daemon mode - */ - - void dlm_daemonize( char * ); - - /* Sets the name for the current kernel process. - */ - - void dlm_set_thread_name( struct task_struct * task, const char * name ); - - /* Sends a signal to a user-mode process. - */ - - int dlm_kill_user_proc( pid_t user_pid, int sig ); - /* Returns a pointer to the name of the transaction type (see enum dlm_ops in * clmstructs.h). --- 268,271 ---- |
|
From: <cao...@us...> - 2005-07-08 16:17:16
|
Update of /cvsroot/opendlm/opendlm/src/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5108/src/kernel Added Files: Makefile.in Log Message: Header and CCCP cleanups --- NEW FILE: Makefile.in --- # Makefile.in generated by automake 1.9.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ ################################################################# # Core modules for the IBM OSS Distributed Lock Manager # # Copyright (C) 2001, International Business Machines # # Authors: Peter R. Badovinatz, Ian D. Romanick # Contacts: wo...@us..., id...@us... # http://oss.software.ibm.com/developerworks/opensource/linux/projects/dlm # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See # the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # http://www.gnu.org/copyleft/gpl.html ################################################################# srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/kernel DIST_COMMON = $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_FILE = @BUILD_FILE@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ NEW_KBUILD = @NEW_KBUILD@ ifneq ($(NEW_KBUILD),y) CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ endif CLUSTERMGT = @CLUSTERMGT@ CPP = @CPP@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ DLM_VERSION_STR = @DLM_VERSION_STR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ KERN_CFLAGS = @KERN_CFLAGS@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LINKER = @LINKER@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SO_VERSION = @SO_VERSION@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ ccm_CFLAGS = @ccm_CFLAGS@ ccm_LIBS = @ccm_LIBS@ datadir = @datadir@ exec_prefix = @exec_prefix@ heartbeat_CFLAGS = @heartbeat_CFLAGS@ heartbeat_LIBS = @heartbeat_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ iiquorumd_CFLAGS = @iiquorumd_CFLAGS@ iiquorumd_LIBS = @iiquorumd_LIBS@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ kmoduledir = @kmoduledir@ libdir = @libdir@ libexecdir = @libexecdir@ linux_src = @linux_src@ localhost_cluster_CFLAGS = @localhost_cluster_CFLAGS@ localhost_cluster_LIBS = @localhost_cluster_LIBS@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ rsct_CFLAGS = @rsct_CFLAGS@ rsct_LIBS = @rsct_LIBS@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ src_user_extra_subdirs = @src_user_extra_subdirs@ src_user_subdirs = @src_user_subdirs@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ MAINTAINERCLEANFILES = Makefile.in SUBDIRS = dlmcccp dlmdk dlmkernapi tests ifeq ($(NEW_KBUILD),y) obj-y := dlmdk/ dlmcccp/ dlmkernapi/ all: $(MAKE) -C $(linux_src) M=$(PWD) else all: all-recursive endif .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ clean clean-generic clean-libtool clean-recursive ctags \ ctags-recursive distclean distclean-generic distclean-libtool \ distclean-recursive distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ mostlyclean mostlyclean-generic mostlyclean-libtool \ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: |
|
From: <cao...@us...> - 2005-06-03 19:27:53
|
Update of /cvsroot/opendlm/opendlm/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27790/admin Modified Files: haDLM Log Message: daemonizing changes and version info changes Index: haDLM =================================================================== RCS file: /cvsroot/opendlm/opendlm/admin/haDLM,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** haDLM 29 Mar 2005 16:49:39 -0000 1.5 --- haDLM 3 Jun 2005 19:27:14 -0000 1.6 *************** *** 28,31 **** --- 28,38 ---- MODPROBE=/sbin/modprobe + #find out kernel version + if [ `uname -r|cut -d. -f2` = '6' ]; then + KERNEL_26=true + else + KERNEL_26=false + fi + DLM_BIN=/usr/local/sbin/dlmdu test -x $DLM_BIN || { echo "$DLM_BIN not installed"; *************** *** 87,91 **** start) echo -n "Starting haDLM " ! # See if it's already running. Look *only* at the pid file. if [ -f /var/run/haDLM.pid ]; then --- 94,126 ---- start) echo -n "Starting haDLM " ! ! # See if it's properly added to the conf files for modprobe ! if [ -z "`$MODPROBE -c | grep dlmdk`" ]; then ! if [ $KERNEL_26 = "true" ]; then ! echo -e "\tNeed to add \"alias haDLM dlmdk_core\" to"\ ! "/etc/modprobe.conf" ! else ! echo -e "\tNeed to add \"alias haDLM dlmdk.core\" to"\ ! "/etc/modules.conf" ! fi ! exit 1 ! fi ! ! # See if the dependencies have been loaded ! if [ $KERNEL_26 = "true" ]; then ! if [ -z "`$MODPROBE -c|grep dlmdk|grep -v alias`" ]; then ! echo -e "\tNeed to run \"depmod -ae\" or install DLM"\ ! "kernel modules" ! exit 1 ! fi ! else ! depfile=`$MODPROBE -c |grep depfile|cut -d= -f2` ! if [ -z "`cat $depfile|grep dlmdk`" ]; then ! echo -e "\tNeed to run \"depmod -ae\" or install DLM"\ ! "kernel modules" ! exit 1 ! fi ! fi ! # See if it's already running. Look *only* at the pid file. if [ -f /var/run/haDLM.pid ]; then *************** *** 100,109 **** if [ -r /etc/SuSE-release ] then ! $DLM_BIN -C $DLM_CONFIG &> /dev/null rc_status -v else ! $DLM_BIN -C $DLM_CONFIG &> /dev/null fi RETVAL=$? echo ;; --- 135,166 ---- if [ -r /etc/SuSE-release ] then ! $DLM_BIN -C $DLM_CONFIG rc_status -v else ! $DLM_BIN -C $DLM_CONFIG fi RETVAL=$? + + # make sure DLM connected to the cluster manager + let i=0 + sleep 0.5 #wait for pid + read pid < /var/run/haDLM.pid + while ! test -h /proc/haDLM/local; do + if [ ! -z "${pid//[0-9]/}" -o ! -d "/proc/$pid" ]; then + # pid no longer exists, must have died + echo "Failed to connect to cluster manager" + #remove modules + modprobe -r haDLM + exit 1 + fi + let i+=1 + if [ $i -gt 30 ]; then + echo " Timeout: failed to connect to cluster manager" + shutdown_dlm + exit 1 + fi + echo -n "." + sleep 1 + done echo ;; |
|
From: <cao...@us...> - 2005-06-03 19:27:53
|
Update of /cvsroot/opendlm/opendlm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27790 Modified Files: ChangeLog Makefile.am configure.ac Log Message: daemonizing changes and version info changes Index: ChangeLog =================================================================== RCS file: /cvsroot/opendlm/opendlm/ChangeLog,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** ChangeLog 25 May 2005 16:25:17 -0000 1.88 --- ChangeLog 3 Jun 2005 19:27:13 -0000 1.89 *************** *** 1,2 **** --- 1,26 ---- + 2005-05-31 Don Zickus <don...@ca...> + * Makefile.am + * configure.ac + * src/include/dlm_version.h + * src/kernel/dlmdk/clm_info.c + * src/kernel/dlmdk/clm_main.c + * src/kernel/dlmdk/dlm_proc.c + * src/user/dlmdu/dlm_cmdline.c + Modified the versioning scheme to be controlled through the + Makefile/configure scripts. This info is passed along to the + dlm_version.h file which parses and passes along that info to + the rest of the binaries. Also added a switch to deal with an + optional build number for those people who wish to use nightly + builds. + * src/kernel/dlmdk/clm_lock.c + * src/kernel/dlmdk/clm_purge.c + Self purges now work correctly + * src/kernel/dlmdk/clm_resource.c + Failover hack to deal with lost recovery domain locks + * src/user/common/dlm_iiquorumd.c + Finally remove temporary code from failover ack'ing + * src/kernel/dlmcccp/cccp_pkt.h + * src/kernel/dlmcccp/cccp_proto.c + deal with wrapping session numbers 2005-05-25 Michael Howard <mic...@sc...> * merged debug-dbprintf-branch *************** *** 13,16 **** --- 37,68 ---- * src/include/dlmdk/ast_kern.c Don provided spinlock to address race condition in use of lists. + 2005-05-03 Don Zickus <don...@ca...> + * admin/haDLM + handles startup failures better. Checks to make sure the + modules were installed correctly and that dlmdu connected + to the cluster manager before returning success. Also no + longer sends the output of dlmdu to /dev/null because dlmdu + is now daemonized. + * rpm/dlm.spec.in + cleanup an old copy command and runs 'depmod' on post install. + * src/kernel/dlmcccp/cccp_proto.c + node cleanup upon removal + * src/kernel/dlmdk/clm_info.c + create the /proc/haDLM/local symlink upon connecting to the + cluster manager + * src/kernel/dlmdk/dlm_proc.c + add code to create a /proc/haDLM/local symlink which was + removed from the creation of a /proc/haDLM/<node> directory. + * src/kernel/dlmdk/dlm_proc.h, dlm_real_proto.h + the prototype of the above function. + * src/user/common/dlm_iiquorumd.c, dlm_heartbeat.c, dlm_ccm.c, dlm_rsct.c, + dlm_localhost_cluster.c + changed printfs to dlm_logs to keep daemon quieter + * src/user/dlmdu/dlm_cmdline.c, dlm_config.c, dlm_device.c + remove bogus include files and changed fprintfs to dlm_logs + * src/user/dlmdu/dlm_daemon.c + remove bogus include files and changed fprintfs to dlm_logs. + Added better daemonizing code. Dealt with local node down + case better. 2005-04-22 Don Zickus <don...@ca...> * released OpenDLM 0.9.3 Index: Makefile.am =================================================================== RCS file: /cvsroot/opendlm/opendlm/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.am 16 Dec 2004 20:28:22 -0000 1.5 --- Makefile.am 3 Jun 2005 19:27:14 -0000 1.6 *************** *** 16,20 **** doc_DATA = README NEWS AUTHORS COPYING ! EXTRA_DIST = INSTALL.opendlm rpm/dlm.spec # Pass these to configure when running "make distcheck" --- 16,20 ---- doc_DATA = README NEWS AUTHORS COPYING ! EXTRA_DIST = INSTALL.opendlm rpm/dlm.spec @BUILD_FILE@ # Pass these to configure when running "make distcheck" Index: configure.ac =================================================================== RCS file: /cvsroot/opendlm/opendlm/configure.ac,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** configure.ac 6 May 2005 12:34:17 -0000 1.32 --- configure.ac 3 Jun 2005 19:27:14 -0000 1.33 *************** *** 1,8 **** # Process this file with autoconf to produce a configure script. AC_PREREQ(2.53) ! AC_INIT() ! AC_CONFIG_SRCDIR([src/kernel/dlmcccp/cccp_kernel.c]) AC_CANONICAL_TARGET([]) ! AM_INIT_AUTOMAKE(opendlm, 0.9.4) AM_CONFIG_HEADER(config.h) --- 1,8 ---- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.53) ! ! AC_INIT(opendlm, 0.9.4) AC_CANONICAL_TARGET([]) ! AM_INIT_AUTOMAKE AM_CONFIG_HEADER(config.h) *************** *** 10,15 **** --- 10,51 ---- AC_SUBST(SO_VERSION) + dnl ==========VERSION STUFF=================== + dnl Check for a build number + dnl This is optional, its main intent is for daily builds + dnl Note we use an '_' here instead of a '-' to make rpmbuild happy + dnl Ideally we would like BUILD_NUM to be a release string but again + dnl rpmbuild doesn't like release strings in the tarball names. Boooo rpms. + BUILD_NUM=`cat ./build` + if test -z ${BUILD_NUM}; then + ac_build_num="" + BUILD_FILE= + else + ac_build_num="_${BUILD_NUM}" + BUILD_FILE=build + fi + + dnl VERSION is created by AC_INIT through the second argument + dnl We parse it here because its easier than doing it in the 'C' code + ac_DLM_MAJOR=`echo $VERSION | cut -d'.' -f1` + ac_DLM_MINOR=`echo $VERSION | cut -d'.' -f2` + ac_DLM_PATCH=`echo $VERSION | cut -d'.' -f3` + + dnl We rename the VERSION string to include the BUILD_NUM if it is used + dnl Note: this new VERSION string is not exported to config.h + VERSION=${VERSION}${ac_build_num} + DLM_VERSION_STR=${VERSION} + + dnl Export these values to config.h to be included as macros by the DLM + AC_DEFINE_UNQUOTED([DLM_VERSION_STR], "${VERSION}", "Version number string") + AC_DEFINE_UNQUOTED([DLM_MAJOR_VERSION], ${ac_DLM_MAJOR}, Major version number) + AC_DEFINE_UNQUOTED([DLM_MINOR_VERSION], ${ac_DLM_MINOR}, Minor version number) + AC_DEFINE_UNQUOTED([DLM_PATCH_VERSION], ${ac_DLM_PATCH}, Patch version number) + + dnl For the Makefiles + AC_SUBST(BUILD_FILE) + AC_SUBST(DLM_VERSION_STR) AC_SUBST(PACKAGE) AC_SUBST(VERSION) + dnl =============END VERSION STUFF====================== dnl 'unset' is not portable, but setting to null is not enough to avoid using |
|
From: <cao...@us...> - 2005-06-03 19:27:26
|
Update of /cvsroot/opendlm/opendlm/src/kernel/dlmdk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27790/src/kernel/dlmdk Modified Files: Makefile.in clm_info.c clm_lock.c clm_main.c clm_purge.c clm_resource.c dlm_kerndd.c dlm_proc.c dlm_proc.h dlm_real_proto.h hsm.c Log Message: daemonizing changes and version info changes Index: Makefile.in =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmdk/Makefile.in,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.in 25 May 2005 16:25:19 -0000 1.5 --- Makefile.in 3 Jun 2005 19:27:15 -0000 1.6 *************** *** 411,415 **** ifeq ($(NEW_KBUILD), y) #the 2.6 kernel build stuff ! EXTRA_CFLAGS += -I$(src)/../../include -I$(src)/../../.. -DDBPRINT -DDEBUG obj-m += dlmdk_core.o obj-m += dlmdk_base.o --- 411,415 ---- ifeq ($(NEW_KBUILD), y) #the 2.6 kernel build stuff ! EXTRA_CFLAGS += -I$(src)/../../include -I$(src)/../../.. -DDBPRINT obj-m += dlmdk_core.o obj-m += dlmdk_base.o Index: clm_info.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmdk/clm_info.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** clm_info.c 25 May 2005 16:25:19 -0000 1.14 --- clm_info.c 3 Jun 2005 19:27:16 -0000 1.15 *************** *** 438,441 **** --- 438,448 ---- sched_queue(0, CLM_MSG_NODE_INIT); + #ifdef CONFIG_PROC_FS + /* add the local symbolic link. this will serve as a trigger + * to user space that a connection to the cluster manager was + * successful and the local node id was discovered + */ + dlm_proc_create_local_entry( localID ); + #endif break; *************** *** 475,483 **** node_list.high_version) ; ! for (EACH_DLM_LISTNODE(&node_list.cluster, pNode)) ! printk( " %ld %x %d.%d.%d.%d\n", ! pNode->nodeid, ! pNode->version, ! NIPQUAD( pNode->saddr.s_addr )) ; #endif } --- 482,491 ---- node_list.high_version) ; ! for (EACH_DLM_LISTNODE(&node_list.cluster, pNode) ) ! printk( " %ld %u.%u.%u %d.%d.%d.%d\n", ! pNode->nodeid, (pNode->version >> 16), ! ((pNode->version & 0x0ffff) >> 8), ! (pNode->version & 0x0ff), ! NIPQUAD( pNode->saddr.s_addr )) ; #endif } *************** *** 650,658 **** if (pNode->state == CLM_MSG_NODE_UP) { return FALSE; /* duplicate event */ } pNode->state = CLM_MSG_NODE_UP; #ifdef CONFIG_PROC_FS ! pNode->proc_entry = dlm_proc_create_node_entry( nodeid ); #endif } --- 658,668 ---- if (pNode->state == CLM_MSG_NODE_UP) { + return FALSE; /* duplicate event */ } pNode->state = CLM_MSG_NODE_UP; #ifdef CONFIG_PROC_FS ! if (!pNode->proc_entry) ! pNode->proc_entry = dlm_proc_create_node_entry( nodeid ); #endif } Index: clm_lock.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmdk/clm_lock.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** clm_lock.c 25 May 2005 16:25:20 -0000 1.8 --- clm_lock.c 3 Jun 2005 19:27:16 -0000 1.9 *************** *** 519,525 **** */ } else if ( (flags & PURGE_DEAD) || (curr->lck.state & LOCK_ORPHANED) ! || ((flags & PURGE_ME) && ((rp->type != DLM_RES_UNIX) || (curr->lck.mode != LKM_NLMODE))) ) --- 519,528 ---- */ } + /* added check to _not_ delete a recovery domain lock from a self + * purging client. -DCZ + */ else if ( (flags & PURGE_DEAD) || (curr->lck.state & LOCK_ORPHANED) ! || ((flags & PURGE_ME) && !(rp->rsrc_flags & RSRC_RD) && ((rp->type != DLM_RES_UNIX) || (curr->lck.mode != LKM_NLMODE))) ) Index: clm_main.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmdk/clm_main.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** clm_main.c 25 May 2005 16:25:20 -0000 1.20 --- clm_main.c 3 Jun 2005 19:27:16 -0000 1.21 *************** *** 176,183 **** snprintf(main_compiled, sizeof( main_compiled ), ! "DLMK Major/Minor(%d/%d/%p) %s\n", ! DLM_MAJOR_VERSION, ! DLM_MINOR_VERSION, ! (void *)DLM_VERSION, dlm_timestr); --- 176,181 ---- snprintf(main_compiled, sizeof( main_compiled ), ! "DLMK (%s) %s\n", ! DLM_VERSION_STR, dlm_timestr); Index: clm_purge.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmdk/clm_purge.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** clm_purge.c 25 May 2005 16:25:20 -0000 1.7 --- clm_purge.c 3 Jun 2005 19:27:16 -0000 1.8 *************** *** 498,501 **** --- 498,506 ---- goto badreq; } + else if (!site) + { + site = OurSiteID; + prg->purgesite = site; + } /* Index: clm_resource.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmdk/clm_resource.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** clm_resource.c 25 May 2005 16:25:21 -0000 1.14 --- clm_resource.c 3 Jun 2005 19:27:16 -0000 1.15 *************** *** 1040,1044 **** { dlm_log(LOG_ERR, "%s: could not delete domain lock", __FUNCTION__); ! return; } --- 1040,1047 ---- { dlm_log(LOG_ERR, "%s: could not delete domain lock", __FUNCTION__); ! //FIXME this comment below fixes the symptom and not the problem. ! //FIXME the problem is cached recovery domains are deleted first ! //FIXME leaving rdomain_locks that no longer exist. ! //return; } Index: dlm_kerndd.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmdk/dlm_kerndd.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** dlm_kerndd.c 25 May 2005 16:25:21 -0000 1.28 --- dlm_kerndd.c 3 Jun 2005 19:27:16 -0000 1.29 *************** *** 90,95 **** //#include <linux/proc_fs.h> //#include <linux/timer.h> ! //#include <asm/uaccess.h> ! //#include <linux/poll.h> #include <net/sock.h> --- 90,95 ---- //#include <linux/proc_fs.h> //#include <linux/timer.h> ! #include <asm/uaccess.h> ! #include <linux/poll.h> #include <net/sock.h> Index: dlm_proc.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmdk/dlm_proc.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** dlm_proc.c 25 May 2005 16:25:21 -0000 1.13 --- dlm_proc.c 3 Jun 2005 19:27:16 -0000 1.14 *************** *** 211,215 **** --- 211,237 ---- + /****************************************************************************/ + /* dlm_proc_create_local_entry - Create a local node-level /proc symbolic link + * + */ + void + dlm_proc_create_local_entry( + unsigned long site + ) + { + struct proc_dir_entry * sub; + char buffer[8]; + + + (void) snprintf( buffer, sizeof( buffer ), "%lu", site ); + buffer[ sizeof( buffer ) - 1 ] = '\0'; + + (void) remove_proc_entry( "local", proc_dlm ); + sub = proc_symlink( "local", proc_dlm, buffer ); + sub->owner = THIS_MODULE; + + return; + } /****************************************************************************/ *************** *** 299,302 **** --- 321,325 ---- unsigned major; unsigned minor; + unsigned patch; *************** *** 316,333 **** major = 0; minor = 0; } else { major = ((unsigned) version) >> 16; ! minor = ((unsigned) version) & 0x0ffff; } } else { ! major = DLM_MAJOR_VERSION; ! minor = DLM_MINOR_VERSION; } - bytes = snprintf( & page[ off ], count - off, "%u.%u\n", major, minor ); *eof = 1; --- 339,358 ---- major = 0; minor = 0; + patch = 0; } else { major = ((unsigned) version) >> 16; ! minor = (((unsigned) version) & 0x0ffff) >> 8; ! patch = ((unsigned) version & 0x0ff); } + bytes = snprintf( & page[ off ], count - off, "%u.%u.%u\n", major, + minor, patch ); } else { ! bytes = snprintf( & page[ off ], count - off, "%s\n", DLM_VERSION_STR ); } *eof = 1; Index: dlm_proc.h =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmdk/dlm_proc.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dlm_proc.h 20 May 2003 03:31:30 -0000 1.2 --- dlm_proc.h 3 Jun 2005 19:27:16 -0000 1.3 *************** *** 32,35 **** --- 32,36 ---- int dlm_proc_start(const char *name); void dlm_proc_cleanup(void); + void dlm_proc_create_local_entry(unsigned long site); struct proc_dir_entry *dlm_proc_create_node_entry(unsigned long site); void dlm_proc_destroy_node_entry(struct proc_dir_entry *base); Index: dlm_real_proto.h =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmdk/dlm_real_proto.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** dlm_real_proto.h 25 May 2005 16:25:21 -0000 1.14 --- dlm_real_proto.h 3 Jun 2005 19:27:16 -0000 1.15 *************** *** 338,341 **** --- 338,342 ---- extern int dlm_proc_start(const char *name); extern void dlm_proc_cleanup(void); + extern void dlm_proc_create_local_entry(unsigned long site); extern struct proc_dir_entry *dlm_proc_create_node_entry(unsigned long site); extern void dlm_proc_destroy_node_entry(struct proc_dir_entry *base); Index: hsm.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmdk/hsm.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** hsm.c 25 May 2005 16:25:21 -0000 1.8 --- hsm.c 3 Jun 2005 19:27:16 -0000 1.9 *************** *** 71,75 **** #include "config.h" ! //#include <linux/kernel.h> #include <linux/version.h> #include "hsm.h" --- 71,75 ---- #include "config.h" ! #include <linux/kernel.h> #include <linux/version.h> #include "hsm.h" |
|
From: <cao...@us...> - 2005-06-03 19:27:26
|
Update of /cvsroot/opendlm/opendlm/src/user/dlmdu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27790/src/user/dlmdu Modified Files: dlm_cmdline.c dlm_config.c dlm_daemon.c dlm_device.c Log Message: daemonizing changes and version info changes Index: dlm_cmdline.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/user/dlmdu/dlm_cmdline.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** dlm_cmdline.c 25 May 2005 16:25:21 -0000 1.9 --- dlm_cmdline.c 3 Jun 2005 19:27:17 -0000 1.10 *************** *** 48,76 **** #include <stdio.h> - #include <signal.h> - #include <unistd.h> - #include <errno.h> #include <string.h> - #include <sys/types.h> - #include <sys/param.h> - #include <sys/ipc.h> - #include <sys/msg.h> - #include <sys/file.h> - #include <sys/ioctl.h> - #include <sys/time.h> #include <sys/resource.h> - #include <sys/socket.h> - #include <sys/socketvar.h> - #include <sys/syslog.h> #include "dlm.h" - #include "ast.h" - #include "dlm_cluster.h" #include "dlm_kernel.h" - #include "dlm_devmsg.h" #include "dlm_version.h" #include "clmstructs.h" ! #include "clm_migrate.h" ! #include "pti.h" #undef LOCK_FREE --- 48,60 ---- #include <stdio.h> #include <string.h> #include <sys/resource.h> #include "dlm.h" #include "dlm_kernel.h" #include "dlm_version.h" #include "clmstructs.h" ! #include "dlm_log.h" ! #undef LOCK_FREE *************** *** 176,186 **** main_compiled = malloc(MAXLINELEN); sprintf(main_compiled, ! "DLMDU Major/Minor(%d/%d/%p) %s\n", ! DLM_MAJOR_VERSION, ! DLM_MINOR_VERSION, ! (void *)DLM_VERSION, dlm_timestr); ! printf(main_compiled); ! syslog(LOG_INFO, main_compiled); --- 160,167 ---- main_compiled = malloc(MAXLINELEN); sprintf(main_compiled, ! "DLMDU (%s) %s\n", ! DLM_VERSION_STR, dlm_timestr); ! dlm_log(LOG_INFO, main_compiled); *************** *** 399,403 **** { mask |= options[i].opt_mask; ! fprintf(stderr, "%s debugging enabled\n", options[i].opt_name); } --- 380,384 ---- { mask |= options[i].opt_mask; ! dlm_log(LOG_INFO, "%s debugging enabled\n", options[i].opt_name); } *************** *** 405,409 **** { mask &= ~ options[i].opt_mask ; ! fprintf(stderr, "%s debugging disabled\n", options[i].opt_name); } --- 386,390 ---- { mask &= ~ options[i].opt_mask ; ! dlm_log(LOG_INFO, "%s debugging disabled\n", options[i].opt_name); } Index: dlm_config.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/user/dlmdu/dlm_config.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dlm_config.c 3 Mar 2005 19:58:10 -0000 1.5 --- dlm_config.c 3 Jun 2005 19:27:17 -0000 1.6 *************** *** 54,67 **** #include <stdio.h> - #include <stdlib.h> - #include <unistd.h> #include <errno.h> #include <string.h> - #include <sys/types.h> - #include <sys/stat.h> - #include <sys/wait.h> - #include <sys/socket.h> - #include <netinet/in.h> - #include <arpa/inet.h> #include "dlm_cluster.h" --- 54,59 ---- *************** *** 69,72 **** --- 61,66 ---- #include "dlm_devmsg.h" #include "dlm_kernel.h" + #include "dlm_log.h" + /* ============================================================ */ *************** *** 141,165 **** } ! fprintf(stderr, "End of configuration file."); if (!have_dlmname) { ! fprintf(stderr, "Missing DLMNAME name entry."); } if (!have_nodecount) { ! fprintf(stderr, "Missing NODECOUNT entry."); } if (!have_dlmmajor) { ! fprintf(stderr, "Missing DLMMAJOR entry."); } if (!have_dlmcmgr) { ! fprintf(stderr, "Missing DLMCMGR entry."); } if (!have_dlmadmin) { ! fprintf(stderr, "Missing DLMADMIN entry."); } if (!have_dlmlocks) { ! fprintf(stderr, "Missing DLMLOCKS entry."); } if (!have_dlmport) { ! fprintf(stderr, "Missing DLMPORT entry."); } #endif /* DO_WE_WANT_REQUIRE_THESE_ALL_IN_CONFIG */ --- 135,159 ---- } ! dlm_log(LOG_ERR, "End of configuration file."); if (!have_dlmname) { ! dlm_log(LOG_ERR, "Missing DLMNAME name entry."); } if (!have_nodecount) { ! dlm_log(LOG_ERR, "Missing NODECOUNT entry."); } if (!have_dlmmajor) { ! dlm_log(LOG_ERR, "Missing DLMMAJOR entry."); } if (!have_dlmcmgr) { ! dlm_log(LOG_ERR, "Missing DLMCMGR entry."); } if (!have_dlmadmin) { ! dlm_log(LOG_ERR, "Missing DLMADMIN entry."); } if (!have_dlmlocks) { ! dlm_log(LOG_ERR, "Missing DLMLOCKS entry."); } if (!have_dlmport) { ! dlm_log(LOG_ERR, "Missing DLMPORT entry."); } #endif /* DO_WE_WANT_REQUIRE_THESE_ALL_IN_CONFIG */ *************** *** 169,175 **** } ! fprintf(stderr, "End of configuration file."); if (!have_nodecount) { ! fprintf(stderr, "Missing NODECOUNT entry."); } --- 163,169 ---- } ! dlm_log(LOG_ERR, "End of configuration file."); if (!have_nodecount) { ! dlm_log(LOG_ERR, "Missing NODECOUNT entry."); } *************** *** 196,201 **** FILE *config_fp; ! fprintf(stderr, ! "Opening configuration file [%s]\n", args->dlmconfigfile); --- 190,194 ---- FILE *config_fp; ! dlm_log(LOG_INFO, "Opening configuration file [%s]\n", args->dlmconfigfile); *************** *** 204,208 **** */ if (NULL == (config_fp = fopen(args->dlmconfigfile, "r"))) { ! fprintf(stderr, "Error [%d/%s] opening config file [%s]!\n", errno, strerror(errno), --- 197,201 ---- */ if (NULL == (config_fp = fopen(args->dlmconfigfile, "r"))) { ! dlm_log(LOG_ERR, "Error [%d/%s] opening config file [%s]!\n", errno, strerror(errno), *************** *** 210,214 **** return(NULL); } ! fprintf(stderr, "Opened configuration file.\n"); /* --- 203,207 ---- return(NULL); } ! dlm_log(LOG_DEBUG, "Opened configuration file.\n"); /* *************** *** 224,229 **** linenum++; #ifdef DEBUG ! fprintf(stderr, ! "Linenum: %d Line: %s", linenum, confline); --- 217,221 ---- linenum++; #ifdef DEBUG ! dlm_log(LOG_DEBUG, "Linenum: %d Line: %s", linenum, confline); *************** *** 244,248 **** if ((DLM_MINNODE_NUMBER > node_entries->dlm_node_number) || (DLM_MAXNODE_NUMBER < node_entries->dlm_node_number)) { ! fprintf(stderr, "Node number [%d] not in range %d to %d, inclusive.\n", node_entries->dlm_node_number, --- 236,240 ---- if ((DLM_MINNODE_NUMBER > node_entries->dlm_node_number) || (DLM_MAXNODE_NUMBER < node_entries->dlm_node_number)) { ! dlm_log(LOG_ERR, "Node number [%d] not in range %d to %d, inclusive.\n", node_entries->dlm_node_number, *************** *** 254,259 **** len = strlen(name); if (MAX_NODENAME_LEN <= len) { ! fprintf(stderr, ! "Given nodename [%s] longer than limit of [%d]\n", name, MAX_NODENAME_LEN); --- 246,250 ---- len = strlen(name); if (MAX_NODENAME_LEN <= len) { ! dlm_log(LOG_ERR, "Given nodename [%s] longer than limit of [%d]\n", name, MAX_NODENAME_LEN); *************** *** 263,267 **** if (0 == inet_aton(ipvalue, &inipadd)) { ! fprintf(stderr, "Cannot convert IP address [%s]\n", ipvalue); return(NULL); } --- 254,258 ---- if (0 == inet_aton(ipvalue, &inipadd)) { ! dlm_log(LOG_ERR, "Cannot convert IP address [%s]\n", ipvalue); return(NULL); } *************** *** 315,321 **** sscanf(value, "%d", &args->dlmport); } else { ! fprintf(stderr,"Invalid configuration file entry!"); ! fprintf(stderr, ! "Bad line: %s", confline); return(NULL); --- 306,311 ---- sscanf(value, "%d", &args->dlmport); } else { ! dlm_log(LOG_ERR,"Invalid configuration file entry!"); ! dlm_log(LOG_ERR, "Bad line: %s", confline); return(NULL); *************** *** 365,369 **** if (0 != fclose(config_fp)) { ! fprintf(stderr, "Error [%d/%s] closing config file [%s]!\n", errno, strerror(errno), --- 355,359 ---- if (0 != fclose(config_fp)) { ! dlm_log(LOG_ERR, "Error [%d/%s] closing config file [%s]!\n", errno, strerror(errno), Index: dlm_daemon.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/user/dlmdu/dlm_daemon.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** dlm_daemon.c 25 May 2005 16:25:21 -0000 1.9 --- dlm_daemon.c 3 Jun 2005 19:27:17 -0000 1.10 *************** *** 118,128 **** #include <unistd.h> #include <errno.h> - #include <sys/types.h> #include <sys/stat.h> - #include <sys/wait.h> - #include <sys/types.h> - #include <sys/stat.h> - #include <fcntl.h> - #include <time.h> #include <assert.h> #include <semaphore.h> --- 118,122 ---- *************** *** 135,142 **** #include "dlm_devmsg.h" #include "dlm_kernel.h" - #include "dlm_version.h" #include "cltrc.h" - #include "dlm_list.h" --- 129,135 ---- #include "dlm_devmsg.h" #include "dlm_kernel.h" #include "cltrc.h" #include "dlm_list.h" + #include "dlm_log.h" *************** *** 230,241 **** if (-1 == admin_fd) return; ! if (0 != close(admin_fd)) { ! fprintf(stderr, ! "Error closing admin file [%d], errno [%s]\n", admin_fd, strerror(errno)); ! } else { ! fprintf(stderr, ! "Closed admin file [%d, %s]\n", admin_fd, args.dlmadminname); --- 223,235 ---- if (-1 == admin_fd) return; ! if (0 != close(admin_fd)) ! { ! dlm_log(LOG_ERR, "Error closing admin file [%d], errno [%s]\n", admin_fd, strerror(errno)); ! } ! else ! { ! dlm_log(LOG_DEBUG, "Closed admin file [%d, %s]\n", admin_fd, args.dlmadminname); *************** *** 246,251 **** #ifdef DIRECT_CLUSTINT cmgr_thread_id = 0; ! fprintf(stderr, ! "Shutting down cluster interface.\n"); cluster_interface_shutdown(); #else /* DIRECT_CLUSTINT */ --- 240,244 ---- #ifdef DIRECT_CLUSTINT cmgr_thread_id = 0; ! dlm_log(LOG_INFO, "Shutting down cluster interface.\n"); cluster_interface_shutdown(); #else /* DIRECT_CLUSTINT */ *************** *** 274,279 **** ++tCaughtSig; ! fprintf(stderr, ! "Caught signal [%d] count [%d]\n", sig, tCaughtSig); --- 267,271 ---- ++tCaughtSig; ! dlm_log(LOG_INFO, "Caught signal [%d] count [%d]\n", sig, tCaughtSig); *************** *** 294,299 **** ++tCaughtSigIO; ! fprintf(stderr, ! "Caught SIGIO number %d\n", tCaughtSigIO); --- 286,290 ---- ++tCaughtSigIO; ! dlm_log(LOG_DEBUG, "Caught SIGIO number %d\n", tCaughtSigIO); *************** *** 308,312 **** { int rc, i; - struct stat statbuf; dlm_MSG_t message; dlm_node_t *node_events; --- 299,302 ---- *************** *** 324,359 **** #endif /* _ON_AIX_DLM_ */ - /* if we're not on a tty, then close all fd's */ - if (fstat(0, &statbuf) != 0 || !isatty(0)) { - if (0 != (rc = close(0))) { - fprintf(stderr, "Error %d closing 0\n", errno); - } - - if (0 != (rc = close(1))) { - fprintf(stderr, "Error %d closing 1\n", errno); - } - - if (0 != (rc = close(2))) { - fprintf(stderr, "Error %d closing 2\n", errno); - } - } - - /* - * Play the field. If someone sends a SIGKILL to the - * dlmdu process, the kernel side will still shut down, - * as our admin hookup will be closed when our process dies. - * We catch these signals in the interest of completeness, - * since the end effect will be the same. - */ - signal(SIGHUP, catch_and_die); - signal(SIGINT, catch_and_die); - signal(SIGQUIT, catch_and_die); - signal(SIGIOT, catch_and_die); - signal(SIGTERM, catch_and_die); - signal(SIGUSR1, catch_and_die); - signal(SIGUSR2, catch_and_die); - signal(SIGCHLD, SIG_IGN); - signal(SIGIO, handle_sigio); - /* * Simple, really. --- 314,317 ---- *************** *** 368,386 **** */ if (0 != parse_options(argc, argv)) { ! fprintf(stderr, ! "Error parsing command line options. Exiting.\n"); exit(1); } if (NULL == (configured_nodes = parse_config_file(&args))) { ! fprintf(stderr, ! "Error reading configuration file. Exiting.\n"); exit(2); } if (0 != verify_dev_entries(&args)) { ! fprintf(stderr, ! "Error establishing /dev entries. Exiting.\n"); exit(3); } --- 326,344 ---- */ + /* open the syslog facility */ + openlog("haDLM", LOG_NDELAY, LOG_DAEMON); + if (0 != parse_options(argc, argv)) { ! fprintf(stderr, "Error parsing command line options. Exiting.\n"); exit(1); } if (NULL == (configured_nodes = parse_config_file(&args))) { ! fprintf(stderr, "Error reading configuration file. Exiting.\n"); exit(2); } if (0 != verify_dev_entries(&args)) { ! fprintf(stderr, "Error establishing /dev entries. Exiting.\n"); exit(3); } *************** *** 394,420 **** child_pid = fork(); ! if ( child_pid == -1 ) { ! fprintf(stderr, ! "Unable to daemonize (fork failed). Exiting.\n"); exit(4); ! } else if ( child_pid != 0 ) { exit(0); } ! setsid(); ! fclose( stdin ); /* * Load device driver and open the "admin" device for * operations. */ ! if (-1 == (admin_fd = load_dev_driver(&args))) { ! fprintf(stderr, ! "Error loading device driver. Exiting.\n"); exit(4); } ! printf("1st thread, pid [%d]\n", ! getpid()); /* write the pid to a file */ --- 352,414 ---- child_pid = fork(); ! if ( child_pid < 0 ) ! { ! fprintf(stderr, "Unable to daemonize (fork failed). Exiting.\n"); exit(4); ! } ! if ( child_pid > 0 ) ! { ! /* successful fork */ exit(0); } ! /* create new sid for child process */ ! if (setsid() < 0) ! { ! exit(1); ! } ! ! /* make sure all new files have certain permission restrictions */ ! umask(027); ! ! /* change to a safe directory */ ! if (chdir("/") < 0) ! { ! exit(1); ! } ! ! /* close the normal file descriptors */ ! close(STDIN_FILENO); ! close(STDOUT_FILENO); ! close(STDERR_FILENO); /* + * Play the field. If someone sends a SIGKILL to the + * dlmdu process, the kernel side will still shut down, + * as our admin hookup will be closed when our process dies. + * We catch these signals in the interest of completeness, + * since the end effect will be the same. + */ + signal(SIGHUP, catch_and_die); + signal(SIGINT, catch_and_die); + signal(SIGQUIT, catch_and_die); + signal(SIGIOT, catch_and_die); + signal(SIGTERM, catch_and_die); + signal(SIGUSR1, catch_and_die); + signal(SIGUSR2, catch_and_die); + signal(SIGCHLD, SIG_IGN); + signal(SIGIO, handle_sigio); + + /* * Load device driver and open the "admin" device for * operations. */ ! if (-1 == (admin_fd = load_dev_driver(&args))) ! { ! dlm_log(LOG_ERR, "Error loading device driver. Exiting.\n"); exit(4); } ! dlm_log(LOG_DEBUG, "1st thread, pid [%d]\n", getpid()); /* write the pid to a file */ *************** *** 479,484 **** i = write(admin_fd, &message, sizeof(message)); /* Tell kernel. */ if (i != sizeof(message)) { ! fprintf(stderr, ! "Error on write, i/err[%d/%s], code/size[%d/%d]\n", i, strerror(errno), --- 473,477 ---- i = write(admin_fd, &message, sizeof(message)); /* Tell kernel. */ if (i != sizeof(message)) { ! dlm_log(LOG_ERR, "Error on write, i/err[%d/%s], code/size[%d/%d]\n", i, strerror(errno), *************** *** 490,495 **** admin_calls++; ! fprintf(stderr, ! "Wrote code/size[%d/%d], blocks so far [%d]\n", message.msg_code, sizeof(message), --- 483,487 ---- admin_calls++; ! dlm_log(LOG_DEBUG, "Wrote code/size[%d/%d], blocks so far [%d]\n", message.msg_code, sizeof(message), *************** *** 507,512 **** */ if (-1 == cluster_manager_setup(configured_nodes)) { ! fprintf(stderr, ! "Error loading cluster interface module. Exiting.\n"); cleanup(); exit(5); --- 499,503 ---- */ if (-1 == cluster_manager_setup(configured_nodes)) { ! dlm_log(LOG_ERR, "Error loading cluster interface module. Exiting.\n"); cleanup(); exit(5); *************** *** 528,532 **** if (0 != rc) { ! fprintf(stderr, "Cannot lock cluster mutex: %s\n", strerror(rc)); goto fail; --- 519,523 ---- if (0 != rc) { ! dlm_log(LOG_ERR, "Cannot lock cluster mutex: %s\n", strerror(rc)); goto fail; *************** *** 540,544 **** if (0 != rc) { ! fprintf(stderr, "Cannot unlock cluster mutex: %s\n", strerror(rc)); goto fail; --- 531,535 ---- if (0 != rc) { ! dlm_log(LOG_ERR, "Cannot unlock cluster mutex: %s\n", strerror(rc)); goto fail; *************** *** 553,562 **** /* send message to the kernel */ - printf("%s: sending message\n",__FUNCTION__); i = write(admin_fd, &message, sizeof(message)); if (i != sizeof(message)) { rc = errno; ! fprintf(stderr, "Error on write type %d: %s\n", message.msg_code, strerror(rc)); goto fail; --- 544,552 ---- /* send message to the kernel */ i = write(admin_fd, &message, sizeof(message)); if (i != sizeof(message)) { rc = errno; ! dlm_log(LOG_ERR, "Error on write type %d: %s\n", message.msg_code, strerror(rc)); goto fail; *************** *** 566,571 **** admin_calls++; ! fprintf(stderr, ! "Wrote code/size[%d/%d], blocks so far [%d]\n", message.msg_code, sizeof(message), --- 556,560 ---- admin_calls++; ! dlm_log(LOG_DEBUG, "Wrote code/size[%d/%d], blocks so far [%d]\n", message.msg_code, sizeof(message), *************** *** 573,577 **** } - printf("%s: sent message\n",__FUNCTION__); /* release message */ free(node_events); --- 562,565 ---- *************** *** 587,599 **** admin_fd = open(args.dlmadminname, O_RDWR); ! if (-1 == admin_fd) { ! fprintf(stderr, ! "Error opening [%s], errno [%s]\n", args.dlmadminname, strerror(errno)); return(-1); ! } else { ! fprintf(stderr, ! "Opened [%s], filedes [%d]\n", args.dlmadminname, admin_fd); --- 575,588 ---- admin_fd = open(args.dlmadminname, O_RDWR); ! if (-1 == admin_fd) ! { ! dlm_log(LOG_ERR, "Error opening [%s], errno [%s]\n", args.dlmadminname, strerror(errno)); return(-1); ! } ! else ! { ! dlm_log(LOG_DEBUG, "Opened [%s], filedes [%d]\n", args.dlmadminname, admin_fd); *************** *** 622,649 **** i = write(admin_fd, &message, sizeof(haDLM_MSG_t)); ! if (i != sizeof(haDLM_MSG_t)) { ! fprintf(stderr, ! "Error on write, i=[%d], buffer[%d/%s]\n", i, message.msg_code, message.msg_data); exit(1); ! } else { ! fprintf(stderr, ! "Wrote buffer[%d/%s]\n", message.msg_code, message.msg_data); } ! fprintf(stderr, "Sleeping..."); ! for (i = 0; i < 30; i++) { ! fprintf(stderr, "."); sleep(1); } ! fprintf(stderr, "\n"); } #endif /* ALL_NIGHT_TEST */ ! exit(EOK); fail: --- 611,640 ---- i = write(admin_fd, &message, sizeof(haDLM_MSG_t)); ! if (i != sizeof(haDLM_MSG_t)) ! { ! dlm_log(LOG_ERR, "Error on write, i=[%d], buffer[%d/%s]\n", i, message.msg_code, message.msg_data); exit(1); ! } ! else ! { ! dlm_log(LOG_DEBUG, "Wrote buffer[%d/%s]\n", message.msg_code, message.msg_data); } ! dlm_log(LOG_DEBUG, "Sleeping..."); ! for (i = 0; i < 30; i++) ! { ! dlm_log(LOG_DEBUG, "."); sleep(1); } ! dlm_log(LOG_DEBUG, "\n"); } #endif /* ALL_NIGHT_TEST */ ! rc=EOK; fail: *************** *** 701,705 **** if (!find_configured_node(qnode)) { ! fprintf(stderr, "Dropping event. \n"); nodeq_count--; free(qnode); --- 692,696 ---- if (!find_configured_node(qnode)) { ! dlm_log(LOG_INFO, "Dropping event. \n"); nodeq_count--; free(qnode); *************** *** 736,744 **** if ((-1 != node->dlm_node_number) && (NULL != node->dlm_node_name) ) /* all relevant info is filled in * skip the lookup */ ! return 1; ! if (haDLM_state_done == node->dlm_node_state) return 1; for(entry = &configured_nodes->dlm_node_entries[0]; --- 727,746 ---- if ((-1 != node->dlm_node_number) && (NULL != node->dlm_node_name) ) + { + /* cheap shutdown hack */ + if (node->dlm_node_address.s_addr == -1) + need_to_quit=1; + /* all relevant info is filled in * skip the lookup */ ! found=1; ! goto done; ! } ! if (haDLM_state_done == node->dlm_node_state) ! { ! found=1; ! goto done; ! } for(entry = &configured_nodes->dlm_node_entries[0]; *************** *** 760,765 **** continue; } ! fprintf(stderr, ! "compare [%s] and [%s]\n", entry->dlm_node_name, node->dlm_node_name); --- 762,766 ---- continue; } ! dlm_log(LOG_INFO, "compare [%s] and [%s]\n", entry->dlm_node_name, node->dlm_node_name); *************** *** 806,822 **** node->dlm_node_address = entry->dlm_node_address; } if (found) { ! fprintf(stderr, ! "found number/name[%d/%s/%s]\n", node->dlm_node_number, node->dlm_node_name, inet_ntoa(node->dlm_node_address)); } else { ! fprintf(stderr, "not found\n"); } if (haDLM_state_local == node->dlm_comm_state) ! printf("find_configured_node: Local is %s\n",node->dlm_node_name); return(found); --- 807,824 ---- node->dlm_node_address = entry->dlm_node_address; } + done: if (found) { ! dlm_log(LOG_INFO, "found number/name[%d/%s/%s]\n", node->dlm_node_number, node->dlm_node_name, inet_ntoa(node->dlm_node_address)); } else { ! dlm_log(LOG_ERR, "not found\n"); } if (haDLM_state_local == node->dlm_comm_state) ! dlm_log(LOG_INFO, "find_configured_node: Local is %s\n", ! node->dlm_node_name); return(found); *************** *** 852,857 **** sprintf(libname, "dlm_%s.so", args.dlmclustermgr); ! fprintf(stderr, ! "Attempt to open cluster interface library [%s]\n", libname); #if 0 --- 854,858 ---- sprintf(libname, "dlm_%s.so", args.dlmclustermgr); ! dlm_log(LOG_DEBUG, "Attempt to open cluster interface library [%s]\n", libname); #if 0 *************** *** 862,884 **** RTLD_NOW); if (NULL == cluster_interface_handle) { ! fprintf(stderr, ! "Cannot load cluster interface lib [%s]\n", dlerror()); status = -1; } else { ! fprintf(stderr, ! "Loaded cluster interface lib, handle [%p]\n", cluster_interface_handle); cluster_interface_start = dlsym(cluster_interface_handle, CLUSTER_INTERFACE_START); if ((error = dlerror()) != NULL) { ! fprintf(stderr, ! "Cannot resolve [%s] in cluster lib, error [%s]\n", CLUSTER_INTERFACE_START, error); status = -1; } else { ! fprintf(stderr, ! "Resolved [%s] in cluster lib [%p]\n", CLUSTER_INTERFACE_START, cluster_interface_start); --- 863,881 ---- RTLD_NOW); if (NULL == cluster_interface_handle) { ! dlm_log(LOG_ERR, "Cannot load cluster interface lib [%s]\n", dlerror()); status = -1; } else { ! dlm_log(LOG_INFO, "Loaded cluster interface lib, handle [%p]\n", cluster_interface_handle); cluster_interface_start = dlsym(cluster_interface_handle, CLUSTER_INTERFACE_START); if ((error = dlerror()) != NULL) { ! dlm_log(LOG_ERR, "Cannot resolve [%s] in cluster lib, error [%s]\n", CLUSTER_INTERFACE_START, error); status = -1; } else { ! dlm_log(LOG_INFO, "Resolved [%s] in cluster lib [%p]\n", CLUSTER_INTERFACE_START, cluster_interface_start); *************** *** 887,898 **** CLUSTER_INTERFACE_STOP); if ((error = dlerror()) != NULL) { ! fprintf(stderr, ! "Cannot resolve [%s] in cluster lib, error [%s]\n", CLUSTER_INTERFACE_STOP, error); status = -1; } else { ! fprintf(stderr, ! "Resolved [%s] in cluster lib [%p]\n", CLUSTER_INTERFACE_STOP, cluster_interface_stop); --- 884,893 ---- CLUSTER_INTERFACE_STOP); if ((error = dlerror()) != NULL) { ! dlm_log(LOG_ERR, "Cannot resolve [%s] in cluster lib, error [%s]\n", CLUSTER_INTERFACE_STOP, error); status = -1; } else { ! dlm_log(LOG_INFO, "Resolved [%s] in cluster lib [%p]\n", CLUSTER_INTERFACE_STOP, cluster_interface_stop); *************** *** 901,905 **** } ! fprintf(stderr, "Make sure linkages work...\n"); (*cluster_interface_stop)(); #endif /* !DIRECT_CLUSTINT */ --- 896,900 ---- } ! dlm_log(LOG_DEBUG, "Make sure linkages work...\n"); (*cluster_interface_stop)(); #endif /* !DIRECT_CLUSTINT */ *************** *** 921,931 **** if (0 != status) { ! fprintf(stderr, ! "Bad return creating cluster interface thread [%d]\n", status); status = -1; } else { ! fprintf(stderr, ! "Created thread, id [%ld]\n", cmgr_thread_id); } --- 916,924 ---- if (0 != status) { ! dlm_log(LOG_ERR, "Bad return creating cluster interface thread [%d]\n", status); status = -1; } else { ! dlm_log(LOG_INFO, "Created thread, id [%ld]\n", cmgr_thread_id); } *************** *** 944,949 **** void *ret; ! fprintf(stderr, ! "Second thread, calling interface support at [%p]...\n", cluster_interface_start); --- 937,941 ---- void *ret; ! dlm_log(LOG_INFO, "Second thread, calling interface support at [%p]...\n", cluster_interface_start); *************** *** 967,973 **** copy_nodes = (dlm_node_array_t *)malloc(sizeof(dlm_node_array_t) + ((count - 1) * sizeof(dlm_node_t))); ! if (NULL == copy_nodes) { ! fprintf(stderr, ! "Cannot allocate configured nodes array for RSCT module\n"); exit(88); } --- 959,966 ---- copy_nodes = (dlm_node_array_t *)malloc(sizeof(dlm_node_array_t) + ((count - 1) * sizeof(dlm_node_t))); ! if (NULL == copy_nodes) ! { ! dlm_log(LOG_ERR, ! "Cannot allocate configured nodes array for RSCT module\n"); exit(88); } *************** *** 998,1004 **** int rc; ! if (NULL == (que = malloc(sizeof(*que)))) { ! fprintf(stderr, ! "Cannot allocate dlm_node_t element\n"); goto fail; } --- 991,997 ---- int rc; ! if (NULL == (que = malloc(sizeof(*que)))) ! { ! dlm_log(LOG_ERR, "Cannot allocate dlm_node_t element\n"); goto fail; } *************** *** 1011,1015 **** if (strlen(hostname) > MAX_NODENAME_LEN) { ! fprintf(stderr, "Node name (%s) is too long (max - %d), truncating\n", hostname, MAX_NODENAME_LEN); } --- 1004,1008 ---- if (strlen(hostname) > MAX_NODENAME_LEN) { ! dlm_log(LOG_ERR, "Node name (%s) is too long (max - %d), truncating\n", hostname, MAX_NODENAME_LEN); } *************** *** 1021,1025 **** if (0 != rc) { ! fprintf(stderr, "Cannot lock cluster mutex: %s\n", strerror(rc)); goto fail; --- 1014,1018 ---- if (0 != rc) { ! dlm_log(LOG_ERR, "Cannot lock cluster mutex: %s\n", strerror(rc)); goto fail; *************** *** 1034,1044 **** if (0 != rc) { ! fprintf(stderr, "Cannot lock cluster mutex: %s\n", strerror(rc)); goto fail; } ! fprintf(stderr, ! "Node have [%d] nodeq elements queued\n", nodeq_count); --- 1027,1036 ---- if (0 != rc) { ! dlm_log(LOG_ERR, "Cannot lock cluster mutex: %s\n", strerror(rc)); goto fail; } ! dlm_log(LOG_INFO, "Node have [%d] nodeq elements queued\n", nodeq_count); *************** *** 1057,1064 **** int dlm_write_buffer(char *buffer) { ! int ret; ! ! ret = fprintf(stderr, "%s", buffer); ! return(ret); } --- 1049,1054 ---- int dlm_write_buffer(char *buffer) { ! dlm_log(LOG_INFO, "%s", buffer); ! return(0); } Index: dlm_device.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/user/dlmdu/dlm_device.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** dlm_device.c 3 Mar 2005 19:58:10 -0000 1.7 --- dlm_device.c 3 Jun 2005 19:27:17 -0000 1.8 *************** *** 60,73 **** #include <stdio.h> - #include <stdlib.h> - #include <sys/time.h> - #include <sys/types.h> - #include <sys/sysmacros.h> - #include <ctype.h> #include <sys/stat.h> - #include <pwd.h> - #include <grp.h> #include <fcntl.h> - #include <unistd.h> #include <string.h> #include <errno.h> --- 60,65 ---- *************** *** 75,78 **** --- 67,71 ---- #include "clmstructs.h" #include "dlm_kernel.h" + #include "dlm_log.h" /* ============================================================ */ *************** *** 101,116 **** */ if (ENOENT == errno) { ! fprintf(stderr, ! "Device [%s] does not exist. Create it.\n", device); if (-1 == (rc = mknod(device, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH, makedev(major, minor)))) { ! fprintf(stderr, ! "Error [%s] creating device.\n", strerror(errno)); } } else { ! fprintf(stderr, "Error on stat: [%s]\n", strerror(errno)); } } else { --- 94,107 ---- */ if (ENOENT == errno) { ! dlm_log(LOG_INFO, "Device [%s] does not exist. Create it.\n", device); if (-1 == (rc = mknod(device, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH, makedev(major, minor)))) { ! dlm_log(LOG_ERR, "Error [%s] creating device.\n", strerror(errno)); } } else { ! dlm_log(LOG_ERR, "Error on stat: [%s]\n", strerror(errno)); } } else { *************** *** 121,125 **** (minor != minor(statbuf.st_rdev)) || (major != major(statbuf.st_rdev))) { ! fprintf(stderr, "Fixing device [%s], type/maj/min[0x%x/%d/%d] want maj/min[%d/%d]\n", device, --- 112,116 ---- (minor != minor(statbuf.st_rdev)) || (major != major(statbuf.st_rdev))) { ! dlm_log(LOG_INFO, "Fixing device [%s], type/maj/min[0x%x/%d/%d] want maj/min[%d/%d]\n", device, *************** *** 130,135 **** minor); if (-1 == (rc = unlink(device))) { ! fprintf(stderr, ! "Cannot unlink device [%s] error [%s].\n", device, strerror(errno)); --- 121,125 ---- minor); if (-1 == (rc = unlink(device))) { ! dlm_log(LOG_ERR, "Cannot unlink device [%s] error [%s].\n", device, strerror(errno)); *************** *** 138,143 **** S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH, makedev(major, minor)))) { ! fprintf(stderr, ! "Error [%s] creating device.\n", strerror(errno)); } --- 128,132 ---- S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH, makedev(major, minor)))) { ! dlm_log(LOG_ERR, "Error [%s] creating device.\n", strerror(errno)); } *************** *** 179,194 **** */ if (ENOENT == errno) { ! fprintf(stderr, ! "Lock directory does not exist [%s]. Create it.\n", args->dlmdevicename); if (-1 == mkdir(args->dlmdevicename, S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)) { ! fprintf(stderr, ! "Error [%s] creating lock directory.\n", strerror(errno)); return(-1); } } else { ! fprintf(stderr, "Error on stat: %s\n", strerror(errno)); return(-1); } --- 168,181 ---- */ if (ENOENT == errno) { ! dlm_log(LOG_INFO, "Lock directory does not exist [%s]. Create it.\n", args->dlmdevicename); if (-1 == mkdir(args->dlmdevicename, S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)) { ! dlm_log(LOG_ERR, "Error [%s] creating lock directory.\n", strerror(errno)); return(-1); } } else { ! dlm_log(LOG_ERR, "Error on stat: %s\n", strerror(errno)); return(-1); } *************** *** 198,203 **** */ if (!S_ISDIR(statbuf.st_mode)) { ! fprintf(stderr, ! "Lock directory [%s] is not a directory, but [%x].\n", args->dlmdevicename, statbuf.st_mode); --- 185,189 ---- */ if (!S_ISDIR(statbuf.st_mode)) { ! dlm_log(LOG_ERR, "Lock directory [%s] is not a directory, but [%x].\n", args->dlmdevicename, statbuf.st_mode); *************** *** 254,260 **** filedes = open(args->dlmadminname, O_RDWR); ! if (-1 != filedes) { ! fprintf(stderr, ! "Opened [%s], filedes [%d]\n", args->dlmadminname, filedes); --- 240,246 ---- filedes = open(args->dlmadminname, O_RDWR); ! if (-1 != filedes) ! { ! dlm_log(LOG_INFO, "Opened [%s], filedes [%d]\n", args->dlmadminname, filedes); *************** *** 282,287 **** args->dlmport); strcat(command, settings); ! fprintf(stderr, ! "Attempt to load DLM module, cmd [%s]\n", command); --- 268,272 ---- args->dlmport); strcat(command, settings); ! dlm_log(LOG_INFO, "Attempt to load DLM module, cmd [%s]\n", command); *************** *** 289,300 **** if (0 != rc) { ! fprintf(stderr, ! "Error loading DLM module, rc [%d]\n", rc); ! fprintf(stderr, "This is a known OS issue, re-verifying status.."); //return(-1); ! } else { ! fprintf(stderr, ! "Loaded DLM module!\n"); } --- 274,285 ---- if (0 != rc) { ! dlm_log(LOG_ERR, "Error loading DLM module, rc [%d]\n", rc); ! dlm_log(LOG_ERR, "This is a known OS issue, re-verifying status.."); //return(-1); ! } ! else ! { ! dlm_log(LOG_INFO, "Loaded DLM module!\n"); } *************** *** 302,315 **** if (-1 == filedes) { ! if (0 != rc) fprintf(stderr, "FAILED\n"); ! fprintf(stderr, ! "Error opening [%s], errno [%s]\n", args->dlmadminname, strerror(errno)); return(-1); } else { ! if (0 != rc) fprintf(stderr, "SUCCESS\n"); ! fprintf(stderr, ! "Opened [%s], filedes [%d]\n", args->dlmadminname, filedes); --- 287,298 ---- if (-1 == filedes) { ! if (0 != rc) dlm_log(LOG_ERR, "FAILED\n"); ! dlm_log(LOG_ERR, "Error opening [%s], errno [%s]\n", args->dlmadminname, strerror(errno)); return(-1); } else { ! if (0 != rc) dlm_log(LOG_INFO, "SUCCESS\n"); ! dlm_log(LOG_INFO, "Opened [%s], filedes [%d]\n", args->dlmadminname, filedes); |
|
From: <cao...@us...> - 2005-06-03 19:27:26
|
Update of /cvsroot/opendlm/opendlm/src/user/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27790/src/user/common Modified Files: dlm_ccm.c dlm_heartbeat.c dlm_iiquorumd.c dlm_localhost_cluster.c dlm_rsct.c Log Message: daemonizing changes and version info changes Index: dlm_ccm.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/user/common/dlm_ccm.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dlm_ccm.c 3 Mar 2005 19:58:10 -0000 1.4 --- dlm_ccm.c 3 Jun 2005 19:27:16 -0000 1.5 *************** *** 92,96 **** #include <assert.h> #include <sys/utsname.h> ! #include <sys/syslog.h> #include "dlm.h" --- 92,96 ---- #include <assert.h> #include <sys/utsname.h> ! #include <dlm_log.h> #include "dlm.h" *************** *** 151,155 **** err = uname(&uts_info); if (0 != err) { ! fprintf(stderr, "Error on uname, %d [%s]\n", errno, strerror(errno)); assert(!"cannot get node info from uname"); --- 151,155 ---- err = uname(&uts_info); if (0 != err) { ! dlm_log(LOG_ERR, "Error on uname, %d [%s]\n", errno, strerror(errno)); assert(!"cannot get node info from uname"); *************** *** 159,171 **** listening_thread = pthread_self(); ! printf("2nd thread, pid/tid [%d/%ld]\n", getpid(), listening_thread); if ((ret = saClmInitialize(&handle, &callbacks, NULL)) != SA_OK) { ! fprintf(stderr, "Error on CCM init error, errno [%d]\n",ret); goto init_err; } if ((ret = saClmSelectionObjectGet(&handle, &fd)) != SA_OK) { ! fprintf(stderr, "saClmSelectionObjectGet error, errno [%d]\n", ret); goto get_obj_err; --- 159,172 ---- listening_thread = pthread_self(); ! dlm_log(LOG_INFO,"2nd thread, pid/tid [%d/%ld]\n", getpid(), ! listening_thread); if ((ret = saClmInitialize(&handle, &callbacks, NULL)) != SA_OK) { ! dlm_log(LOG_ERR, "Error on CCM init error, errno [%d]\n",ret); goto init_err; } if ((ret = saClmSelectionObjectGet(&handle, &fd)) != SA_OK) { ! dlm_log(LOG_ERR, "saClmSelectionObjectGet error, errno [%d]\n", ret); goto get_obj_err; *************** *** 174,178 **** if ((ret = saClmClusterTrackStart(&handle, SA_TRACK_CURRENT | SA_TRACK_CHANGES_ONLY, notify_buf, MAXNODES)) != SA_OK) { ! fprintf(stderr, "Error on starting track cluster changes, \ errno [%d]\n", ret); goto start_track_err; --- 175,179 ---- if ((ret = saClmClusterTrackStart(&handle, SA_TRACK_CURRENT | SA_TRACK_CHANGES_ONLY, notify_buf, MAXNODES)) != SA_OK) { ! dlm_log(LOG_ERR, "Error on starting track cluster changes, \ errno [%d]\n", ret); goto start_track_err; *************** *** 192,196 **** continue; else { ! fprintf(stderr, "Error on tracking cluster \ changes, errno [%d]\n", errno); goto monit_err; --- 193,197 ---- continue; else { ! dlm_log(LOG_ERR, "Error on tracking cluster \ changes, errno [%d]\n", errno); goto monit_err; *************** *** 199,206 **** if ((ret = saClmDispatch(&handle, SA_DISPATCH_ALL)) != SA_OK) { if (ret == SA_ERR_LIBRARY) { ! fprintf(stderr, "I am evicted!\n"); goto monit_err; } ! fprintf(stderr, "Error on dispatching events, errno \ [%d]\n", ret); goto monit_err; --- 200,207 ---- if ((ret = saClmDispatch(&handle, SA_DISPATCH_ALL)) != SA_OK) { if (ret == SA_ERR_LIBRARY) { ! dlm_log(LOG_INFO, "I am evicted!\n"); goto monit_err; } ! dlm_log(LOG_ERR, "Error on dispatching events, errno \ [%d]\n", ret); goto monit_err; *************** *** 212,216 **** monit_err: if ((ret = saClmClusterTrackStop(&handle)) != SA_OK) { ! fprintf(stderr, "Error on stoping track cluster changes, \ errno [%d]\n", ret); } --- 213,217 ---- monit_err: if ((ret = saClmClusterTrackStop(&handle)) != SA_OK) { ! dlm_log(LOG_ERR, "Error on stoping track cluster changes, \ errno [%d]\n", ret); } *************** *** 221,225 **** get_obj_err: if ((ret = saClmFinalize(&handle)) != SA_OK) { ! fprintf(stderr, "Error on sign on cluster manager, errno \ [%d]\n", ret); } --- 222,226 ---- get_obj_err: if ((ret = saClmFinalize(&handle)) != SA_OK) { ! dlm_log(LOG_ERR, "Error on sign on cluster manager, errno \ [%d]\n", ret); } *************** *** 250,254 **** if ((ret = saClmClusterTrackStop(&handle)) != SA_OK) { ! fprintf(stderr, "Error on stoping track cluster changes, \ errno [%d]\n", ret); return NULL; --- 251,255 ---- if ((ret = saClmClusterTrackStop(&handle)) != SA_OK) { ! dlm_log(LOG_ERR, "Error on stoping track cluster changes, \ errno [%d]\n", ret); return NULL; *************** *** 256,260 **** if ((ret = saClmFinalize(&handle)) != SA_OK) { ! fprintf(stderr, "Error on sign on cluster manager, errno \ [%d]\n", ret); return NULL; --- 257,261 ---- if ((ret = saClmFinalize(&handle)) != SA_OK) { ! dlm_log(LOG_ERR, "Error on sign on cluster manager, errno \ [%d]\n", ret); return NULL; *************** *** 281,285 **** if (SA_OK != error) { ! fprintf(stderr, "Error on clustser changes track callback \ [%d]\n", error); return; --- 282,286 ---- if (SA_OK != error) { ! dlm_log(LOG_ERR, "Error on clustser changes track callback \ [%d]\n", error); return; Index: dlm_heartbeat.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/user/common/dlm_heartbeat.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** dlm_heartbeat.c 3 Mar 2005 19:58:10 -0000 1.9 --- dlm_heartbeat.c 3 Jun 2005 19:27:16 -0000 1.10 *************** *** 90,94 **** #include <assert.h> #include <sys/utsname.h> ! #include <sys/syslog.h> #include "dlm_devmsg.h" /* Messages to dlm */ --- 90,94 ---- #include <assert.h> #include <sys/utsname.h> ! #include <dlm_log.h> #include "dlm_devmsg.h" /* Messages to dlm */ *************** *** 151,155 **** listening_thread = pthread_self(); ! printf("2nd thread, pid/tid [%d/%ld]\n", getpid(), listening_thread); --- 151,155 ---- listening_thread = pthread_self(); ! dlm_log(LOG_INFO, "2nd thread, pid/tid [%d/%ld]\n", getpid(), listening_thread); *************** *** 158,162 **** if (HA_OK != rc) { ! fprintf(stderr, "Error on Heartbeat init [%d]\n", rc); --- 158,162 ---- if (HA_OK != rc) { ! dlm_log(LOG_ERR, "Error on Heartbeat init [%d]\n", rc); *************** *** 170,177 **** rc = uname(&uts_info); if (0 != rc) { ! fprintf(stderr, "Error on uname, %d [%s]\n", errno, strerror(errno)); assert(!"cannot get node info from uname"); } else { ! fprintf(stderr, "Local node is [%s]\n", uts_info.nodename); --- 170,177 ---- rc = uname(&uts_info); if (0 != rc) { ! dlm_log(LOG_ERR, "Error on uname, %d [%s]\n", errno, strerror(errno)); assert(!"cannot get node info from uname"); } else { ! dlm_log(LOG_ERR, "Local node is [%s]\n", uts_info.nodename); *************** *** 255,259 **** dlm_notify_deliver(-1, temp_addr, name, state, haDLM_state_null); ! syslog( LOG_INFO, "node %s is %s", node_name, status ); } --- 255,259 ---- dlm_notify_deliver(-1, temp_addr, name, state, haDLM_state_null); ! dlm_log( LOG_INFO, "node %s is %s", node_name, status ); } *************** *** 338,342 **** } ! syslog( LOG_DEBUG, "Got a message of type [%s] from [%s]\n", type, orig ); --- 338,342 ---- } ! dlm_log( LOG_DEBUG, "Got a message of type [%s] from [%s]\n", type, orig ); *************** *** 351,355 **** } ! syslog( LOG_INFO, "%s terminating", __FUNCTION__); return( NULL ); } --- 351,355 ---- } ! dlm_log( LOG_INFO, "%s terminating", __FUNCTION__); return( NULL ); } *************** *** 370,374 **** if ( !clust && ((clust = ll_cluster_new( "heartbeat" )) == NULL)) { ! fprintf(stderr, "Init try %d, cannot allocate Heartbeat cluster handle\n", init_tries); --- 370,374 ---- if ( !clust && ((clust = ll_cluster_new( "heartbeat" )) == NULL)) { ! dlm_log(LOG_ERR, "Init try %d, cannot allocate Heartbeat cluster handle\n", init_tries); *************** *** 378,385 **** if ((err = clust->llc_ops->signon( clust, NULL )) != HA_OK) { ! fprintf(stderr, "Init try %d, cannot signon to Heartbeat cluster handle\n", init_tries); ! fprintf(stderr, "Reason is: %s\n", clust->llc_ops->errmsg(clust)); } /* else success, we are done, break */ --- 378,385 ---- if ((err = clust->llc_ops->signon( clust, NULL )) != HA_OK) { ! dlm_log(LOG_ERR, "Init try %d, cannot signon to Heartbeat cluster handle\n", init_tries); ! dlm_log(LOG_ERR, "Reason is: %s\n", clust->llc_ops->errmsg(clust)); } /* else success, we are done, break */ Index: dlm_iiquorumd.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/user/common/dlm_iiquorumd.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dlm_iiquorumd.c 14 Mar 2005 20:33:21 -0000 1.3 --- dlm_iiquorumd.c 3 Jun 2005 19:27:16 -0000 1.4 *************** *** 40,47 **** #include <assert.h> #include <sys/utsname.h> - #include <sys/syslog.h> #include <unistd.h> #include <pthread.h> #include <signal.h> #include "dlm_devmsg.h" /* Messages to dlm */ --- 40,47 ---- #include <assert.h> #include <sys/utsname.h> #include <unistd.h> #include <pthread.h> #include <signal.h> + #include <dlm_log.h> #include "dlm_devmsg.h" /* Messages to dlm */ *************** *** 86,95 **** listening_thread = pthread_self(); ! printf("2nd thread, pid/tid [%d/%ld]\n", getpid(), listening_thread); /* initialize the cluster */ rc = init_clust(); if ( rc != 0) { ! fprintf(stderr, "Cannot connect to iiquorumd !\n"); return(NULL); } --- 86,95 ---- listening_thread = pthread_self(); ! dlm_log(LOG_INFO, "2nd thread, pid/tid [%d/%ld]\n", getpid(), listening_thread); /* initialize the cluster */ rc = init_clust(); if ( rc != 0) { ! dlm_log(LOG_ERR, "Cannot connect to iiquorumd !\n"); return(NULL); } *************** *** 98,102 **** rc = uname(&uts_info); if (0 != rc) { ! fprintf(stderr, "Error on uname, %d [%s]\n", errno, strerror(errno)); assert(!"cannot get node info from uname"); } --- 98,102 ---- rc = uname(&uts_info); if (0 != rc) { ! dlm_log(LOG_ERR, "Error on uname, %d [%s]\n", errno, strerror(errno)); assert(!"cannot get node info from uname"); } *************** *** 119,123 **** void *cluster_interface_shutdown(void) { - if (0 != listening_thread) { need_to_quit = 1; --- 119,122 ---- *************** *** 141,184 **** void *cluster_interface_ack(void) { - int rc; - haDLM_state_t state; QD_REQUEST query; - QO_RESPONSE msg; ! printf("cluster_interface_ack: ACK'D!!\n"); messageQDCleanupAck(&query); messageSend(&query); ! /* iiquorumd can still monitor the cluster through the disk ! * so it will not evict everyone from the cluster. However, the ! * DLM has already flushed everything internally, let us re-synch ! * up with the cluster manager by doing a nodewalk again. ! */ ! /* query the status of nodes in the cluster */ ! messageQDQueryNodesInit(&query); ! messageSend( &query ); ! ! do ! { ! if ((rc = messageReceive(&msg)) <= 0) ! { ! assert(!"could not re-walk the iiquorumd cluster manager" ); ! } ! ! /* grab the state of the node */ ! if ( msg.qni.status == QUORUM_NODE_UP ) state = haDLM_state_up; ! else if( msg.qni.status == QUORUM_NODE_DOWN ) state = haDLM_state_down; ! else state = haDLM_state_null; ! ! /* send message */ ! /* if we are here then the DLM already knows who the local node ! * is and we don't need to parse for haDLM_state_local ! */ ! /* dlm does not handle 0 for a node id very well */ ! dlm_notify_deliver(msg.qni.node+1, msg.qni.addr, msg.qni.name, state, ! haDLM_state_null); ! } ! /* break on the last node */ ! while(msg.qni.node != 0); return(NULL); } --- 140,150 ---- void *cluster_interface_ack(void) { QD_REQUEST query; ! dlm_log(LOG_INFO, "cluster_interface_ack: ACK'D!!\n"); messageQDCleanupAck(&query); messageSend(&query); ! return(NULL); } *************** *** 197,201 **** QD_REQUEST query; QO_RESPONSE msg; ! struct in_addr temp_addr={0}; /* query the status of nodes in the cluster */ --- 163,168 ---- QD_REQUEST query; QO_RESPONSE msg; ! struct in_addr temp_addr={-1}; ! int local_nodeid=-1; /* query the status of nodes in the cluster */ *************** *** 207,211 **** if ((rc = messageReceive(&msg)) <= 0) { ! printf("error on messageReceive, bailing '%s'\n", strerror(errno)); goto fail; } --- 174,179 ---- if ((rc = messageReceive(&msg)) <= 0) { ! dlm_log(LOG_ERR, "error on messageReceive, bailing '%s'\n", ! strerror(errno)); goto fail; } *************** *** 216,221 **** else state = haDLM_state_null; ! if (!strcmp(msg.qni.name, local_name)) local = haDLM_state_local; ! else local = haDLM_state_null; /* send message */ --- 184,196 ---- else state = haDLM_state_null; ! if (!strcmp(msg.qni.name, local_name)) ! { ! local = haDLM_state_local; ! local_nodeid = msg.qni.node; ! } ! else ! { ! local = haDLM_state_null; ! } /* send message */ *************** *** 239,243 **** if ((rc = messageReceive(&msg)) <= 0) { ! printf("error on messageReceive, bailing '%s'\n", strerror(errno)); goto fail; } --- 214,219 ---- if ((rc = messageReceive(&msg)) <= 0) { ! dlm_log(LOG_ERR, "error on messageReceive, bailing '%s'\n", ! strerror(errno)); goto fail; } *************** *** 260,264 **** fail: /* time to go, send local node down event */ ! dlm_notify_deliver( -1, temp_addr, local_name, haDLM_state_down, haDLM_state_local); --- 236,240 ---- fail: /* time to go, send local node down event */ ! dlm_notify_deliver( local_nodeid+1, temp_addr, local_name, haDLM_state_down, haDLM_state_local); Index: dlm_localhost_cluster.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/user/common/dlm_localhost_cluster.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dlm_localhost_cluster.c 22 Apr 2005 21:26:51 -0000 1.1 --- dlm_localhost_cluster.c 3 Jun 2005 19:27:16 -0000 1.2 *************** *** 41,47 **** #include <errno.h> #include <assert.h> - #include <sys/syslog.h> #include <unistd.h> #include <signal.h> #include "dlm_devmsg.h" /* Messages to dlm */ --- 41,47 ---- #include <errno.h> #include <assert.h> #include <unistd.h> #include <signal.h> + #include <dlm_log.h> #include "dlm_devmsg.h" /* Messages to dlm */ *************** *** 77,83 **** struct in_addr localhost_in_addr = {INADDR_LOOPBACK}; ! printf("localhost Cluster Manager - "); if (configured_nodes->dlm_node_count != 1) { ! printf("ERROR /etc/haDLM node count != 1\n"); return NULL; } --- 77,83 ---- struct in_addr localhost_in_addr = {INADDR_LOOPBACK}; ! dlm_log(LOG_INFO, "localhost Cluster Manager - "); if (configured_nodes->dlm_node_count != 1) { ! dlm_log(LOG_ERR, "ERROR /etc/haDLM node count != 1\n"); return NULL; } *************** *** 85,89 **** node_name = configured_nodes->dlm_node_entries[0].dlm_node_name; ! printf("%s\n", node_name); dlm_notify_deliver(-1, localhost_in_addr, node_name, --- 85,89 ---- node_name = configured_nodes->dlm_node_entries[0].dlm_node_name; ! dlm_log(LOG_INFO, "%s\n", node_name); dlm_notify_deliver(-1, localhost_in_addr, node_name, Index: dlm_rsct.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/user/common/dlm_rsct.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** dlm_rsct.c 27 Sep 2002 11:52:43 -0000 1.1.1.1 --- dlm_rsct.c 3 Jun 2005 19:27:16 -0000 1.2 *************** *** 168,171 **** --- 168,172 ---- #include <sys/types.h> #include <sys/stat.h> + #include <dlm_log.h> #include <ha_gs.h> /* GSAPI info */ *************** *** 250,254 **** if (HA_GS_OK != rc) { ! fprintf(stderr, "Error on RSCT init [%d]\n", rc); --- 251,255 ---- if (HA_GS_OK != rc) { ! dlm_log(LOG_ERR, "Error on RSCT init [%d]\n", rc); *************** *** 263,271 **** if (-1 == rc) { ! fprintf(stderr, "Cannot find local node info!\n"); return(NULL); } else { ! fprintf(stderr, "Local node is [%d]\n", our_node); --- 264,272 ---- if (-1 == rc) { ! dlm_log(LOG_ERR, "Cannot find local node info!\n"); return(NULL); } else { ! dlm_log(LOG_ERR, "Local node is [%d]\n", our_node); *************** *** 281,285 **** if (HA_GS_OK != rc) { ! fprintf(stderr, "Error on Host subscription [%d]\n", rc); --- 282,286 ---- if (HA_GS_OK != rc) { ! dlm_log(LOG_ERR, "Error on Host subscription [%d]\n", rc); *************** *** 297,301 **** if (HA_GS_OK != rc) { ! fprintf(stderr, "Error on Enet subscription [%d]\n", rc); --- 298,302 ---- if (HA_GS_OK != rc) { ! dlm_log(LOG_ERR, "Error on Enet subscription [%d]\n", rc); *************** *** 312,316 **** if (HA_GS_OK != rc) { ! fprintf(stderr, "Error in dispatch [%d]\n", rc); --- 313,317 ---- if (HA_GS_OK != rc) { ! dlm_log(LOG_ERR, "Error in dispatch [%d]\n", rc); *************** *** 338,342 **** rc = ha_gs_quit(); ! fprintf(stderr, "Issued RSCT quit, return code [%d]\n", rc); --- 339,343 ---- rc = ha_gs_quit(); ! dlm_log(LOG_ERR, "Issued RSCT quit, return code [%d]\n", rc); *************** *** 369,378 **** if (HA_GS_OK == rc) { ! fprintf(stderr, "Connected to group services, socket fd [%d]\n", gs_filedes); break; } else if (HA_GS_EXISTS == rc) { ! fprintf(stderr, "You have already initialized! Why do it again?"); rc = HA_GS_OK; --- 370,379 ---- if (HA_GS_OK == rc) { ! dlm_log(LOG_ERR, "Connected to group services, socket fd [%d]\n", gs_filedes); break; } else if (HA_GS_EXISTS == rc) { ! dlm_log(LOG_ERR, "You have already initialized! Why do it again?"); rc = HA_GS_OK; *************** *** 385,389 **** sleep(10); } else { ! fprintf(stderr, "Fatal error trying to init group services [%d]\n", rc); --- 386,390 ---- sleep(10); } else { ! dlm_log(LOG_ERR, "Fatal error trying to init group services [%d]\n", rc); *************** *** 408,412 **** if (HA_GS_OK != rc) { ! fprintf(stderr, "Cannot get local node number, error [%d]\n", rc); --- 409,413 ---- if (HA_GS_OK != rc) { ! dlm_log(LOG_ERR, "Cannot get local node number, error [%d]\n", rc); *************** *** 417,421 **** node = (dlm_node_t *)malloc(sizeof(dlm_node_t)); if (NULL == node) { ! fprintf(stderr, "Cannot allocate local node block!\n"); return(-1); --- 418,422 ---- node = (dlm_node_t *)malloc(sizeof(dlm_node_t)); if (NULL == node) { ! dlm_log(LOG_ERR, "Cannot allocate local node block!\n"); return(-1); *************** *** 458,462 **** &proposal); ! fprintf(stderr, "Subscribe to group [%s] rc [%d] token [%d]\n", proposal.gs_subscribe_request.gs_subscription_group, --- 459,463 ---- &proposal); ! dlm_log(LOG_INFO, "Subscribe to group [%s] rc [%d] token [%d]\n", proposal.gs_subscribe_request.gs_subscription_group, *************** *** 494,498 **** if (HA_GS_OK != rc) { ! fprintf(stderr, "Error on Host subscription [%d]\n", rc); --- 495,499 ---- if (HA_GS_OK != rc) { ! dlm_log(LOG_ERR, "Error on Host subscription [%d]\n", rc); *************** *** 513,517 **** if (HA_GS_OK != rc) { ! fprintf(stderr, "Error on enet subscription [%d]\n", rc); --- 514,518 ---- if (HA_GS_OK != rc) { ! dlm_log(LOG_ERR, "Error on enet subscription [%d]\n", rc); *************** *** 544,548 **** if (0 == count) { ! fprintf(stderr, "HostMbr callback, but no nodes included?\n"); return; --- 545,549 ---- if (0 == count) { ! dlm_log(LOG_ERR, "HostMbr callback, but no nodes included?\n"); return; *************** *** 558,562 **** node = (dlm_node_t *)malloc(sizeof(dlm_node_t)); if (NULL == node) { ! fprintf(stderr, "Cannot allocate local node block!\n"); exit(65); --- 559,563 ---- node = (dlm_node_t *)malloc(sizeof(dlm_node_t)); if (NULL == node) { ! dlm_log(LOG_ERR, "Cannot allocate local node block!\n"); exit(65); *************** *** 607,611 **** ha_gs_callback_rc_t responsive_cb(const ha_gs_responsiveness_notification_t *note) { ! fprintf(stderr, "Responsiveness check, we are ok\n"); --- 608,612 ---- ha_gs_callback_rc_t responsive_cb(const ha_gs_responsiveness_notification_t *note) { ! dlm_log(LOG_ERR, "Responsiveness check, we are ok\n"); |
|
From: <cao...@us...> - 2005-06-03 19:27:25
|
Update of /cvsroot/opendlm/opendlm/rpm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27790/rpm Modified Files: dlm.spec.in Log Message: daemonizing changes and version info changes Index: dlm.spec.in =================================================================== RCS file: /cvsroot/opendlm/opendlm/rpm/dlm.spec.in,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dlm.spec.in 29 Mar 2005 16:49:40 -0000 1.2 --- dlm.spec.in 3 Jun 2005 19:27:14 -0000 1.3 *************** *** 58,65 **** ########################################################### ! # Run haDLM on startup ! cp %{_prefix}/sbin/haDLM /etc/init.d ! chmod 755 /etc/init.d if [ ! -f /etc/haDLM.conf ] --- 58,65 ---- ########################################################### ! # make sure the symbols are included in the kernel ! /sbin/depmod -ae ! # Run haDLM on startup if [ ! -f /etc/haDLM.conf ] |
|
From: <cao...@us...> - 2005-06-03 19:27:25
|
Update of /cvsroot/opendlm/opendlm/src/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27790/src/include Modified Files: Makefile.am dlm_list.h dlm_version.h Log Message: daemonizing changes and version info changes Index: Makefile.am =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/include/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.am 20 May 2004 20:55:32 -0000 1.3 --- Makefile.am 3 Jun 2005 19:27:15 -0000 1.4 *************** *** 8,12 **** clm_migrate.h clm_reconfig.h clm_tune.h clmstructs.h cltrc.h dlm.h \ dlm_cluster.h dlm_devmsg.h dlm_kernel.h dlm_list.h dlm_version.h \ ! iterator.h print.h pti.h incdir = $(includedir)/$(PACKAGE) --- 8,12 ---- clm_migrate.h clm_reconfig.h clm_tune.h clmstructs.h cltrc.h dlm.h \ dlm_cluster.h dlm_devmsg.h dlm_kernel.h dlm_list.h dlm_version.h \ ! iterator.h print.h pti.h dlm_assert.h dlm_log.h dlm_module.h incdir = $(includedir)/$(PACKAGE) Index: dlm_list.h =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/include/dlm_list.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** dlm_list.h 25 May 2005 16:25:18 -0000 1.6 --- dlm_list.h 3 Jun 2005 19:27:15 -0000 1.7 *************** *** 70,74 **** // DLM_ASSERT must also be enabled globally in dlm_assert.h // comment this out to disable assertions in dlm_list ! //#define USE_DLM_ASSERTIONS /**************************************************************** --- 70,74 ---- // DLM_ASSERT must also be enabled globally in dlm_assert.h // comment this out to disable assertions in dlm_list ! #define USE_DLM_ASSERTIONS /**************************************************************** *************** *** 268,292 **** #endif // defined(__linux__) && defined(__KERNEL__) - /**************************************************************** - * a routine to exercise the list code - * add whatever you want here, but leave the list intact and - * effectively unmodified when you are done - * Automatically enabled when DLM_LIST_ASSERTIONS are turned on - ****************************************************************/ - static inline void - dlm_exercise_list(dlm_list_t * list) { - #ifdef DLM_LIST_ASSERTIONS - dlm_list_t test_list; - dlm_list_t test_node; - dlm_list_init(&test_list); - dlm_list_append(&test_list, list); // also performs init on list - dlm_list_add_head(&test_list, &test_node); - dlm_list_remove(&test_node); - dlm_list_add_tail(&test_list, &test_node); - dlm_list_remove(&test_node); - dlm_list_append(list, &test_list); - #endif - } - static inline void dlm_listnode_init(void * node) { --- 268,271 ---- *************** *** 304,308 **** dlm_list_get_head(dlm_list_t * list) { ASSERT_VALID_DLM_LIST(list); - dlm_exercise_list(list); return dlm_list_is_empty(list) ? NULL : list->next; } --- 283,286 ---- *************** *** 311,315 **** dlm_list_get_tail(dlm_list_t * list) { ASSERT_VALID_DLM_LIST(list); - dlm_exercise_list(list); return dlm_list_is_empty(list) ? NULL : list->prev; } --- 289,292 ---- *************** *** 319,323 **** dlm_listnode_t * node; ASSERT_VALID_DLM_LIST(list); - dlm_exercise_list(list); node = dlm_list_get_head(list); if (node != NULL) --- 296,299 ---- *************** *** 329,333 **** dlm_list_insert(dlm_list_t * list, void * node, void * pred ) { ASSERT_VALID_DLM_LIST(list); - dlm_exercise_list(list); if (! pred) pred = list; --- 305,308 ---- *************** *** 339,343 **** dlm_listnode_t * n = node; ASSERT_VALID_DLM_LIST(list); - dlm_exercise_list(list); if (IS_DLM_LISTNODE_QUEUED(n)) { dlm_listnode_t * i; --- 314,317 ---- *************** *** 356,360 **** dlm_listnode_t * n = node; ASSERT_DLM_LIST_HAS_NODE(list, node); - dlm_exercise_list(list); return (n->next != list) ? n->next : NULL; } --- 330,333 ---- *************** *** 364,368 **** dlm_listnode_t * n = node; ASSERT_DLM_LIST_HAS_NODE(list, node); - dlm_exercise_list(list); return (n->prev != list) ? n->prev : NULL; } --- 337,340 ---- *************** *** 373,378 **** unsigned count = 0; ASSERT_VALID_DLM_LIST(list); ! dlm_exercise_list(list); ! for (EACH_DLM_LISTNODE(list, node)) ++count; return count; --- 345,349 ---- unsigned count = 0; ASSERT_VALID_DLM_LIST(list); ! for (node = list->next; node != list; node = node->next) ++count; return count; Index: dlm_version.h =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/include/dlm_version.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dlm_version.h 3 Mar 2005 19:58:09 -0000 1.5 --- dlm_version.h 3 Jun 2005 19:27:15 -0000 1.6 *************** *** 37,64 **** /* - | Lock manager version numbers. These version numbers are embedded - | in the messages notifying the lock manager of lock manager state - | changes. - */ - #define DLM_MAJOR_VERSION 0 - #define DLM_MINOR_VERSION 4 - - /* * Migration protocol */ #define MPROTO_VERSION 1 - /* - * Current version - */ - #define DLM_00000001VERSION ((DLM_MAJOR_VERSION << 16) | \ - (DLM_MINOR_VERSION & 0xffff)) - - #define DLM_FIRST_VERSION DLM_00000001VERSION - - #define DLM_CurVERSION DLM_00000001VERSION - /* version of *this* copy of the software */ ! #define DLM_VERSION DLM_CurVERSION #endif /* DLM_VERSION_H */ --- 37,48 ---- /* * Migration protocol */ #define MPROTO_VERSION 1 /* version of *this* copy of the software */ ! #define DLM_VERSION ( (DLM_MAJOR_VERSION << 16) \ ! + (DLM_MINOR_VERSION << 8) \ ! + (DLM_PATCH_VERSION) ) #endif /* DLM_VERSION_H */ |
|
From: <cao...@us...> - 2005-06-03 19:27:24
|
Update of /cvsroot/opendlm/opendlm/src/kernel/dlmcccp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27790/src/kernel/dlmcccp Modified Files: Makefile.in cccp_pkt.h cccp_proto.c Log Message: daemonizing changes and version info changes Index: Makefile.in =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/Makefile.in,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.in 25 May 2005 16:25:18 -0000 1.3 --- Makefile.in 3 Jun 2005 19:27:15 -0000 1.4 *************** *** 306,310 **** ifeq ($(NEW_KBUILD), y) #the 2.6 kernel build stuff ! EXTRA_CFLAGS += -I$(src)/../../include -I$(src)/../../.. -DDBPRINT -DDEBUG obj-m += cccp.o --- 306,310 ---- ifeq ($(NEW_KBUILD), y) #the 2.6 kernel build stuff ! EXTRA_CFLAGS += -I$(src)/../../include -I$(src)/../../.. -DDBPRINT obj-m += cccp.o Index: cccp_pkt.h =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/cccp_pkt.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cccp_pkt.h 20 May 2004 20:55:32 -0000 1.2 --- cccp_pkt.h 3 Jun 2005 19:27:15 -0000 1.3 *************** *** 68,72 **** __u16 cp_srcnode; ! long cp_session; ulong cp_acks; ulong cp_type; --- 68,72 ---- __u16 cp_srcnode; ! ulong cp_session; ulong cp_acks; ulong cp_type; Index: cccp_proto.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/cccp_proto.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** cccp_proto.c 25 May 2005 16:25:19 -0000 1.19 --- cccp_proto.c 3 Jun 2005 19:27:15 -0000 1.20 *************** *** 103,108 **** u_int32_t redirs; /* mask of redirected inbound channels*/ unsigned nodeid; /* node id destination node */ ! long session; /* session id of latest connection */ ! long in_session; /* most recent session id read */ long ack_time; /* used to delay empty acks to node */ int ack_mask; /* used to keep tracking of queued acks*/ --- 103,108 ---- u_int32_t redirs; /* mask of redirected inbound channels*/ unsigned nodeid; /* node id destination node */ ! ulong session; /* session id of latest connection */ ! ulong in_session; /* most recent session id read */ long ack_time; /* used to delay empty acks to node */ int ack_mask; /* used to keep tracking of queued acks*/ *************** *** 304,308 **** if (node->nodeid != thisNode()) offset += snprintf( & buf[ offset ], limit - offset, ! "%4d %8ld %6ld %8d %8u %7ld %7ld %08lx %08lx\n", node->nodeid, node->session, node->retries, countQueue( & node->queue ), --- 304,308 ---- if (node->nodeid != thisNode()) offset += snprintf( & buf[ offset ], limit - offset, ! "%4d %8lu %6ld %8d %8u %7ld %7ld %08lx %08lx\n", node->nodeid, node->session, node->retries, countQueue( & node->queue ), *************** *** 625,629 **** --- 625,634 ---- for(i=0; i<nodeList.num_nodes; i++) + { CLM_FREE(nodeList.nodes[i]); + nodeList.nodes[i] = NULL; + } + + nodeList.num_nodes = 0; } *************** *** 1278,1282 **** { /* check for new session id */ ! if ( pkt->cp_session > node->in_session ) { #if defined(SHOW_SESSIONS) --- 1283,1290 ---- { /* check for new session id */ ! /* FIXME deal with wrapping */ ! if ( (pkt->cp_session > node->in_session) || ! ((pkt->cp_session < 100) && ! (pkt->cp_session < node->in_session+100)) ) { #if defined(SHOW_SESSIONS) |
|
From: <mig...@us...> - 2005-05-25 16:25:59
|
Update of /cvsroot/opendlm/opendlm/src/kernel/dlmcccp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13449/src/kernel/dlmcccp Modified Files: Makefile.in cccp_deliver.c cccp_init.c cccp_input.c cccp_kernel.c cccp_msg.c cccp_output.c cccp_ports.c cccp_private.h cccp_proto.c cccp_queue.c cccp_udp.c Log Message: merge with debug-dbprintf-branch * unified logging under dlm_dbprintf * removal of unnecessary linux .h includes * introduction of dlm_module.h to consolidate linux module includes Index: Makefile.in =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/Makefile.in,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.in 29 Mar 2005 16:49:57 -0000 1.2 --- Makefile.in 25 May 2005 16:25:18 -0000 1.3 *************** *** 306,310 **** ifeq ($(NEW_KBUILD), y) #the 2.6 kernel build stuff ! EXTRA_CFLAGS += -I$(src)/../../include -I$(src)/../../.. -DDBPRINT obj-m += cccp.o --- 306,310 ---- ifeq ($(NEW_KBUILD), y) #the 2.6 kernel build stuff ! EXTRA_CFLAGS += -I$(src)/../../include -I$(src)/../../.. -DDBPRINT -DDEBUG obj-m += cccp.o Index: cccp_deliver.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/cccp_deliver.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** cccp_deliver.c 14 Mar 2005 20:33:15 -0000 1.11 --- cccp_deliver.c 25 May 2005 16:25:18 -0000 1.12 *************** *** 37,55 **** #include "config.h" #if defined( __KERNEL__ ) - # ifndef MODULE - # define MODULE - # endif ! # include <linux/kernel.h> ! # define __NO_VERSION__ ! # include <linux/module.h> ! # ifdef USING_FULL_VERSIONING ! # if CONFIG_MODVERSIONS==1 ! # define MODVERSIONS ! # include <linux/modversions.h> ! # endif ! # endif /* USING_FULL_VERSIONING */ #else --- 37,45 ---- #include "config.h" + #include "dlm_log.h" #if defined( __KERNEL__ ) ! #include "dlm_module.h" #else *************** *** 124,128 **** while ( !msg_done && (msg->cm_node == self) ) { #ifdef MASSIVE_DEBUG ! bsdlog( LOG_DEBUG, "[%s:%s] in msg delivery loop\n", PROCESS_NAME, __FUNCTION__ ); #endif --- 114,118 ---- while ( !msg_done && (msg->cm_node == self) ) { #ifdef MASSIVE_DEBUG ! dlm_dbprintf(DBG_CCCP, "[%s:%s] in msg delivery loop\n", PROCESS_NAME, __FUNCTION__ ); #endif *************** *** 157,161 **** { msg_done = TRUE; ! bsdlog( LOG_WARNING, "[%s:%s] NULL receive callback for port %u", PROCESS_NAME, __FUNCTION__, msg->cm_port ); --- 147,151 ---- { msg_done = TRUE; ! dlm_dbprintf(DBG_CCCP, "[%s:%s] NULL receive callback for port %u", PROCESS_NAME, __FUNCTION__, msg->cm_port ); *************** *** 194,198 **** action[1] = msg_to_deliver->cm_action[1]; ! bsdlog( LOG_DEBUG, "[%s:%s] preparing to process message from node %d at port %d\n", PROCESS_NAME, __FUNCTION__, --- 184,188 ---- action[1] = msg_to_deliver->cm_action[1]; ! dlm_dbprintf(DBG_CCCP, "[%s:%s] preparing to process message from node %d at port %d\n", PROCESS_NAME, __FUNCTION__, *************** *** 202,206 **** msg_to_deliver = NULL; ! bsdlog( LOG_DEBUG, "[%s:%s] message locally forwarded\n", PROCESS_NAME, __FUNCTION__ ); --- 192,196 ---- msg_to_deliver = NULL; ! dlm_dbprintf(DBG_CCCP, "[%s:%s] message locally forwarded\n", PROCESS_NAME, __FUNCTION__ ); *************** *** 218,222 **** else { ! bsdlog( LOG_DEBUG, "[%s:%s] redirect/remote send requested\n", PROCESS_NAME, __FUNCTION__ ); --- 208,212 ---- else { ! dlm_dbprintf(DBG_CCCP, "[%s:%s] redirect/remote send requested\n", PROCESS_NAME, __FUNCTION__ ); *************** *** 253,257 **** /* Deliver the messages */ if (!cccp_deliver_all_from_port() ) ! bsdlog( LOG_WARNING, "[%s:%s] False event for no message!\n", PROCESS_NAME, __FUNCTION__ ); } --- 243,247 ---- /* Deliver the messages */ if (!cccp_deliver_all_from_port() ) ! dlm_dbprintf(DBG_CCCP, "[%s:%s] False event for no message!\n", PROCESS_NAME, __FUNCTION__ ); } *************** *** 277,281 **** printk("cccp_msg_delivery_loop: has over 100 post_die_messages\n"); ! bsdlog( LOG_INFO, "%s termination, CCCP shutdown.", __FUNCTION__ ); #ifdef __KERNEL__ #ifdef __linux__ --- 267,271 ---- printk("cccp_msg_delivery_loop: has over 100 post_die_messages\n"); ! dlm_log(LOG_INFO, "%s termination, CCCP shutdown.", __FUNCTION__ ); #ifdef __KERNEL__ #ifdef __linux__ Index: cccp_init.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/cccp_init.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** cccp_init.c 14 Mar 2005 20:33:15 -0000 1.12 --- cccp_init.c 25 May 2005 16:25:18 -0000 1.13 *************** *** 39,55 **** #include "config.h" #if defined( __KERNEL__ ) ! # ifndef MODULE ! # define MODULE ! # endif ! # include <linux/kernel.h> ! # include <linux/module.h> ! # ifdef USING_FULL_VERSIONING ! # if CONFIG_MODVERSIONS==1 ! # define MODVERSIONS ! # include <linux/modversions.h> ! # endif ! # endif /* USING_FULL_VERSIONING */ # include <linux/init.h> --- 39,48 ---- #include "config.h" + #include "dlm_log.h" #if defined( __KERNEL__ ) ! ! #define MODULE_DEFINITION_FILE ! #include "dlm_module.h" # include <linux/init.h> *************** *** 143,147 **** cccp_minimal_init( void ) { ! bsdlog( LOG_INFO, "%s started", __FUNCTION__ ); cccp_our_id = -1 ; initPorts() ; --- 136,140 ---- cccp_minimal_init( void ) { ! dlm_log(LOG_INFO, "%s started", __FUNCTION__ ); cccp_our_id = -1 ; initPorts() ; *************** *** 169,173 **** if (cccp_msg_cache == NULL) { ! bsdlog( LOG_CRIT, "[%s:%s] Could not create cache!\n", PROCESS_NAME, __FUNCTION__ ); --- 162,166 ---- if (cccp_msg_cache == NULL) { ! dlm_log(LOG_CRIT, "[%s:%s] Could not create cache!\n", PROCESS_NAME, __FUNCTION__ ); *************** *** 210,214 **** } ! bsdlog( LOG_INFO, "[%s:%s]\n", PROCESS_NAME, __FUNCTION__); --- 203,207 ---- } ! dlm_log(LOG_INFO, "[%s:%s]\n", PROCESS_NAME, __FUNCTION__); *************** *** 229,233 **** status = cccp_ip_init(); ! bsdlog( LOG_DEBUG, "cccp_ip_init status = %d\n", status ); CCCP_ASSERT( status == CPERR_OK, --- 222,226 ---- status = cccp_ip_init(); ! dlm_dbprintf(DBG_CCCP, "cccp_ip_init status = %d\n", status ); CCCP_ASSERT( status == CPERR_OK, *************** *** 340,344 **** if ( err < 0 ) { ! bsdlog( LOG_CRIT, "[%s:%s] Unable to kill CCCP poll thread " "(pid=%u), error = %u\n", PROCESS_NAME, __FUNCTION__, cccp_poll_thread, -err ); --- 333,337 ---- if ( err < 0 ) { ! dlm_log(LOG_CRIT, "[%s:%s] Unable to kill CCCP poll thread " "(pid=%u), error = %u\n", PROCESS_NAME, __FUNCTION__, cccp_poll_thread, -err ); Index: cccp_input.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/cccp_input.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** cccp_input.c 22 Apr 2005 21:26:49 -0000 1.4 --- cccp_input.c 25 May 2005 16:25:18 -0000 1.5 *************** *** 31,49 **** #include "config.h" #if defined( __KERNEL__ ) - # ifndef MODULE - # define MODULE - # endif ! # include <linux/kernel.h> ! # define __NO_VERSION__ ! # include <linux/module.h> ! # ifdef USING_FULL_VERSIONING ! # if CONFIG_MODVERSIONS==1 ! # define MODVERSIONS ! # include <linux/modversions.h> ! # endif ! # endif /* USING_FULL_VERSIONING */ #endif /* __KERNEL__ */ --- 31,40 ---- #include "config.h" + #include "dlm_log.h" #if defined( __KERNEL__ ) ! #include "dlm_module.h" ! #endif /* __KERNEL__ */ *************** *** 105,109 **** if ( pkt->cp_version != CCCP_VERSION ) { ! bsdlog( LOG_WARNING, "[%s:%s] packet with invalid version (%d) " "received from node %u\n", PROCESS_NAME, __FUNCTION__, --- 96,100 ---- if ( pkt->cp_version != CCCP_VERSION ) { ! dlm_log(LOG_WARNING, "[%s:%s] packet with invalid version (%d) " "received from node %u\n", PROCESS_NAME, __FUNCTION__, *************** *** 168,172 **** { #if defined( SHOW_ORDERING ) ! bsdlog( LOG_DEBUG, "dropping packet frm %d - already " "redirected slot=%d\n", pkt->cp_srcnode, pkt->cp_channel); --- 159,163 ---- { #if defined( SHOW_ORDERING ) ! dlm_dbprintf(DBG_CCCP, "dropping packet frm %d - already " "redirected slot=%d\n", pkt->cp_srcnode, pkt->cp_channel); *************** *** 178,182 **** { #if defined( SHOW_ORDERING ) ! bsdlog( LOG_DEBUG, "msg out of order from %u on channel %u\n", pkt->cp_srcnode, pkt->cp_channel ); #endif --- 169,173 ---- { #if defined( SHOW_ORDERING ) ! dlm_dbprintf(DBG_CCCP, "msg out of order from %u on channel %u\n", pkt->cp_srcnode, pkt->cp_channel ); #endif *************** *** 216,220 **** msg->cm_sender = node; ! bsdlog( LOG_DEBUG, "[%s:%s] delivering message\n", PROCESS_NAME, __FUNCTION__ ); --- 207,211 ---- msg->cm_sender = node; ! dlm_dbprintf(DBG_CCCP, "[%s:%s] delivering message\n", PROCESS_NAME, __FUNCTION__ ); *************** *** 243,247 **** ! bsdlog( LOG_DEBUG, "[%s:%s] leaving (%s,%s)\n", PROCESS_NAME, __FUNCTION__, status ? "true" : "false", text_msg ); --- 234,238 ---- ! dlm_dbprintf(DBG_CCCP, "[%s:%s] leaving (%s,%s)\n", PROCESS_NAME, __FUNCTION__, status ? "true" : "false", text_msg ); Index: cccp_kernel.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/cccp_kernel.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** cccp_kernel.c 3 Mar 2005 19:58:09 -0000 1.4 --- cccp_kernel.c 25 May 2005 16:25:18 -0000 1.5 *************** *** 40,58 **** #include "config.h" #if defined( __KERNEL__ ) - # ifndef MODULE - # define MODULE - # endif ! # include <linux/kernel.h> ! # define __NO_VERSION__ ! # include <linux/module.h> ! # ifdef USING_FULL_VERSIONING ! # if CONFIG_MODVERSIONS==1 ! # define MODVERSIONS ! # include <linux/modversions.h> ! # endif ! # endif /* USING_FULL_VERSIONING */ # include <linux/stddef.h> --- 40,48 ---- #include "config.h" + #include "dlm_log.h" #if defined( __KERNEL__ ) ! #include "dlm_module.h" # include <linux/stddef.h> *************** *** 171,175 **** cccp_timer_expires = expires & INT_MAX; mod_timer( &cccp_timer , cccp_timer_expires); - bsdlog( LOG_DEBUG, "+" ); } --- 161,164 ---- *************** *** 220,224 **** #if defined( __KERNEL__ ) del_timer_sync(&cccp_timer); - bsdlog( LOG_DEBUG, "D" ); #endif } --- 209,212 ---- Index: cccp_msg.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/cccp_msg.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** cccp_msg.c 26 Oct 2004 20:28:11 -0000 1.4 --- cccp_msg.c 25 May 2005 16:25:18 -0000 1.5 *************** *** 36,54 **** #include "config.h" #if defined( __KERNEL__ ) - # ifndef MODULE - # define MODULE - # endif ! # include <linux/kernel.h> ! # define __NO_VERSION__ ! # include <linux/module.h> ! # ifdef USING_FULL_VERSIONING ! # if CONFIG_MODVERSIONS==1 ! # define MODVERSIONS ! # include <linux/modversions.h> ! # endif ! # endif /* USING_FULL_VERSIONING */ #else --- 36,44 ---- #include "config.h" + #include "dlm_log.h" #if defined( __KERNEL__ ) ! #include "dlm_module.h" #else Index: cccp_output.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/cccp_output.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** cccp_output.c 14 Mar 2005 20:33:15 -0000 1.4 --- cccp_output.c 25 May 2005 16:25:18 -0000 1.5 *************** *** 34,52 **** #include "config.h" #if defined( __KERNEL__ ) - # ifndef MODULE - # define MODULE - # endif ! # include <linux/kernel.h> ! # define __NO_VERSION__ ! # include <linux/module.h> ! # ifdef USING_FULL_VERSIONING ! # if CONFIG_MODVERSIONS==1 ! # define MODVERSIONS ! # include <linux/modversions.h> ! # endif ! # endif /* USING_FULL_VERSIONING */ #endif /* __KERNEL__ */ --- 34,43 ---- #include "config.h" + #include "dlm_log.h" #if defined( __KERNEL__ ) ! #include "dlm_module.h" ! #endif /* __KERNEL__ */ *************** *** 112,116 **** int status; ! bsdlog( LOG_DEBUG, "[%s:%s] enter, msg[%p] node[%d] port[%d]\n", PROCESS_NAME, __FUNCTION__, msg, msg->cm_node, msg->cm_port ); --- 103,107 ---- int status; ! dlm_dbprintf(DBG_CCCP, "[%s:%s] enter, msg[%p] node[%d] port[%d]\n", PROCESS_NAME, __FUNCTION__, msg, msg->cm_node, msg->cm_port ); *************** *** 120,124 **** status = cccp_send_guts(msg); ! bsdlog( LOG_DEBUG, "[%s:%s] exit, msg[%p] status[%d]\n", PROCESS_NAME, __FUNCTION__, msg, status ); --- 111,115 ---- status = cccp_send_guts(msg); ! dlm_dbprintf(DBG_CCCP, "[%s:%s] exit, msg[%p] status[%d]\n", PROCESS_NAME, __FUNCTION__, msg, status ); Index: cccp_ports.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/cccp_ports.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** cccp_ports.c 5 May 2005 18:55:02 -0000 1.9 --- cccp_ports.c 25 May 2005 16:25:18 -0000 1.10 *************** *** 41,59 **** #include "config.h" #if defined( __KERNEL__ ) - # ifndef MODULE - # define MODULE - # endif ! # include <linux/kernel.h> ! # define __NO_VERSION__ ! # include <linux/module.h> ! # ifdef USING_FULL_VERSIONING ! # if CONFIG_MODVERSIONS==1 ! # define MODVERSIONS ! # include <linux/modversions.h> ! # endif ! # endif /* USING_FULL_VERSIONING */ #else --- 41,49 ---- #include "config.h" + #include "dlm_log.h" #if defined( __KERNEL__ ) ! #include "dlm_module.h" #else *************** *** 200,204 **** { ! bsdlog(LOG_DEBUG, "[%s:%s] Qeue the message from node %d for delivering at port %d\n", PROCESS_NAME, __FUNCTION__ ,msg->cm_sender,msg->cm_port); --- 190,194 ---- { ! dlm_dbprintf(DBG_CCCP, "[%s:%s] Qeue the message from node %d for delivering at port %d\n", PROCESS_NAME, __FUNCTION__ ,msg->cm_sender,msg->cm_port); *************** *** 229,233 **** if( msg ) { ! bsdlog(LOG_DEBUG, "[%s:%s] Deqeue the message from node %d for " "delivery\n", /* at port %d\n",*/ --- 219,223 ---- if( msg ) { ! dlm_dbprintf(DBG_CCCP, "[%s:%s] Deqeue the message from node %d for " "delivery\n", /* at port %d\n",*/ Index: cccp_private.h =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/cccp_private.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** cccp_private.h 6 May 2005 12:34:19 -0000 1.13 --- cccp_private.h 25 May 2005 16:25:18 -0000 1.14 *************** *** 51,68 **** #endif - /* syslog.h causes lots of warnings and conflicts when compiling for the 2.6 - * kernel. The only values needed from that file are the ones below. This - * should be good enough for now, until we remove the whole bsdlog interface - * and replace it with the more appropriate printk values -DCZ - */ - #define LOG_EMERG 0 /* system is unusable */ - #define LOG_ALERT 1 /* action must be taken immediately */ - #define LOG_CRIT 2 /* critical conditions */ - #define LOG_ERR 3 /* error conditions */ - #define LOG_WARNING 4 /* warning conditions */ - #define LOG_NOTICE 5 /* normal but significant condition */ - #define LOG_INFO 6 /* informational */ - #define LOG_DEBUG 7 /* debug-level messages */ - #include <cccp.h> #include <dlm_cluster.h> --- 51,54 ---- *************** *** 90,94 **** # define NO_ELSE(msg) \ else { \ ! bsdlog(LOG_ERR,"WARNING: %s, file %s, line %d\n", \ (msg), __FILE__, __LINE__); \ } --- 76,80 ---- # define NO_ELSE(msg) \ else { \ ! dlm_log(LOG_ERR,"WARNING: %s, file %s, line %d\n", \ (msg), __FILE__, __LINE__); \ } *************** *** 312,316 **** # define LOG_PACKET(P) \ ! bsdlog( LOG_DEBUG, "[%s:%s] %u->%u, port/slot/flag = %u/%u/%02x, " \ "ACKs = 0x%08lx\n", \ PROCESS_NAME, __FUNCTION__, \ --- 298,302 ---- # define LOG_PACKET(P) \ ! dlm_dbprintf(DBG_CCCP, "[%s:%s] %u->%u, port/slot/flag = %u/%u/%02x, " \ "ACKs = 0x%08lx\n", \ PROCESS_NAME, __FUNCTION__, \ Index: cccp_proto.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/cccp_proto.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** cccp_proto.c 6 May 2005 12:34:20 -0000 1.18 --- cccp_proto.c 25 May 2005 16:25:19 -0000 1.19 *************** *** 59,77 **** #include "config.h" #if defined( __KERNEL__ ) - # ifndef MODULE - # define MODULE - # endif ! # include <linux/kernel.h> ! # define __NO_VERSION__ ! # include <linux/module.h> ! # ifdef USING_FULL_VERSIONING ! # if CONFIG_MODVERSIONS==1 ! # define MODVERSIONS ! # include <linux/modversions.h> ! # endif ! # endif /* USING_FULL_VERSIONING */ #else --- 59,67 ---- #include "config.h" + #include "dlm_log.h" #if defined( __KERNEL__ ) ! #include "dlm_module.h" #else *************** *** 97,114 **** /* seconds (actually, one-second boundaries) to wait before retransmitting*/ - /* do note these timeout values have associated bsdlog messages with them - * that look rather funny (they are single characters). The point here - * was to debug the internals of opendlm by how often it was passing - * messages. Believe or not, there are bottlenecks shown as a result of - * this type of debugging, which is why the bsdlog are still here. However - * time has not permitted to track these bottlenecks to the source. The - * labeling convention for the logs are as follows: capital letters for major - * sections (S,N,Q,W), lower case and numbers for sub sections (a,1,2,3) and - * colons for various paths within a major section (.,:). The main 4 paths - * are (S)endPacket, send(N)ack, (Q)ueueAck and retransmit_loop(W). I would - * love to turn this debugging on individually without the bsdlog of every other - * cccp section, but the cccp logging facilities are not as nice as dlm and - * clm. -dcz - */ #define CCCP_TIMEOUT_RECVACK (2 * CCCP_HZ) #define CCCP_TIMEOUT_SENDACK (1 * CCCP_HZ) --- 87,90 ---- *************** *** 170,174 **** #if defined( SHOW_RETRANS ) # define LOG_RETRANS(s, i, n ) \ ! bsdlog( LOG_DEBUG, "%s %d to node %d next = %d", (s), \ (i), (n)->nodeid, (i < 16) ? (n)->nextmsgslot : \ (n)->nextredirslot ) --- 146,150 ---- #if defined( SHOW_RETRANS ) # define LOG_RETRANS(s, i, n ) \ ! dlm_dbprintf(DBG_CCCP, "%s %d to node %d next = %d", (s), \ (i), (n)->nodeid, (i < 16) ? (n)->nextmsgslot : \ (n)->nextredirslot ) *************** *** 254,258 **** #ifdef MASSIVE_DEBUG ! bsdlog( LOG_DEBUG, "[%s:%s] node_id[%d] idx [%d] this node[%d] \n", PROCESS_NAME, __FUNCTION__, node_id, idx, thisNode() ); --- 230,234 ---- #ifdef MASSIVE_DEBUG ! dlm_dbprintf(DBG_CCCP, "[%s:%s] node_id[%d] idx [%d] this node[%d] \n", PROCESS_NAME, __FUNCTION__, node_id, idx, thisNode() ); *************** *** 375,379 **** #ifdef DEBUG ! bsdlog( LOG_DEBUG, "[%s:%s] Updating read session for %u to %lu \n", PROCESS_NAME, __FUNCTION__, --- 351,355 ---- #ifdef DEBUG ! dlm_dbprintf(DBG_CCCP, "[%s:%s] Updating read session for %u to %lu \n", PROCESS_NAME, __FUNCTION__, *************** *** 390,394 **** #ifdef DEBUG ! bsdlog(LOG_DEBUG, "Init new node struct for %d\n", nodeid); #endif --- 366,370 ---- #ifdef DEBUG ! dlm_dbprintf(DBG_CCCP, "Init new node struct for %d\n", nodeid); #endif *************** *** 441,445 **** if (nodeList.sock != NULL) { ! bsdlog(LOG_INFO, "Send socket already created\n"); return( 0 ); } --- 417,421 ---- if (nodeList.sock != NULL) { ! dlm_log(LOG_INFO, "Send socket already created\n"); return( 0 ); } *************** *** 448,452 **** CCCP_SOCK_CREATE( sock, status ); if ( status < 0 ) { ! bsdlog(LOG_CRIT, "Unable to obtain new send socket\n"); return( status ); } --- 424,428 ---- CCCP_SOCK_CREATE( sock, status ); if ( status < 0 ) { ! dlm_log(LOG_CRIT, "Unable to obtain new send socket\n"); return( status ); } *************** *** 461,465 **** if ( status < 0 ) { ! bsdlog( LOG_CRIT, "%s failed sock 0x%08lx bind for send socket, errno %u", __FUNCTION__, (unsigned long) *sock, -status ); --- 437,441 ---- if ( status < 0 ) { ! dlm_log(LOG_CRIT, "%s failed sock 0x%08lx bind for send socket, errno %u", __FUNCTION__, (unsigned long) *sock, -status ); *************** *** 469,473 **** } ! bsdlog(LOG_DEBUG, "binded to send socket\n"); /* everything's OK*/ --- 445,449 ---- } ! dlm_dbprintf(DBG_CCCP, "binded to send socket\n"); /* everything's OK*/ *************** *** 500,504 **** TRCHKL2T(CPTRC_SNDCB_INVOKE,msg,acktype); ! bsdlog( LOG_DEBUG, "[%s:%s] calling message callback " "@ 0x%08lx( 0x%08lx, %d )\n", PROCESS_NAME, __FUNCTION__, --- 476,480 ---- TRCHKL2T(CPTRC_SNDCB_INVOKE,msg,acktype); ! dlm_dbprintf(DBG_CCCP, "[%s:%s] calling message callback " "@ 0x%08lx( 0x%08lx, %d )\n", PROCESS_NAME, __FUNCTION__, *************** *** 593,597 **** int index; ! bsdlog( LOG_INFO, "[%s:%s] id [%d] failed\n", PROCESS_NAME, __FUNCTION__, nodeid); --- 569,573 ---- int index; ! dlm_dbprintf(DBG_CCCP, "[%s:%s] id [%d] failed\n", PROCESS_NAME, __FUNCTION__, nodeid); *************** *** 677,681 **** if (nodeList.num_nodes >= MAXNODES) { ! bsdlog( LOG_CRIT, "[%s:%s] nodeid=%d has exceeded MAXNODES=%d\n", PROCESS_NAME, __FUNCTION__, nodeid, MAXNODES); goto done; --- 653,657 ---- if (nodeList.num_nodes >= MAXNODES) { ! dlm_log(LOG_CRIT, "[%s:%s] nodeid=%d has exceeded MAXNODES=%d\n", PROCESS_NAME, __FUNCTION__, nodeid, MAXNODES); goto done; *************** *** 686,690 **** if (ni == NULL) { ! bsdlog( LOG_CRIT, "[%s:%s] CLM_MALLOC failed for nodeid=%d\n", PROCESS_NAME, __FUNCTION__, nodeid); goto done; --- 662,666 ---- if (ni == NULL) { ! dlm_log(LOG_CRIT, "[%s:%s] CLM_MALLOC failed for nodeid=%d\n", PROCESS_NAME, __FUNCTION__, nodeid); goto done; *************** *** 697,701 **** if (nodeList.nodes[nodeList.num_nodes] != NULL) { ! bsdlog( LOG_CRIT, "[%s:%s] cccp nodeList is corrupted\n", PROCESS_NAME, __FUNCTION__); goto fail; --- 673,677 ---- if (nodeList.nodes[nodeList.num_nodes] != NULL) { ! dlm_log(LOG_CRIT, "[%s:%s] cccp nodeList is corrupted\n", PROCESS_NAME, __FUNCTION__); goto fail; *************** *** 709,713 **** if (ni->node_int == NULL) { ! bsdlog( LOG_CRIT, "[%s:%s] failed to create internal node struct\n", PROCESS_NAME, __FUNCTION__); goto fail; --- 685,689 ---- if (ni->node_int == NULL) { ! dlm_log(LOG_CRIT, "[%s:%s] failed to create internal node struct\n", PROCESS_NAME, __FUNCTION__); goto fail; *************** *** 780,784 **** if ( ! CCCP_SOCK_IS_VALID( nodeList.sock ) ) { ! bsdlog( LOG_WARNING, "[%s:%s] Send socket not enabled yet!!\n", PROCESS_NAME, __FUNCTION__ ); --- 756,760 ---- if ( ! CCCP_SOCK_IS_VALID( nodeList.sock ) ) { ! dlm_log(LOG_WARNING, "[%s:%s] Send socket not enabled yet!!\n", PROCESS_NAME, __FUNCTION__ ); *************** *** 832,836 **** iov[0].iov_base = & corrupt_pkt; ! bsdlog( LOG_DEBUG, "corrupting port in packet" ); } #endif /* STRESS */ --- 808,812 ---- iov[0].iov_base = & corrupt_pkt; ! dlm_log(LOG_DEBUG, "corrupting port in packet" ); } #endif /* STRESS */ *************** *** 839,843 **** if (status < 0) { ! bsdlog( LOG_ERR, "[%s:%s] failed sock 0x%08lx, errno %d", PROCESS_NAME, __FUNCTION__, (unsigned long) nodeList.sock, -status ); --- 815,819 ---- if (status < 0) { ! dlm_log(LOG_ERR, "[%s:%s] failed sock 0x%08lx, errno %d", PROCESS_NAME, __FUNCTION__, (unsigned long) nodeList.sock, -status ); *************** *** 845,849 **** ! bsdlog( LOG_DEBUG, "[%s:%s] returning %s\n", PROCESS_NAME, __FUNCTION__, (status >= 0) ? "success" : "failure" ); --- 821,825 ---- ! dlm_dbprintf(DBG_CCCP, "[%s:%s] returning %s\n", PROCESS_NAME, __FUNCTION__, (status >= 0) ? "success" : "failure" ); *************** *** 953,957 **** if ( ((slot ^ next_slot) & (SUBCHANNELS/2)) != 0 ) { ! bsdlog( LOG_CRIT, "[%s:%s] next_slot (%u) not valid for slot (%u)!\n", PROCESS_NAME, __FUNCTION__, next_slot, slot ); --- 929,933 ---- if ( ((slot ^ next_slot) & (SUBCHANNELS/2)) != 0 ) { ! dlm_log(LOG_CRIT, "[%s:%s] next_slot (%u) not valid for slot (%u)!\n", PROCESS_NAME, __FUNCTION__, next_slot, slot ); *************** *** 1007,1011 **** /* mark the slot as allocated*/ node->deadline[slot] = cccp_time() + CCCP_TIMEOUT_RECVACK; - bsdlog( LOG_DEBUG, "S" ); cccp_set_timer( CCCP_TIMEOUT_RECVACK ); --- 983,986 ---- *************** *** 1120,1124 **** if ( pp == NULL ) { ! bsdlog( LOG_ERR, "[%s:%s] ACK mask (0x%08lx) has ACK for " "slot %d, but there is no packet there!\n", PROCESS_NAME, __FUNCTION__, --- 1095,1099 ---- if ( pp == NULL ) { ! dlm_log(LOG_ERR, "[%s:%s] ACK mask (0x%08lx) has ACK for " "slot %d, but there is no packet there!\n", PROCESS_NAME, __FUNCTION__, *************** *** 1198,1202 **** if (acks != oldacks) { oldacks = acks; ! bsdlog( LOG_DEBUG, "[%s:%s] acks 0x%08x ^ 0x%08x = 0x%08x\n", PROCESS_NAME, __FUNCTION__, node->outcolor, acks, node->outcolor ^ acks ); --- 1173,1177 ---- if (acks != oldacks) { oldacks = acks; ! dlm_dbprintf(DBG_CCCP, "[%s:%s] acks 0x%08x ^ 0x%08x = 0x%08x\n", PROCESS_NAME, __FUNCTION__, node->outcolor, acks, node->outcolor ^ acks ); *************** *** 1242,1246 **** node->ask[chan] = 0; SETBIT(node->ack_mask, chan); - bsdlog( LOG_DEBUG, "Q" ); /* if msg or redir channels or all filled, send an ack immediately, because we are now a bottleneck */ --- 1217,1220 ---- *************** *** 1252,1256 **** " flag is not set" ); node->ack_time = cccp_time(); - bsdlog( LOG_DEBUG, "." ); cccp_set_timer( 0 ); } --- 1226,1229 ---- *************** *** 1264,1272 **** * messaging activity. */ - bsdlog( LOG_DEBUG, ":" ); cccp_set_timer( CCCP_TIMEOUT_SENDACK ); } ! bsdlog( LOG_DEBUG, "[%s:%s] new ACK mask for node %u: %08lx\n", PROCESS_NAME, __FUNCTION__, node->nodeid, (unsigned long) node->incolor ); --- 1237,1244 ---- * messaging activity. */ cccp_set_timer( CCCP_TIMEOUT_SENDACK ); } ! dlm_dbprintf(DBG_CCCP, "[%s:%s] new ACK mask for node %u: %08lx\n", PROCESS_NAME, __FUNCTION__, node->nodeid, (unsigned long) node->incolor ); *************** *** 1309,1313 **** { #if defined(SHOW_SESSIONS) ! bsdlog( LOG_DEBUG, "Read session from %ld to %ld for node %d\n", node->in_session, pkt->cp_session, node->nodeid ); #endif --- 1281,1285 ---- { #if defined(SHOW_SESSIONS) ! dlm_dbprintf(DBG_CCCP, "Read session from %ld to %ld for node %d\n", node->in_session, pkt->cp_session, node->nodeid ); #endif *************** *** 1318,1322 **** { /* this packet is from a dropped connection. See ya */ ! bsdlog( LOG_DEBUG, "drop - got %lu expect %lu from %d " "acks=0x%08lx f=%02x c=%d\n", pkt->cp_session, (node->in_session+1), --- 1290,1294 ---- { /* this packet is from a dropped connection. See ya */ ! dlm_dbprintf(DBG_CCCP, "drop - got %lu expect %lu from %d " "acks=0x%08lx f=%02x c=%d\n", pkt->cp_session, (node->in_session+1), *************** *** 1354,1358 **** #if defined(SHOW_RETRANS) ! bsdlog( LOG_DEBUG, "nackRetrans to %d nacks= 0x%08lx\n", node->nodeid, nacks ); #endif --- 1326,1330 ---- #if defined(SHOW_RETRANS) ! dlm_dbprintf(DBG_CCCP, "nackRetrans to %d nacks= 0x%08lx\n", node->nodeid, nacks ); #endif *************** *** 1398,1402 **** if ( pkt == NULL ) { ! bsdlog( LOG_ERR, "[%s:%s] NACK mask (0x%08lx) has NACK for " "slot %u, but there is no packet there!\n", PROCESS_NAME, __FUNCTION__, --- 1370,1374 ---- if ( pkt == NULL ) { ! dlm_log(LOG_ERR, "[%s:%s] NACK mask (0x%08lx) has NACK for " "slot %u, but there is no packet there!\n", PROCESS_NAME, __FUNCTION__, *************** *** 1432,1436 **** if ( ! message_logged && ! transmitPacket( node, pkt, udata ) ) { ! bsdlog( LOG_ERR, "%s: transmit to %d failed", __FUNCTION__, msg->cm_node ); message_logged = TRUE; --- 1404,1408 ---- if ( ! message_logged && ! transmitPacket( node, pkt, udata ) ) { ! dlm_log(LOG_ERR, "%s: transmit to %d failed", __FUNCTION__, msg->cm_node ); message_logged = TRUE; *************** *** 1452,1456 **** } - bsdlog( LOG_DEBUG, "N" ); cccp_set_timer( next_timeout ); } --- 1424,1427 ---- *************** *** 1550,1554 **** if ( ! message_logged && ! transmitPacket( node, pkt, udata ) ) { ! bsdlog( LOG_ERR, "%s: transmit to %d failed", __FUNCTION__, pkt->cp_node ); message_logged = TRUE; --- 1521,1525 ---- if ( ! message_logged && ! transmitPacket( node, pkt, udata ) ) { ! dlm_log(LOG_ERR, "%s: transmit to %d failed", __FUNCTION__, pkt->cp_node ); message_logged = TRUE; *************** *** 1566,1570 **** node->state |= NS_NEED2RECVACK; node->reset_time = now + CCCP_TIMEOUT_RESET; - bsdlog( LOG_DEBUG, "1" ); /* reset_time is not used below because it is a longer slower delay used to prevent endless looping of --- 1537,1540 ---- *************** *** 1579,1583 **** { next_timeout = (node->deadline[ slot ] - now); - bsdlog( LOG_DEBUG, "." ); } } --- 1549,1552 ---- *************** *** 1614,1622 **** ((now + CCCP_TIMEOUT_RESET) > node->reset_time) ) { ! bsdlog( LOG_DEBUG, "[%s:%s] Reset %d - stale", PROCESS_NAME, __FUNCTION__, node->nodeid ); node->reset_time = ULONG_MAX; - bsdlog( LOG_DEBUG, "3" ); return( CCCP_TIMEOUT_RESET ); } --- 1583,1590 ---- ((now + CCCP_TIMEOUT_RESET) > node->reset_time) ) { ! dlm_dbprintf(DBG_CCCP, "[%s:%s] Reset %d - stale", PROCESS_NAME, __FUNCTION__, node->nodeid ); node->reset_time = ULONG_MAX; return( CCCP_TIMEOUT_RESET ); } *************** *** 1637,1641 **** if ( status < 0 ) { ! bsdlog( LOG_ERR, "%s: write to %d failed, errno %d", __FUNCTION__, node->nodeid, -status ); return( CCCP_TIMEOUT_RESET ); --- 1605,1609 ---- if ( status < 0 ) { ! dlm_log(LOG_ERR, "%s: write to %d failed, errno %d", __FUNCTION__, node->nodeid, -status ); return( CCCP_TIMEOUT_RESET ); *************** *** 1646,1650 **** node->ack_time = ULONG_MAX; node->ack_mask = 0; - bsdlog( LOG_DEBUG, "a" ); } --- 1614,1617 ---- *************** *** 1653,1662 **** ((now + CCCP_TIMEOUT_RESET) > node->reset_time) ) { ! bsdlog( LOG_DEBUG, "[%s:%s] Need reset? %d - stale", PROCESS_NAME, __FUNCTION__, node->nodeid ); node->state |= NS_NEED2RESET; node->reset_time = now; - bsdlog( LOG_DEBUG, "2" ); /* the timeout value returned will come from below as receiving an ack is tied to retransmitting a packet */ --- 1620,1628 ---- ((now + CCCP_TIMEOUT_RESET) > node->reset_time) ) { ! dlm_dbprintf(DBG_CCCP, "[%s:%s] Need reset? %d - stale", PROCESS_NAME, __FUNCTION__, node->nodeid ); node->state |= NS_NEED2RESET; node->reset_time = now; /* the timeout value returned will come from below as receiving an ack is tied to retransmitting a packet */ *************** *** 1698,1702 **** { next_timeout = temp; - bsdlog( LOG_DEBUG, ":" ); } } --- 1664,1667 ---- *************** *** 1787,1791 **** if ( chan >= SUBCHANNELS ) { ! bsdlog( LOG_ERR, "Invalid subchannel (%u) for redirect", chan ); return; } --- 1752,1756 ---- if ( chan >= SUBCHANNELS ) { ! dlm_log(LOG_ERR, "Invalid subchannel (%u) for redirect", chan ); return; } *************** *** 1800,1804 **** if ( pkt == NULL ) { ! bsdlog( LOG_ERR, "Redirect received for idle subchannel (%u)", chan ); CCCP_ASSERT( msg == NULL, "non-NULL msg pointer" ); return; --- 1765,1769 ---- if ( pkt == NULL ) { ! dlm_log(LOG_ERR, "Redirect received for idle subchannel (%u)", chan ); CCCP_ASSERT( msg == NULL, "non-NULL msg pointer" ); return; *************** *** 1807,1811 **** if ( (pkt->cp_flags & CPF_MSG_PRESENT) == 0 ) { ! bsdlog( LOG_ERR, "Redirect received on subchannel (%u) for internal " "packet", chan ); return; --- 1772,1776 ---- if ( (pkt->cp_flags & CPF_MSG_PRESENT) == 0 ) { ! dlm_log(LOG_ERR, "Redirect received on subchannel (%u) for internal " "packet", chan ); return; *************** *** 1968,1972 **** #if defined(SHOW_NACKS) ! bsdlog( LOG_DEBUG, "[%s:%s] Send NACK to node %d for %d to %d -> " "0x%08lx\n", PROCESS_NAME, __FUNCTION__, node->nodeid, ofirst, ogot, *ackptr ); --- 1933,1937 ---- #if defined(SHOW_NACKS) ! dlm_dbprintf(DBG_CCCP, "[%s:%s] Send NACK to node %d for %d to %d -> " "0x%08lx\n", PROCESS_NAME, __FUNCTION__, node->nodeid, ofirst, ogot, *ackptr ); *************** *** 1983,1987 **** if ( status < 0 ) { ! bsdlog( LOG_ERR, "[%s:%s] could not send NACKs to node %u, " "errno %d\n", PROCESS_NAME, __FUNCTION__, --- 1948,1952 ---- if ( status < 0 ) { ! dlm_log(LOG_ERR, "[%s:%s] could not send NACKs to node %u, " "errno %d\n", PROCESS_NAME, __FUNCTION__, *************** *** 2079,2083 **** #if defined( SHOW_ORDERING ) ! #define ORDERING_LOG(s) bsdlog( LOG_DEBUG, s " - read %d frm %d exp %d\n", \ chan, node->nodeid, node->readmsgslot ); #else --- 2044,2048 ---- #if defined( SHOW_ORDERING ) ! #define ORDERING_LOG(s) dlm_dbprintf(DBG_CCCP, s " - read %d frm %d exp %d\n", \ chan, node->nodeid, node->readmsgslot ); #else *************** *** 2170,2174 **** if ( is_dup ) { ! bsdlog( LOG_DEBUG, "[%s:%s] msg is dup: %u != %u on slot %u, " "incolor = 0x%08lx\n", PROCESS_NAME, __FUNCTION__, --- 2135,2139 ---- if ( is_dup ) { ! dlm_dbprintf(DBG_CCCP, "[%s:%s] msg is dup: %u != %u on slot %u, " "incolor = 0x%08lx\n", PROCESS_NAME, __FUNCTION__, Index: cccp_queue.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/cccp_queue.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** cccp_queue.c 5 May 2005 18:55:02 -0000 1.3 --- cccp_queue.c 25 May 2005 16:25:19 -0000 1.4 *************** *** 56,72 **** #if defined( __KERNEL__ ) - # ifndef MODULE - # define MODULE - # endif ! # include <linux/kernel.h> ! # define __NO_VERSION__ ! # include <linux/module.h> ! # ifdef USING_FULL_VERSIONING ! # if CONFIG_MODVERSIONS==1 ! # define MODVERSIONS ! # include <linux/modversions.h> ! # endif ! # endif /* USING_FULL_VERSIONING */ #else --- 56,61 ---- #if defined( __KERNEL__ ) ! #include "dlm_module.h" #else Index: cccp_udp.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmcccp/cccp_udp.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** cccp_udp.c 14 Mar 2005 20:33:16 -0000 1.13 --- cccp_udp.c 25 May 2005 16:25:19 -0000 1.14 *************** *** 40,58 **** #include "config.h" #if defined( __KERNEL__ ) - # ifndef MODULE - # define MODULE - # endif ! # include <linux/kernel.h> ! # define __NO_VERSION__ ! # include <linux/module.h> ! # ifdef USING_FULL_VERSIONING ! # if CONFIG_MODVERSIONS==1 ! # define MODVERSIONS ! # include <linux/modversions.h> ! # endif ! # endif /* USING_FULL_VERSIONING */ # include <linux/sched.h> --- 40,48 ---- #include "config.h" + #include "dlm_log.h" #if defined( __KERNEL__ ) ! #include "dlm_module.h" # include <linux/sched.h> *************** *** 129,133 **** if ( err < 0 ) { ! bsdlog( LOG_ERR, "%s: unable to create server socket", __FUNCTION__ ); return(CPERR_NOSOCKET); } --- 119,123 ---- if ( err < 0 ) { ! dlm_log(LOG_ERR, "%s: unable to create server socket", __FUNCTION__ ); return(CPERR_NOSOCKET); } *************** *** 140,144 **** if ( err < 0 ) { ! bsdlog( LOG_ERR, "%s: unable to bind to server socket, err = %u", __FUNCTION__, -err ); --- 130,134 ---- if ( err < 0 ) { ! dlm_log(LOG_ERR, "%s: unable to bind to server socket, err = %u", __FUNCTION__, -err ); *************** *** 204,208 **** { ! bsdlog( LOG_ERR, "Error %d on socket read\n", -bytes ); } --- 194,198 ---- { ! dlm_log(LOG_ERR, "Error %d on socket read\n", -bytes ); } *************** *** 233,237 **** && (pkt->cp_flags & (CPF_MSG_PRESENT | CPF_REDIR_VALID)) ) { ! bsdlog( LOG_WARNING, "Message received for port 0 " "(from node %u).\n", id ); return( NULL ); --- 223,227 ---- && (pkt->cp_flags & (CPF_MSG_PRESENT | CPF_REDIR_VALID)) ) { ! dlm_log(LOG_WARNING, "Message received for port 0 " "(from node %u).\n", id ); return( NULL ); *************** *** 241,245 **** SUGGEST((id != thisNode()),"received packet from ourself"); #if defined(SHOW_CONNECTIONS) ! bsdlog( LOG_DEBUG, "[%s:%s] %d.%d.%d.%d:%d,%s reachable," " size = %u/%lu, type = %08lx\n", PROCESS_NAME, __FUNCTION__, --- 231,235 ---- SUGGEST((id != thisNode()),"received packet from ourself"); #if defined(SHOW_CONNECTIONS) ! dlm_dbprintf(DBG_CCCP, "[%s:%s] %d.%d.%d.%d:%d,%s reachable," " size = %u/%lu, type = %08lx\n", PROCESS_NAME, __FUNCTION__, *************** *** 262,266 **** if ((random() % 1000) < 7) { ! bsdlog( LOG_DEBUG,"DROPPING PACKET, flags = 0x%08x\n", pkt->cp_flags ); return( NULL ); --- 252,256 ---- if ((random() % 1000) < 7) { ! dlm_log(LOG_DEBUG,"DROPPING PACKET, flags = 0x%08x\n", pkt->cp_flags ); return( NULL ); *************** *** 278,282 **** else { ! bsdlog( LOG_WARNING, "Message body size mis-match. Got %u," "but expected %u (from node %u).", --- 268,272 ---- else { ! dlm_log(LOG_WARNING, "Message body size mis-match. Got %u," "but expected %u (from node %u).", *************** *** 289,293 **** else { ! bsdlog( LOG_DEBUG, "[%s:%s] dropping msg from %u" " (not connected)\n", PROCESS_NAME, __FUNCTION__, id ); --- 279,283 ---- else { ! dlm_log(LOG_DEBUG, "[%s:%s] dropping msg from %u" " (not connected)\n", PROCESS_NAME, __FUNCTION__, id ); *************** *** 295,299 **** #endif ! bsdlog( LOG_DEBUG, "[%s:%s] returning after receving message" " from node %d\n", --- 285,289 ---- #endif ! dlm_dbprintf(DBG_CCCP, "[%s:%s] returning after receving message" " from node %d\n", *************** *** 398,402 **** cccp_our_sock = CCCP_SOCK_INVALID; ! bsdlog( LOG_INFO, "%s termination, CCCP shutdown\n", __FUNCTION__ ); #ifdef __KERNEL__ #ifdef __linux__ --- 388,392 ---- cccp_our_sock = CCCP_SOCK_INVALID; ! dlm_log(LOG_INFO, "%s termination, CCCP shutdown\n", __FUNCTION__ ); #ifdef __KERNEL__ #ifdef __linux__ *************** *** 426,430 **** cccp_poll_timer_handler( unsigned long timer ) { - // bsdlog( LOG_DEBUG, "-" ); (void) CCCP_SEM_UP( & cccp_poll_sem ); } --- 416,419 ---- *************** *** 460,464 **** /* handle ack timeouts*/ next_timeout = doAckTimeouts(); - bsdlog( LOG_DEBUG, "W" ); cccp_set_timer( next_timeout ); --- 449,452 ---- *************** *** 468,472 **** if ( next_timeout < 4 ) { ! bsdlog( LOG_DEBUG, "next_timeout = %lu", next_timeout ); } #endif --- 456,460 ---- if ( next_timeout < 4 ) { ! dlm_dbprintf(DBG_CCCP, "next_timeout = %lu", next_timeout ); } #endif *************** *** 475,479 **** /* cleanup timer */ cccp_timer_release(); ! bsdlog( LOG_INFO, "%s termination, CCCP shutdown.", __FUNCTION__ ); #ifdef __KERNEL__ #ifdef __linux__ --- 463,467 ---- /* cleanup timer */ cccp_timer_release(); ! dlm_log(LOG_INFO, "%s termination, CCCP shutdown.", __FUNCTION__ ); #ifdef __KERNEL__ #ifdef __linux__ |
Update of /cvsroot/opendlm/opendlm/src/api In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13449/src/api Modified Files: api_ais_lock.c api_glue.c api_group.c api_init.c api_purge.c api_scn.c api_tune.c api_vms.c print.c Log Message: merge with debug-dbprintf-branch * unified logging under dlm_dbprintf * removal of unnecessary linux .h includes * introduction of dlm_module.h to consolidate linux module includes Index: api_ais_lock.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_ais_lock.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** api_ais_lock.c 5 May 2005 18:55:01 -0000 1.5 --- api_ais_lock.c 25 May 2005 16:25:17 -0000 1.6 *************** *** 18,30 **** #include "pti.h" - #ifdef HAVING_NLS_ON_LINUX - /* for NLS */ - #include "general_msg.h" - #define MSGSTR(Num, Str) catgets((struct _catalog_descriptor*)get_catd("general.cat"), GENERAL, Num, Str) - #else /* HAVING_NLS_ON_LINUX */ - #define MSGSTR(Num, Str) Str - #endif /* HAVING_NLS_ON_LINUX */ - /* end of NLS */ - #include "api_ais_lock.h" --- 18,21 ---- *************** *** 604,608 **** if (response.clm_status == DLM_WORKING) { ! printf(MSGSTR(DLM_WORKING, "DLM_WORKING_TER returned from API call!!\n")); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); --- 595,599 ---- if (response.clm_status == DLM_WORKING) { ! printf("DLM_WORKING_TER returned from API call!!\n"); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); Index: api_glue.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_glue.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** api_glue.c 5 May 2005 18:55:01 -0000 1.6 --- api_glue.c 25 May 2005 16:25:17 -0000 1.7 *************** *** 60,74 **** #include "api_data.h" - #ifdef HAVING_NLS_ON_LINUX - /* for NLS */ - #include "general_msg.h" - #define MSGSTR(Num, Str) catgets(get_catd("general.cat"), GENERAL, Num, Str) - #else /* HAVING_NLS_ON_LINUX */ - #define MSGSTR(Num, Str) Str - #endif /* HAVING_NLS_ON_LINUX */ - /* end of NLS */ - - /* ============================================================ */ - #ifndef __KERNEL__ /* --- 60,63 ---- *************** *** 420,426 **** * DBG_BASIC, DBG_FUNC, DBG_STATS, DBG_COMM, DBG_DEADLOCK, DBG_CTI * DBG_CLMLOCK, DBG_UNIXLOCK, DBG_LOCK, DBG_RESOURCE,DBG_DYNRES, ! * DBG_BATCH,DBG_TIMEOUT,DBG_NETFAIL,DBG_CONFIG,DBG_SCN,DBG_DIRECT, * DBG_MIGR,DBG_MIGR2, DBG_RECOV,DBG_TUNE,DBG_SYNC,DBG_LOCAL ! * DBG_KDBX, DBG_FAILSYNC, DBG_AST defined in include/clmstructs.h * Return value: * Value returned from ioctl. --- 409,415 ---- * DBG_BASIC, DBG_FUNC, DBG_STATS, DBG_COMM, DBG_DEADLOCK, DBG_CTI * DBG_CLMLOCK, DBG_UNIXLOCK, DBG_LOCK, DBG_RESOURCE,DBG_DYNRES, ! * DBG_BATCH,DBG_TIMEOUT,DBG_CCCP,DBG_CONFIG,DBG_SCN,DBG_DIRECT, * DBG_MIGR,DBG_MIGR2, DBG_RECOV,DBG_TUNE,DBG_SYNC,DBG_LOCAL ! * DBG_KDBX, DBG_unused, DBG_AST defined in include/clmstructs.h * Return value: * Value returned from ioctl. Index: api_group.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_group.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** api_group.c 27 Sep 2002 11:52:42 -0000 1.1.1.1 --- api_group.c 25 May 2005 16:25:17 -0000 1.2 *************** *** 65,76 **** #include "pti.h" - #ifdef HAVING_NLS_ON_LINUX - /* for NLS */ - #include "general_msg.h" - #define MSGSTR(Num, Str) catgets(get_catd("general.cat"), GENERAL, Num, Str) - #else /* HAVING_NLS_ON_LINUX */ - #define MSGSTR(Num, Str) Str - #endif /* HAVING_NLS_ON_LINUX */ - /* end of NLS */ #endif /* __KERNEL__ */ --- 65,68 ---- Index: api_init.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_init.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** api_init.c 5 May 2005 18:55:01 -0000 1.9 --- api_init.c 25 May 2005 16:25:17 -0000 1.10 *************** *** 40,43 **** --- 40,44 ---- #include "config.h" + #include "dlm_log.h" #ifdef __KERNEL__ *************** *** 84,96 **** #include "clmutex_r.h" - #ifdef HAVING_NLS_ON_LINUX - /* for NLS */ - #include "general_msg.h" - #define MSGSTR(Num, Str) catgets((struct _catalog_descriptor*)get_catd("general.cat"), GENERAL, Num, Str) - #else /* HAVING_NLS_ON_LINUX */ - #define MSGSTR(Num, Str) Str - #endif /* HAVING_NLS_ON_LINUX */ - /* end of NLS */ - #include "api_data.h" #include "api_glue.h" --- 85,88 ---- *************** *** 175,179 **** rc = kmem_cache_destroy( dlm_keventd_cache ); if (rc) { ! bsdlog(LOG_ERR, "[KAPI:%s] kmem_cache_destroy of dlm_keventd_cache failed\n", __FUNCTION__); --- 167,171 ---- rc = kmem_cache_destroy( dlm_keventd_cache ); if (rc) { ! dlm_log(LOG_ERR, "[KAPI:%s] kmem_cache_destroy of dlm_keventd_cache failed\n", __FUNCTION__); *************** *** 372,377 **** } if (response->clm_sequence != seq) { ! fprintf(stderr, MSGSTR(TRANS_MISMATCH, ! "Transaction mismatch detected in API\n")); return -1; } --- 364,368 ---- } if (response->clm_sequence != seq) { ! fprintf(stderr, "Transaction mismatch detected in API\n"); return -1; } *************** *** 440,445 **** if (response->clm_sequence != seq) { ! fprint_error( MSGSTR(TRANS_MISMATCH, ! "Transaction mismatch detected in API\n")); return -1; } --- 431,435 ---- if (response->clm_sequence != seq) { ! fprint_error("Transaction mismatch detected in API\n"); return -1; } Index: api_purge.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_purge.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** api_purge.c 1 Apr 2004 16:52:53 -0000 1.2 --- api_purge.c 25 May 2005 16:25:17 -0000 1.3 *************** *** 29,33 **** * COMPONENT_NAME: DLM LIB * ! * FUNCTIONS: MSGSTR * clm_purge */ --- 29,33 ---- * COMPONENT_NAME: DLM LIB * ! * FUNCTIONS: * clm_purge */ *************** *** 68,80 **** #include "pti.h" - #ifdef HAVING_NLS_ON_LINUX - /* for NLS */ - #include "general_msg.h" - #define MSGSTR(Num, Str) catgets(get_catd("general.cat"), GENERAL, Num, Str) - #else /* HAVING_NLS_ON_LINUX */ - #define MSGSTR(Num, Str) Str - #endif /* HAVING_NLS_ON_LINUX */ - /* end of NLS */ - #include "api_data.h" #include "api_init.h" --- 68,71 ---- Index: api_scn.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_scn.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** api_scn.c 27 Sep 2002 11:52:42 -0000 1.1.1.1 --- api_scn.c 25 May 2005 16:25:17 -0000 1.2 *************** *** 47,59 **** #include "pti.h" - #ifdef HAVING_NLS_ON_LINUX - /* for NLS */ - #include "general_msg.h" - #define MSGSTR(Num, Str) catgets((struct _catalog_descriptor*)get_catd("general.cat"), GENERAL, Num, Str) - #else /* HAVING_NLS_ON_LINUX */ - #define MSGSTR(Num, Str) Str - #endif /* HAVING_NLS_ON_LINUX */ - /* end of NLS */ - #include "api_data.h" #include "api_init.h" --- 47,50 ---- *************** *** 118,123 **** if (response.clm_status == DLM_WORKING) { ! printf(MSGSTR(DLM_WORKING, ! "DLM_WORKING_TER returned from API call!!\n")); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); --- 109,113 ---- if (response.clm_status == DLM_WORKING) { ! printf("DLM_WORKING_TER returned from API call!!\n"); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); Index: api_tune.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_tune.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** api_tune.c 27 Sep 2002 11:52:42 -0000 1.1.1.1 --- api_tune.c 25 May 2005 16:25:17 -0000 1.2 *************** *** 51,63 **** #include "pti.h" - #ifdef HAVING_NLS_ON_LINUX - /* for NLS */ - #include "general_msg.h" - #define MSGSTR(Num, Str) catgets((struct _catalog_descriptor*)get_catd("general.cat"), GENERAL, Num, Str) - #else /* HAVING_NLS_ON_LINUX */ - #define MSGSTR(Num, Str) Str - #endif /* HAVING_NLS_ON_LINUX */ - /* end of NLS */ - #include "api_data.h" #include "api_init.h" --- 51,54 ---- *************** *** 128,132 **** if (response.clm_status == DLM_WORKING) { ! printf(MSGSTR(DLM_WORKING, "DLM_WORKING_TER returned from API call!!\n")); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); --- 119,123 ---- if (response.clm_status == DLM_WORKING) { ! printf("DLM_WORKING_TER returned from API call!!\n"); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); *************** *** 224,228 **** if (response.clm_status == DLM_WORKING) { ! printf(MSGSTR(DLM_WORKING, "DLM_WORKING_TER returned from API call!!\n")); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); --- 215,219 ---- if (response.clm_status == DLM_WORKING) { ! printf("DLM_WORKING_TER returned from API call!!\n"); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); Index: api_vms.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_vms.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** api_vms.c 5 May 2005 18:55:01 -0000 1.10 --- api_vms.c 25 May 2005 16:25:17 -0000 1.11 *************** *** 76,89 **** #include "pti.h" - #ifdef HAVING_NLS_ON_LINUX - /* for NLS */ - #include "general_msg.h" - #define MSGSTR(Num, Str) catgets((struct _catalog_descriptor*)get_catd("general.cat"), GENERAL, Num, Str) - #else /* HAVING_NLS_ON_LINUX */ - #define MSGSTR(Num, Str) Str - #endif /* HAVING_NLS_ON_LINUX */ - /* end of NLS */ - - #include "api_data.h" #include "api_init.h" --- 76,79 ---- *************** *** 601,605 **** if (response.clm_status == DLM_WORKING) { ! printf(MSGSTR(DLM_WORKING, "DLM_WORKING_TER returned from API call!!\n")); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); --- 591,595 ---- if (response.clm_status == DLM_WORKING) { ! printf("DLM_WORKING_TER returned from API call!!\n"); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); Index: print.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/print.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** print.c 27 Sep 2002 11:52:42 -0000 1.1.1.1 --- print.c 25 May 2005 16:25:17 -0000 1.2 *************** *** 39,51 **** #include "dlm.h" - #ifdef HAVING_NLS_ON_LINUX - /* for NLS */ - #include "general_msg.h" - #define MSGSTR(Num, Str) catgets((struct _catalog_descriptor*)get_catd("general.cat"), GENERAL, Num, Str) - #else /* HAVING_NLS_ON_LINUX */ - #define MSGSTR(Num, Str) Str - #endif /* HAVING_NLS_ON_LINUX */ - /* end of NLS */ - /* ============================================================ */ --- 39,42 ---- *************** *** 60,66 **** static char buffer[50]; if (err < 0) { ! sprintf(buffer, ! MSGSTR(DLM_ERROR,"DLM Error %d\n"), ! err); return buffer; } --- 51,55 ---- static char buffer[50]; if (err < 0) { ! sprintf(buffer, "DLM Error %d\n", err); return buffer; } *************** *** 74,80 **** dlm_perror(const char *s) { ! fprintf(stderr, ! MSGSTR(ERROR_MSG,"%1$s: %2$s\n"), ! s, ! dlm_errmsg(dlm_errno)); } --- 63,66 ---- dlm_perror(const char *s) { ! fprintf(stderr, "%1$s: %2$s\n", s, dlm_errmsg(dlm_errno)); } |
|
From: <mig...@us...> - 2005-05-25 16:25:57
|
Update of /cvsroot/opendlm/opendlm/src/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13449/src/include Modified Files: cccp.h clmstructs.h dlm_kernel.h dlm_list.h Added Files: dlm_log.h dlm_module.h Log Message: merge with debug-dbprintf-branch * unified logging under dlm_dbprintf * removal of unnecessary linux .h includes * introduction of dlm_module.h to consolidate linux module includes Index: cccp.h =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/include/cccp.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** cccp.h 29 Mar 2005 16:49:56 -0000 1.9 --- cccp.h 25 May 2005 16:25:18 -0000 1.10 *************** *** 127,131 **** ; \ } else { \ ! bsdlog(LOG_CRIT,"ASSERT FAILED: %s: %s, file %s, line %d\n", \ (msg), __FUNCTION__, __FILE__, __LINE__); \ dlm_abort("ASSERT: " __FILE__ ", line " as_str(__LINE__)); \ --- 127,131 ---- ; \ } else { \ ! dlm_log(LOG_CRIT,"ASSERT FAILED: %s: %s, file %s, line %d\n", \ (msg), __FUNCTION__, __FILE__, __LINE__); \ dlm_abort("ASSERT: " __FILE__ ", line " as_str(__LINE__)); \ Index: clmstructs.h =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/include/clmstructs.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** clmstructs.h 6 May 2005 12:34:17 -0000 1.15 --- clmstructs.h 25 May 2005 16:25:18 -0000 1.16 *************** *** 29,33 **** * COMPONENT_NAME: DLM * ! * FUNCTIONS: DBPRINTF * getstamp * resptr --- 29,33 ---- * COMPONENT_NAME: DLM * ! * FUNCTIONS: dlm_dbprintf * getstamp * resptr *************** *** 133,177 **** #endif /* BOOL_T_DEFINED */ - /* debugging facilities */ - #define DBG_BASIC 0x1 /* basic debugging level */ - #define DBG_FUNC 0x2 /* function tracing */ - #define DBG_CTI 0x4 /* CTI tracing */ - #define DBG_PTI 0x8 /* PTI tracing */ - #define DBG_DEADLOCK 0x10 /* deadlock tracing */ - #define DBG_STATS 0x20 /* statistics tracing */ - #define DBG_CLMLOCK 0x40 /* CLM lock specific tracing */ - #define DBG_UNIXLOCK 0x80 /* UNIX lock specific tracing */ - #define DBG_COMM 0x100 /* communication layer info */ - #define DBG_RESOURCE 0x200 /* resource function tracing */ - #define DBG_LOCK 0x400 /* common locking facilities */ - #define DBG_FORCE 0x1000 /* output whenever debug is active */ - #define DBG_BATCH 0x2000 /* PTI batch tracing */ - #define DBG_AST 0x4000 /* AST tracing */ - #define DBG_TIMEOUT 0x8000 /* lock timeout tracing */ - #define DBG_DYNRES 0x10000 /* dynamic resource allocation tracing */ - #define DBG_NETFAIL 0x20000 /* client process id code */ - #define DBG_CONFIG 0x40000 /* message queue config code paths */ - #define DBG_SCN 0x80000 /* SCN functions */ - #define DBG_DIRECT 0x100000/* directory functions */ - #define DBG_MIGR 0x200000/* dynamic remastering */ - #define DBG_MIGR2 0x400000/* migration complete/resource location */ - #define DBG_RECOV 0x800000/* node failure recovery */ - #define DBG_TUNE 0x1000000/* migration tuning operation */ - #define DBG_GROUP 0x2000000/* group tuning operation */ - #define DBG_SYNC 0x4000000/* clmlock_sync call tracing */ - #define DBG_LOCAL 0x8000000/* local lock tracing */ - #define DBG_PURGE 0x10000000 /* client purge events */ - #define DBG_DOMAIN 0x20000000 /* recovery domain paths */ - #define DBG_FAILSYNC 0x40000000 /* clm_sync() paths */ - #define DBG_CLIENT 0x80000000 /* client process id code */ - - extern int dlm_debug; - /* dbprintf macro - all calls to dbprintf should have double ()'s */ - #ifdef DBPRINT - #define DBPRINTF(arg) if(dlm_debug) clm_dbprintf arg - #else - #define DBPRINTF(arg) - #endif /* DBPRINT */ - #ifdef __KERNEL__ /* all kernel clients use same dummy pid, so different kernel threads can --- 133,136 ---- *************** *** 608,612 **** \ for (i = 0; i < j; i++) \ ! bsdlog(LOG_NOTICE, "%s [%d] %d:%d", \ (req)->stats.file[i], \ (req)->stats.line[i], \ --- 567,571 ---- \ for (i = 0; i < j; i++) \ ! dlm_log(LOG_NOTICE, "%s [%d] %d:%d", \ (req)->stats.file[i], \ (req)->stats.line[i], \ *************** *** 979,994 **** } ; ! #ifndef HAVING_NLS_ON_LINUX ! /* ! * These are message identifiers that are used in messages all ! * over the place. Under a perfect system, they would be the ! * translated message catalogs, and these codes would be the ! * keys - through catopen/catgets to retrieve the message. ! * For now though, we merely want these to translate to a ! * value, any value, and let the other definitions take care ! * of things. ! */ ! /* $ Message for cllockd.c */ ! #define LOAD_KERNEL 1 /* "Loaded kernel extension.\n" */ #define LOAD_STARTUP 1 /* "Loaded startup code.\n" */ #define INTERNAL_ERR 1 /* "Internal error (could not find start_func).\n" */ --- 938,942 ---- } ; ! #define LOAD_STARTUP 1 /* "Loaded startup code.\n" */ #define INTERNAL_ERR 1 /* "Internal error (could not find start_func).\n" */ *************** *** 1008,1297 **** #define GETSERV_BY_NAME 1 /* "Getservbyname(%s).\n" */ #define DIED_HOLDING 1 /* "%ld died holding a lock!!\n" */ - #define NESTED_LOCK 1 /* "Nested lock, id = %ld, process = %ld.\n" */ - #define LOCK_FAILED 1 /* "LOCK_FAIL?\n" */ - #define LOCK_SIGNAL 1 /* "LOCK_SIG?\n" */ - #define UNKNOWN_LOCK_STUS 1 /* "Unknown lock status %ld.\n" */ - #define WAIT_INTRUPT 1 /* "Wait interrupted.\n" */ - #define UNKNOWN_WAIT_STUS 1 /* "Unknown wait status 0x%x.\n" */ - /* $ "End of non-transable messages". */ - /* $ */ - /* $ Messages from kernel.c to translate */ - #define HEAP_DESC_ALLOC_FAIL 1 /* "Heap_desc allocation failed.\n" */ - #define HEAP_SPEC_ALLOC_FAIL 1 /* "Heap space allocation failed.\n" */ - #define TOO_MANY_BLOK_ALLOC 1 /* "Too many big blocks allocated.\n" */ - #define HEAP_ALLOC_FAIL 1 /* "Heap allocation failed.\n" */ - #define FREE_BYTES 1 /* "Freeing %ld bytes at 0x%x.\n" */ - #define FREE_ALIEN_BLOK 1 /* "Tried to free alien block at 0x%x.\n" */ - #define INVALID_STAT 1 /* "Invalid stat %ld.\n" */ - /* $ */ - /* $ Do not translate following messages until you find a comment */ - /* $ "End of non-transable messages". */ - /* $ */ - /* $ Message for clm_api.c */ - #define DLM_REG_FAIL 1 /* "dlm_register: failed call to mlm.\n" */ - #define DLM_REG_TOO_MANY_RES 1 /* "dlm_register: too many resources.\n" */ - #define DLM_REG_BAD_RES 1 /* "dlm_register: bad resource handle.\n" */ - #define DLM_REG_INFO 1 /* "dlm_register: name %s type %ld handle 0x%lx\n" */ - /* $ */ - /* $ Message for clm_main.c */ - #define CANT_EST_DEADMAN_SOCK 1 /* "Can't establish deadman socket to clstrmgr.\n" */ - #define CANT_INT_AST_SUBSYS 1 /* "Can't initialize AST subsystem.\n" */ - #define CANT_ALLOC_RES_TAB 1 /* "Unable to allocate resource tables of size %ld.\n" */ - #define CANT_REGISTER_UDP 1 /* "%s: unable to register (%s, %s, udp).\n" */ - #define CANT_REGISTER_TCP 1 /* "%s: unable to register (%s, %s, tcp).\n" */ - #define BYE_BYE 1 /* "Bye!!\n" */ - #define LOCK_DEADMAN_CANT_RESTRT 1 /* "Lock daemon cannot be restarted.\n" */ - /* $ */ - /* $ Message for clm_io.c */ - #define SIGNAL_SEND 1 /* "Signal %ld in send.\n" */ - #define ERR_ON_SEND 1 /* "Error %ld on send.\n" */ - #define SIGNAL_RECV 1 /* "Signal %ld in recv.\n" */ - /* $ */ - /* $ "End of non-transable messages". */ - /* $ Message for loadit.c */ - #define CANT_OPEN 1 /* "Can't open: \n" */ - #define LOG_TO_FILE 1 /* "logging to file %s.\n" */ - #define L_CANT_EXCEED 1 /* "-L can't exceed %ld or be less than 1\n" */ - #define R_CANT_EXCEED 1 /* "-R can't exceed %ld or be less than 1\n" */ - #define P_CANT_EXCEED 1 /* "-P can't exceed %ld or be less than 0\n" */ - #define H_CANT_EXCEED 1 /* "-H can't exceed %ld or be less than 1\n" */ - #define D_RANGE_ERROR 1 /* "-D can't exceed %5.3f or be less than %5.3f\n" */ - #define D_RANGE_DEF 1 /* "Using default rate of %5.3f\n" */ - - #define CANT_FIND_CLMLKM 1 /* "Could not find clm_lkm port.\n" */ - #define CANT_FIND_CLLOCKD 1 /* "Could not find cllockd port.\n" */ - #define CANT_FIND_CLMPTS 1 /* "Could not find clm_pts port.\n" */ - #define CANT_FIND_CLINFODEADMAN 1 /* "Could not find clinfo_deadman port.\n" */ - #define DEBUG_ENABLE 1 /* "%s debugging enabled.\n" */ - #define BAD_OPTION 1 /* "bad option flag '%s'\n" */ - #define DEBUG_OPTIONS 1 /* "Debug Options are:\n" */ - /* $ */ - /* $ Message for stopit.c */ - #define INTERNAL_ERROR 1 /* "Internal error.\n" */ - #define KILLING_PID 1 /* "Killing %ld\n" */ - #define KERNEL_NOT_LOAD 1 /* "The kernel extension has not been loaded.\n" */ - #define KERNEL_ALD_UNLOAD 1 /* "The kernel extension has already been unloaded.\n" */ - #define UNLOAD_KERNEL 1 /* "Unloaded kernel extension.\n" */ - /* $ */ - /* $ Do not translate following messages until you find a comment */ - /* $ "End of non-transable messages". */ - /* $ Message for svc.c */ - #define GETREQ_AUTH_FAIL 1 /* "svc_getreq: auth failed.\n" */ - #define GETREQ_BAD_VER 1 /* "svc_getreq: bad prog or version.\n" */ - #define SVC_XPRT_DIED 1 /* "svc: xprt_died.\n" */ - #define SVC_CANT_MBUF 1 /* "svc: count %ld mbuf %x .\n" */ - #define SVC_REQ_COUNT 1 /* "svc after req: count %ld mbuf %x .\n" */ - - /* $ Messages for clm_alloc.c */ - #define NEG_LOCKID 1 /* "get_le: negative lockid %ld" */ - #define NO_MOR_LKS 1 /* "get_le: NO MORE LOCKS" */ - #define CANT_MALLOC 1 /* "malloc: can't malloc locks" */ - #define INDX_OUT_RANGE 1 /* "find_reclock: index %ld out of range\n" */ - #define SEG_OUT_RANGE 1 /* "find_reclock: segment %ld out of range %ld for type 0x%x\n" */ - #define WRONG_RELOCK 1 /* "find_reclock: got wrong reclock" */ - - /* $ Messages for clm_batch.c */ - #define MALLOC_FAILED 1 /* "clm_alloc_trans: malloc failed" */ - #define BUFFER_UNDERFLOW 1 /* "clm_alloc_trans: buffer underflow" */ - #define FREE_BUFFER 1 /* "clm_free_trans: freeing foreign buffer. Address = 0x%x" */ - #define INCOMP_SEND 1 /* "Incomplete send in pti_flush_responses()" */ - #define SENT_X_Y 1 /* "sent %ld of %ld from 0x%x" */ - #define ERROR_DETECTED 1 /* "Error detected in clm_response_complete\n" */ - #define MALLOC_ERR 1 /* "malloc error in clm_queue_response\n" */ - #define QUE_OVERFLOW 1 /* "inflight queue exceeds 500 entries" */ - #define LOST_REPLY 1 /* "ERROR: lost a reply from the primary. Aborting" */ - #define XMT_FAILED 1 /* "Failed to retransmit inflight queue" */ - #define TRAN_RESP_FAIL 1 /* "Error responding to resend transaction" */ - - /* $ Messages for clm_client.c */ - #define NUM_TRSH_REPLY 1 /* "trashed %ld replies" */ - #define NO_CLIENT 1 /* "removeclient: no such client: %ld" */ - #define ADD_CLIENT_FAIL 1 /* "add_client_reclock: couldn't add client." */ - - /* $ Message for clm_clmlock.c */ - #define NULL_RET 1 /* "clm_lock:clm_direct() returned NULL" */ - #define CANT_CONVERT 1 /* "begin_lock_clm: can't get resource for converting lock rh=0x%x\n" */ - #define CANT_RELOCK 1 /* "cont_lock_clm: ERROR: can't find reclock for blocked lock id=0x%x" */ - #define NULL_HANDLE 1 /* "cont_lock_clm: NULL resource handle for 0x%x" */ - #define NULL_HANDLE_CONVERT 1 /* "clm_convert: NULL resource handle for 0x%x" */ - #define CANT_GET_RES 1 /* "cont_lock_clm: can't get resource for converting lock rh=0x%x\n" */ - #define CANT_GET_RES_LOCK 1 /* "cont_lock_clm: can't get resource for new lock rh=0x%x" */ - #define NULL_RET_CONVERT 1 /* "clm_convert:clm_direct() returned NULL" */ - #define NULL_RET_MASTER 1 /* "master_unlock_clm:clm_direct() returned NULL" */ - #define NO_LOCK_ON_MSTR 1 /* "clm_convert: lock but no resource on non-master" */ - - /* $ Message for clm_clmunlock.c */ - - #define NULL_LOCK_HANDLE 1 /* "pre_proc_unlock_clm: NULL resource handle for 0x%x" */ - #define NO_HANDLE 1 /* "pre_proc_unlock_clm: can't find handle for 0x%x" */ - #define RET_NULL_DIRECT 1 /* "master_unlock_clm:clm_direct() returned NULL" */ - #define NO_RES_HANDL 1 /* "master_unlock_clm: NULL resource handle for 0x%x" */ - #define UNLOCK_NO_HANDLE 1 /* "master_unlock_clm: can't find handle for 0x%x" */ - #define NULL_RETURN 1 /* "master_unlock_clm:clm_direct() returned NULL" */ - #define RELOCK_ERR 1 /* "local_unlock_clm: can't find reclock for 0x%x" */ - #define LOCAL_NULL_RES 1 /* "local_unlock_clm: NULL resource handle for 0x%x" */ - #define LOCAL_UNLK_ERR 1 /* "local_unlock_clm: can't find handle for 0x%x" */ - - /* $ Message for clm_cti.c */ - #define BUFFER_ERR 1 /* "clm_send: can't get receive buffer" */ - #define COPY_FAILED 1 /* "Copyin failed" */ - #define CLIENT_NOT_FOUND 1 /* "clm_recv could not find client %ld" */ - #define COPY_OUT_FAILED 1 /* "Copyout failed" */ - #define ILLEGAL_CLIENT 1 /* "clm_process: Unrecognized client %ld" */ - #define BAD_REQUEST 1 /* "clm_request: bad request type %ld" */ - #define NULL_RESP 1 /* "clm_reply: response and request NULL" */ - #define CLIENT_NOT_FOUND2 1 /* "sendudp: could not find client %ld" */ - #define BUFFER_SHORTAGE 1 /* "sendudp: could not allocate buffer" */ - #define NOTIFY_NULL_HANDLE 1 /* "notify: NULL resource handle" */ - #define BAD_RESPTR 1 /* "notify: bad resptr, rh=0x%x\n" */ - #define BAD_PARAM 1 /* "notify: bad HOW parameter" */ - #define AST_FAILED 1 /* "sendast: send failed AST" */ - #define BAST_FAILED 1 /* "sendast: send failed for BAST" */ - #define NO_VALID_HANDLE 1 /* "send_ast: no valid handle" */ - - /* $ Messages for clm_deadlock.c */ - #define ERR_MALLOC 1 /* "Malloc error in clmdd_startstart()" */ - #define ERR_MALLOC1 1 /* "Malloc error in clmdd_dostart()" */ - #define CANT_LOOKUP_RES 1 /* "clmdd_pushr: can't look up resource" */ - #define ERR_MALLOC2 1 /* "Malloc error in clmdd_pushr()" */ - #define NO_RES_HNDL 1 /* "clmdd_analyze: can't get resource handle" */ - #define ERR_MALLOC3 1 /* "Malloc error in clmdd_processddx()" */ - #define CANT_LOOKUP_RES2 1 /* "clmdd_massage: can't look up resource" */ - #define ERR_MALLOC4 1 /* "Malloc error in ddx_alloc()" */ - #define ERR_MALLOC5 1 /* "Malloc error in ddx_expand()" */ - #define ERR_MALLOC6 1 /* "Malloc error in clmdd_encode()" */ - #define PURG_DEADLOCK 1 /* "purge_deadlock: bad resptr, rh=0x%x\n" */ - - /* $ Message for clm_debug.c */ - #define LOG_ERROR 1 /* "%s: Error %ld" */ - - /* $ Message for clm_direct.c */ - #define UNKNOWN_DIR 1 /* "Unknown directory request type in dir_proc_request" */ - #define DROP_REQUEST_CONV 1 /* "Master convert request for %ld:%s not\n found by directory server. Dropping request." */ - #define DROP_REQUEST_UNLOCK 1 /* "Master unlock request for %ld:%s not\n found by directory server. Dropping request." */ - #define DROP_REQUEST_PURGE 1 /* "Master purge request for %ld:%s not\n found by directory server. Dropping request." */ - #define INVALID_TRAN 1 /* "Invalid trans type for directory create" */ - #define RL_MODIFY_FAIL 1 /* "dir_proc_request: rl_modify failed" */ - #define RL_CREATE_FAIL 1 /* "dir_proc_request: rl_create failed" */ - #define ERR_MALLOC7 1 /* "Malloc error in update_directory()" */ - #define DIR_NODE_ERR 1 /* "Unable to determine directory node" */ - - /* $ Messages for clm_io.c */ - #define BAD_PROCID 1 /* "clm_write: bad kproc_pid = %ld" */ - #define BAD_PROCID_RD 1 /* "clm_read: bad kproc_pid = %ld" */ - #define WRT_EV_FAULT 1 /* "writev emulation faulted (%ld)\n" */ - #define SEND_FAILED 1 /* "send failed for 0x%x" */ - #define BATCHSIZE_ERR 1 /* "clm_iov: batchsize %ld greater than CLM_BATCHSIZE %ld" */ - #define BUFFER_ERR2 1 /* "clm_iov: nbufs(%ld) != number of buffers(%ld)" */ - - /* $ Messages for clm_libr.c */ - #define NO_CLSTR_MGR 1 /* "Error, no cluster manager running" */ - #define PTI_CALL_ERR 1 /* "Error detected in pti_call_complete\n" */ - #define PTI_MALLOC_FAIL 1 /* "malloc failed in pti_call()\n" */ - #define CLM_DIRECT_NULL 1 /* "clm_direct() returned NULL" */ - #define ERR_MALLOC8 1 /* "malloc failed in pti_call_reg()\n" */ - #define ERR_MALLOC9 1 /* "malloc failed in pti_call_unix()\n" */ - - /* $ Message for clm_lock.c */ - #define DUP_RELOCK 1 /* "add_queue: duplicate reclock" */ - #define CORRUPT_Q 1 /* "add_queue: Corrupt Queue" */ - #define CORRUPT_REM_Q 1 /* "remove_queue:Corrupt Queue" */ - #define ERR_MALLOC10 1 /* "malloc failed in pti_purge()\n" */ - #define MALFORMED_Q 1 /* "Malformed QUEUE. ABORTING" */ - - /* $ Message for clm_lcokid.c */ - #define FREEMAP_ERR 1 /* "freemap: not allocated" */ - #define REMOTE_FREEMAP 1 /* "freemap: can't find map for remoteid id %ld" */ - #define HASHTABLE_ERR 1 /* "addmap: can't malloc hash table" */ - #define HASHED_REMOTE_ID 1 /* "ERROR: remoteid 0x%x already hashed" */ - #define MAPID_ERR 1 /* "mapid: not allocated" */ - #define REMOTE_FREEMAP2 1 /* "mapid: can't find map for remoteid 0x%x" */ - - /* $ Messages for clm_main.c */ - #define PTI_REQ_ERR 1 /* "Error returned from pti_proc_request" */ - #define ILLEGAL_REQ 1 /* "pti_prog_p: illegal request type %ld seq 0x%x" */ - #define USE_XMALLOC 1 /* "Had to use xmalloc for proc_notify\n" */ - #define NULL_PTR 1 /* "NULL pointer passed to free_dead()\n" */ - #define CORRUPT_DPTR 1 /* "free_dead: found dptr from outside pool 0x%x\n" */ - #define FAIL_TO_ALLOCATE 1 /* "Allocation failed in purge_list" */ - #define DEAD_PID 1 /* "%s: can't allocate dead pid structs" */ - #define CANT_DETER_INFO 1 /* "Unable to determine local site info" */ - #define CANT_INIT_COMM_LYR 1 /* "cllockd: unable to init comm layer" */ - #define CANT_INIT_PTI_PORT 1 /* "cllockd: unable to init PTI request port" */ - #define CANT_INIT_DIR_PORT 1 /* "cllockd: unable to init directory port" */ - #define CANT_INIT_RES_PORT 1 /* "cllockd: unable to init PTI response port" */ - #define CANT_INIT_RLDB 1 /* "cllockd: unable to init RLDB" */ - #define CANT_INIT_CLMM 1 /* "cllockd: unable to init CLMM" */ - #define CANT_INIT_DEADLOCK_DET 1 /* "cllockd: unable to init deadlock detection" */ - #define EXIT_ON_SIGNAL 1 /* "Exiting on signal %ld" */ - #define SERVER_LOOP_ERR 1 /* "kern_main: server loop error" */ - #define CM_DIED 1 /* "Cluster Manager has died, exiting." */ - #define BAD_DIRECTION_SPEC 1 /* "bad direction specifier in PTI request" */ - #define STRAY_RESPONCE 1 /* "Got stray response!" */ - #define MATCH_REQ_INTERR 1 /* "match_request interrupted" */ - - /* $ Messages for clm_prot.c */ - #define SND_RES_TBL_FAIL 1 /* "send_resource_table failed. Restart cllockd" */ - - /* $ Messages for clm_resource.c */ - #define RES_TABLE_OVERFLOW 1 /* "%s: resource table overflow" */ - #define ALLOCATED_SEGMENT 1 /* "%s: segment %ld already allocated" */ - #define ERR_MALLOC11 1 /* "%s: malloc error expanding restab" */ - #define REHASH_ERR 1 /* "find_reshash: can't allocate reshash\n" */ - #define FOUND_EXISTING_HASH 1 /* "find_reshash: found existing hash for new resource" */ - #define CANT_FIND_DELETE 1 /* "find_reshash: can't find/delete %s" */ - #define BAD_LEN_RES 1 /* "allocate_resource: bad length (%ld)" */ - #define RES_SEG_FULL 1 /* "%s: all resource segments full" */ - #define RES_SEG_ALLOCATE_FAIL 1 /* "%s: failed to allocate res segment" */ - #define RES_SEG_FIND_ERR 1 /* "%s: failed to find res segment" */ - #define NO_MT_RES_SLOT 1 /* "%s: couldn't find empty resource slot" */ - #define ERR_MALLOC12 1 /* "%s: malloc error getting resource name" */ - #define NON_MT_LOCKLIST 1 /* "%s: non-empty lock list for %s\n" */ - #define NON_MT_RESREF_LIST 1 /* "%s: non-empty resref list for %s\n" */ - #define NULL_RETURNED 1 /* "clm_lock:clm_direct() returned NULL" */ - #define PTI_CALL_FAILED 1 /* "begin_register: failed call to PTI" */ - #define TOO_MANY_RESOURCES 1 /* "cont_remote_register: too many resources" */ - #define RESOURCE_FAILURE 1 /* "cont_remote_register: resource failure" */ - #define XMIT_FAILED 1 /* "Failed to xmit resource packet to primary e=%ld" */ - #define OUT_OF_RANGE_Q 1 /* "%s: Queue type out of range.\n" */ - #define XMIT_LOCK_PKT_FAIL 1 /* "Failed to xmit 2 lock packet to primary e=%ld" */ - #define XMIT_LOCK_PKT_FAIL2 1 /* "Failed to xmit 1 lock packet to primary e=%ld" */ - #define NO_RESOURCE_SLOT 1 /* "receive_resource: couldn't allocate resource slot" */ - #define INVALID_RES_HANDLE 1 /* "receive_lock: invalid resource handle" */ - #define CANT_RELOCK2 1 /* "receive_lock: unable to alloc reclock" */ - #define MAP_REMOTE_LOCKID 1 /* "receive_lock: map remote lockid" */ - - /* $ Messages for clm_rldb.c */ - #define ERR_MALLOC13 1 /* "Malloc failed in rl_expand_freelist" */ - #define NO_MEM_FOR_RLDB 1 /* "rl_init: unable to allocate memory for RLDB" */ - #define BAD_ARGS 1 /* "Bad arg passed to rl_enum\n" */ - - /* $ Messages for clm_scn.c */ - #define NULL_RES_HANDLE 1 /* "begin_scn_op: NULL resource handle for 0x%x" */ - #define CANT_GET_HANDLE 1 /* "begin_scn_op: can't find handle for 0x%x" */ - #define NULL_RES_HANDLE2 1 /* "local_scn_op: NULL resource handle for 0x%x" */ - #define CANT_GET_HANDLE2 1 /* "local_scn_op: can't find handle for 0x%x" */ - - /* $ Messages for clm_timeout.c */ - #define BAD_RESPTR2 1 /* "send_timeouts: bad resptr, rh=0x%x\n" */ - #define CANT_ALLOCATE_TRANS 1 /* "send_timeouts: could not allocate transaction" */ - - /* $ Messages for clm_tune.c */ - #define ERROR_IN_PROC 1 /* "Error detected in send_glob_params_complete" */ - #define ERR_MALLOC14 1 /* "%s: malloc failed" */ - #define CCCP_SEND_RETURNED 1 /* "%s: cccp_send returned %ld\n" */ - #define BAD_RETURN 1 /* "Bad return from clmm_ctrl\n" */ - - /* $ Messages for clm_unixlock.c */ - #define CANT_DETERMINE_DIR_NODE 1 /* "Can't determine directory node" */ - #define CANT_ALLOCATE_LK_ENTRY 1 /* "master_lock_unix: can't allocate lock entry" */ - #define CANT_FIND_RESOURCE 1 /* "Can't find resource in local_lock_unix" */ - #define CANT_ALLOCATE_LK_ENTRY2 1 /* "local_lock_unix: can't allocate lock entry" */ - #define CANT_GET_LOCK_ENTRY 1 /* "%s: can't get lock entry" */ - #define IMPOSSIBLE 1 /* "%s: impossible!" */ - #define BAD_RESPTR_SRCH_LK 1 /* "search_lock: bad resptr, rh=0x%x\n" */ - #define CANT_ALLOCATE_LK_ENTRY3 1 /* "insert_le: can't allocate lock entry" */ - /* $ "End of non-translatable messages". */ - #endif /* !HAVING_NLS_ON_LINUX */ void clm_sleep (int secs); --- 956,959 ---- Index: dlm_kernel.h =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/include/dlm_kernel.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** dlm_kernel.h 6 May 2005 12:34:18 -0000 1.15 --- dlm_kernel.h 25 May 2005 16:25:18 -0000 1.16 *************** *** 119,149 **** #endif /* __KERNEL__ */ - #ifdef __linux__ - - /* - * Provide a "bsdlog" that substitutes printk calls. These - * defines match the definitins (e.g., KERN_EMERG) for the - * Linux printk defines. - */ - #ifdef DEBUG - extern int bsdlog( int level, const char * fmt, ... ) - __attribute__ ((format (printf, 2, 3))); - #else - #define bsdlog(n,fmt,...) - #endif - extern int vbsdlog( int level, const char * fmt, va_list arglist ); - - //#include <sys/syslog.h> - #define LOG_EMERG 0 /* system is unusable */ - #define LOG_ALERT 1 /* action must be taken immediately */ - #define LOG_CRIT 2 /* critical conditions */ - #define LOG_ERR 3 /* error conditions */ - #define LOG_WARNING 4 /* warning conditions */ - #define LOG_NOTICE 5 /* normal but significant condition */ - #define LOG_INFO 6 /* informational */ - #define LOG_DEBUG 7 /* debug-level messages */ - - #endif /* __linux__ */ - #ifdef __KERNEL__ --- 119,122 ---- Index: dlm_list.h =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/include/dlm_list.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dlm_list.h 6 May 2005 12:34:19 -0000 1.5 --- dlm_list.h 25 May 2005 16:25:18 -0000 1.6 *************** *** 70,74 **** // DLM_ASSERT must also be enabled globally in dlm_assert.h // comment this out to disable assertions in dlm_list ! #define USE_DLM_ASSERTIONS /**************************************************************** --- 70,74 ---- // DLM_ASSERT must also be enabled globally in dlm_assert.h // comment this out to disable assertions in dlm_list ! //#define USE_DLM_ASSERTIONS /**************************************************************** |
|
From: <mig...@us...> - 2005-05-25 16:25:56
|
Update of /cvsroot/opendlm/opendlm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13449 Modified Files: ChangeLog Log Message: merge with debug-dbprintf-branch * unified logging under dlm_dbprintf * removal of unnecessary linux .h includes * introduction of dlm_module.h to consolidate linux module includes Index: ChangeLog =================================================================== RCS file: /cvsroot/opendlm/opendlm/ChangeLog,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** ChangeLog 6 May 2005 12:34:16 -0000 1.87 --- ChangeLog 25 May 2005 16:25:17 -0000 1.88 *************** *** 1,3 **** ! 2005-05-06 Michael Howard <mic...@sc...> * replaced references to 'STATIC' with 'static' * replaced references to '__inline__' with 'inline' --- 1,9 ---- ! 2005-05-25 Michael Howard <mic...@sc...> ! * merged debug-dbprintf-branch ! * all logging now unified through dlm_log.h and dlm_dbprintf ! * removal of large numbers of unnecessary linux include .h files ! * removal of NLS language translation system ! * introduction of dlm_module.h to consolidate linux kernel module stuff ! 2005-05-06 Michael Howard <mic...@sc...> * replaced references to 'STATIC' with 'static' * replaced references to '__inline__' with 'inline' |
|
From: <mig...@us...> - 2005-05-25 16:25:33
|
Update of /cvsroot/opendlm/opendlm/src/user/tests/old.cm.tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13449/src/user/tests/old.cm.tests Modified Files: cc_fake.c clm_msgprt.c clm_msgtst.c Log Message: merge with debug-dbprintf-branch * unified logging under dlm_dbprintf * removal of unnecessary linux .h includes * introduction of dlm_module.h to consolidate linux module includes Index: cc_fake.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/user/tests/old.cm.tests/cc_fake.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** cc_fake.c 27 Sep 2002 11:52:43 -0000 1.1.1.1 --- cc_fake.c 25 May 2005 16:25:21 -0000 1.2 *************** *** 38,41 **** --- 38,42 ---- #include "config.h" + #include "dlm_log.h" #include <stdio.h> *************** *** 66,74 **** #include <stdlib.h> - /* for NLS */ - #undef MSGSTR - #define MSGSTR(Num, Str) Str - /* end of NLS */ - #include "dlm.h" #include "ast.h" --- 67,70 ---- *************** *** 124,128 **** int OurSiteID = -1 ; - int bsdlog(int n, ...) ; int i_local_nodeid ; --- 120,123 ---- *************** *** 161,169 **** if (i) { ! bsdlog(LOG_CRIT, "Error connecting to message queue.\n") ; exit(1) ; } else ! DBPRINTF((DBG_CONFIG, "Message queue initialized\n")) ; make_deadman(DM_CLLOCKD) ; --- 156,164 ---- if (i) { ! dlm_log(LOG_CRIT, "Error connecting to message queue.\n") ; exit(1) ; } else ! dlm_dbprintf(DBG_CONFIG, "Message queue initialized\n") ; make_deadman(DM_CLLOCKD) ; *************** *** 179,191 **** } - int - bsdlog(int n, ...) - { - va_list arglist ; - va_start(arglist, n) ; - vfprintf(stdout, va_arg(arglist, char *), arglist) ; - return 0 ; - } - /* * Name --- 174,177 ---- *************** *** 213,217 **** if (port < 0) { ! DBPRINTF((DBG_BASIC, "Could not find service clm_lkm.\n")); } else { int rc; --- 199,203 ---- if (port < 0) { ! dlm_dbprintf(DBG_BASIC, "Could not find service clm_lkm.\n"); } else { int rc; *************** *** 253,259 **** if (0 > rc) { ! bsdlog(LOG_ERR, ! MSGSTR(NO_CLSTR_MGR, ! "Error, no cluster manager running")); close(s); s = -1; --- 239,243 ---- if (0 > rc) { ! dlm_log(LOG_ERR, "Error, no cluster manager running"); close(s); s = -1; *************** *** 268,272 **** if (send(s, (caddr_t) &mqci, sizeof mqci, 0) < 0) { ! bsdlog(LOG_ERR, MSGSTR(NO_CLSTR_MGR, "Error, dropped connection")); close(s); --- 252,256 ---- if (send(s, (caddr_t) &mqci, sizeof mqci, 0) < 0) { ! dlm_log(LOG_ERR, MSGSTR(NO_CLSTR_MGR, "Error, dropped connection")); close(s); Index: clm_msgprt.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/user/tests/old.cm.tests/clm_msgprt.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** clm_msgprt.c 27 Sep 2002 11:52:43 -0000 1.1.1.1 --- clm_msgprt.c 25 May 2005 16:25:21 -0000 1.2 *************** *** 46,49 **** --- 46,50 ---- #include "config.h" + #include "dlm_log.h" #include <stdio.h> *************** *** 154,158 **** int i ; ! bsdlog(LOG_DEBUG,"clm_getmsg: event on queue %d\n", msgid); while ((rcvsize = msgrcv(msgid, &msg, sizeof(msg), 0, MSG_NOERROR)) --- 155,159 ---- int i ; ! dlm_log(LOG_DEBUG,"clm_getmsg: event on queue %d\n", msgid); while ((rcvsize = msgrcv(msgid, &msg, sizeof(msg), 0, MSG_NOERROR)) *************** *** 184,188 **** md_msg = (struct mq_msg_struct *)malloc(n); if (NULL == md_msg) { ! bsdlog(LOG_CRIT, "Malloc error in clm_getmsg"); return -1; --- 185,189 ---- md_msg = (struct mq_msg_struct *)malloc(n); if (NULL == md_msg) { ! dlm_log(LOG_CRIT, "Malloc error in clm_getmsg"); return -1; *************** *** 193,202 **** if ((md_size + sizeof(ulong)) != n) { err = errno ; ! bsdlog(LOG_DEBUG,"%d != %d", md_size, msg.mq_union.mq_mdlist_len); ! bsdlog(LOG_DEBUG,"msgrcv MDL ERROR = %d", err); return -1; } else if (md_msg->mq_type != MQ_MDLIST_MSG) { ! bsdlog(LOG_DEBUG, "msgrcv expect MQ_MDLIST_MSG!"); return -1; --- 194,203 ---- if ((md_size + sizeof(ulong)) != n) { err = errno ; ! dlm_log(LOG_DEBUG,"%d != %d", md_size, msg.mq_union.mq_mdlist_len); ! dlm_log(LOG_DEBUG,"msgrcv MDL ERROR = %d", err); return -1; } else if (md_msg->mq_type != MQ_MDLIST_MSG) { ! dlm_log(LOG_DEBUG, "msgrcv expect MQ_MDLIST_MSG!"); return -1; *************** *** 276,285 **** default: ! bsdlog(LOG_DEBUG, "clm_getmsg(): Received " "message of unknown type=%d.\n", msg.mq_type); } } ! bsdlog(LOG_DEBUG,"msgrcv ERROR = %d", errno); return ret_value; --- 277,286 ---- default: ! dlm_log(LOG_DEBUG, "clm_getmsg(): Received " "message of unknown type=%d.\n", msg.mq_type); } } ! dlm_log(LOG_DEBUG,"msgrcv ERROR = %d", errno); return ret_value; *************** *** 309,313 **** if ((id = msgget((key_t)msg_key, IPC_CREAT | 0666)) < 0) { ! bsdlog(LOG_CRIT, "%s: can't get message queue id err=%d", fn, errno); return -1; --- 310,314 ---- if ((id = msgget((key_t)msg_key, IPC_CREAT | 0666)) < 0) { ! dlm_log(LOG_CRIT, "%s: can't get message queue id err=%d", fn, errno); return -1; Index: clm_msgtst.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/user/tests/old.cm.tests/clm_msgtst.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** clm_msgtst.c 27 Sep 2002 11:52:43 -0000 1.1.1.1 --- clm_msgtst.c 25 May 2005 16:25:21 -0000 1.2 *************** *** 38,41 **** --- 38,42 ---- #include "config.h" + #include "dlm_log.h" #include <stdio.h> *************** *** 65,73 **** #include <stdarg.h> - /* for NLS */ - #undef MSGSTR - #define MSGSTR(Num, Str) Str - /* end of NLS */ - #include "dlm.h" #include "ast.h" --- 66,69 ---- *************** *** 79,83 **** int OurSiteID = -1 ; - int bsdlog(int n, ...) ; int clm_msgid, --- 75,78 ---- *************** *** 118,125 **** clm_msgid = msg_initialize(key, entry_lock); if (-1 == clm_msgid) { ! bsdlog(LOG_CRIT, "Error connecting to message queue.\n"); exit(1); } else { ! DBPRINTF((DBG_CONFIG, "Message queue initialized\n")); } --- 113,120 ---- clm_msgid = msg_initialize(key, entry_lock); if (-1 == clm_msgid) { ! dlm_log(LOG_CRIT, "Error connecting to message queue.\n"); exit(1); } else { ! dlm_dbprintf(DBG_CONFIG, "Message queue initialized\n"); } *************** *** 131,141 **** */ if ((deadman_fd = clstr_connect(lkm_port)) < 0) { ! bsdlog(LOG_CRIT, MSGSTR(CANT_EST_DEADMAN_SOCK, ! "Can't establish deadman socket to clstrmgr\n")); ! exit(2); } else { ! DBPRINTF((DBG_CONFIG, "Deadman connection to CM established fd=%d\n", ! deadman_fd)); } --- 126,135 ---- */ if ((deadman_fd = clstr_connect(lkm_port)) < 0) { ! dlm_log(LOG_CRIT, "Can't establish deadman socket to clstrmgr\n"); ! exit(2); } else { ! dlm_dbprintf(DBG_CONFIG, "Deadman connection to CM established fd=%d\n", ! deadman_fd); } *************** *** 145,157 **** } - int - bsdlog(int n, ...) - { - va_list arglist ; - va_start(arglist, n) ; - vfprintf(stdout, va_arg(arglist, char *), arglist) ; - return 0 ; - } - /* * Name --- 139,142 ---- *************** *** 179,183 **** if (port < 0) { ! DBPRINTF((DBG_BASIC, "Could not find service clm_lkm.\n")); } else { int rc; --- 164,168 ---- if (port < 0) { ! dlm_dbprintf(DBG_BASIC, "Could not find service clm_lkm.\n"); } else { int rc; *************** *** 219,225 **** if (0 > rc) { ! bsdlog(LOG_ERR, ! MSGSTR(NO_CLSTR_MGR, ! "Error, no cluster manager running")); close(s); s = -1; --- 204,208 ---- if (0 > rc) { ! dlm_log(LOG_ERR, "Error, no cluster manager running"); close(s); s = -1; *************** *** 234,239 **** if (send(s, (caddr_t) &mqci, sizeof mqci, 0) < 0) { ! bsdlog(LOG_ERR, MSGSTR(NO_CLSTR_MGR, ! "Error, dropped connection")); close(s); s = -1; --- 217,221 ---- if (send(s, (caddr_t) &mqci, sizeof mqci, 0) < 0) { ! dlm_log(LOG_ERR, "Error, dropped connection"); close(s); s = -1; |
|
From: <mig...@us...> - 2005-05-25 16:25:33
|
Update of /cvsroot/opendlm/opendlm/src/make In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13449/src/make Modified Files: kernel.mk Log Message: merge with debug-dbprintf-branch * unified logging under dlm_dbprintf * removal of unnecessary linux .h includes * introduction of dlm_module.h to consolidate linux module includes Index: kernel.mk =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/make/kernel.mk,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** kernel.mk 5 May 2005 18:55:20 -0000 1.7 --- kernel.mk 25 May 2005 16:25:21 -0000 1.8 *************** *** 13,17 **** -I$(linux_src)/include -I$(top_srcdir)/src/include ! AM_CFLAGS = -pipe -O2 -Wall -DDEBUG # --- 13,17 ---- -I$(linux_src)/include -I$(top_srcdir)/src/include ! AM_CFLAGS = -pipe -O2 -Wall # |
|
From: <mig...@us...> - 2005-05-25 16:25:32
|
Update of /cvsroot/opendlm/opendlm/src/user/dlmdu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13449/src/user/dlmdu Modified Files: dlm_cmdline.c dlm_daemon.c Log Message: merge with debug-dbprintf-branch * unified logging under dlm_dbprintf * removal of unnecessary linux .h includes * introduction of dlm_module.h to consolidate linux module includes Index: dlm_cmdline.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/user/dlmdu/dlm_cmdline.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dlm_cmdline.c 3 Mar 2005 19:58:10 -0000 1.8 --- dlm_cmdline.c 25 May 2005 16:25:21 -0000 1.9 *************** *** 45,48 **** --- 45,49 ---- #include "config.h" + #include "dlm_log.h" #include <stdio.h> *************** *** 73,85 **** #include "pti.h" - #ifdef HAVING_NLS_ON_LINUX - /* for NLS */ - #include "cllockd_msg.h" - #define MSGSTR(Num, Str) catgets((struct _catalog_descriptor*)get_catd("cllockd.cat"), CLLOCKD, Num, Str) - /* end of NLS */ - #else /* HAVING_NLS_ON_LINUX */ - #define MSGSTR(Num, Str) Str - #endif /* HAVING_NLS_ON_LINUX */ - #undef LOCK_FREE --- 74,77 ---- *************** *** 216,225 **** if (args.decay_rate > DECAY_MAX || args.decay_rate < DECAY_MIN) { ! fprintf(stderr, MSGSTR(D_RANGE_ERROR, ! "-D can't exceed %5.3f or be less than %5.3f\n"), DECAY_MAX, DECAY_MIN); args.decay_rate = MCB_APSD; ! fprintf(stderr, MSGSTR(D_RANGE_DEF, ! "Using default rate of %5.3f\n"), MCB_APSD); } --- 208,216 ---- if (args.decay_rate > DECAY_MAX || args.decay_rate < DECAY_MIN) { ! fprintf(stderr, "-D can't exceed %5.3f or be less than %5.3f\n", DECAY_MAX, DECAY_MIN); args.decay_rate = MCB_APSD; ! fprintf(stderr, ! "Ussing default rate of %5.3f\n", MCB_APSD); } *************** *** 247,252 **** if (args.locksegsize > MAXLOCKSEGSIZE || args.locksegsize <= 0) { ! fprintf(stderr, MSGSTR(L_CANT_EXCEED, ! "-L can't exceed %d or be less than 1\n"), MAXLOCKSEGSIZE); args.locksegsize = DEFLOCKSEGSIZE; --- 238,243 ---- if (args.locksegsize > MAXLOCKSEGSIZE || args.locksegsize <= 0) { ! fprintf(stderr, ! "-L can't exceed %d or be less than 1\n", MAXLOCKSEGSIZE); args.locksegsize = DEFLOCKSEGSIZE; *************** *** 259,264 **** if (args.ressegsize > MAXRESSEGSIZE || args.ressegsize <= 0) { ! fprintf(stderr, MSGSTR(R_CANT_EXCEED, ! "-R can't exceed %d or be less than 1\n"), MAXRESSEGSIZE); args.ressegsize = DEFRESSEGSIZE; --- 250,255 ---- if (args.ressegsize > MAXRESSEGSIZE || args.ressegsize <= 0) { ! fprintf(stderr, ! "-R can't exceed %d or be less than 1\n", MAXRESSEGSIZE); args.ressegsize = DEFRESSEGSIZE; *************** *** 271,276 **** if (args.resprealloc > MAX_RES_SEGS || args.resprealloc < 0) { ! fprintf(stderr, MSGSTR(P_CANT_EXCEED, ! "-P can't exceed %d or be less than 0\n"), MAX_RES_SEGS); args.resprealloc = 0; --- 262,267 ---- if (args.resprealloc > MAX_RES_SEGS || args.resprealloc < 0) { ! fprintf(stderr, ! "-P can't exceed %d or be less than 0\n", MAX_RES_SEGS); args.resprealloc = 0; *************** *** 284,289 **** if (args.hashsize > MAXHASHSIZE || args.hashsize < 0) { ! fprintf(stderr, MSGSTR(H_CANT_EXCEED, ! "-H can't exceed %d or be less than 1\n"), MAXHASHSIZE); args.hashsize = DEFHASHSIZE; --- 275,280 ---- if (args.hashsize > MAXHASHSIZE || args.hashsize < 0) { ! fprintf(stderr, ! "-H can't exceed %d or be less than 1\n", MAXHASHSIZE); args.hashsize = DEFHASHSIZE; *************** *** 361,365 **** { "BATCH", DBG_BATCH}, { "TIMEOUT", DBG_TIMEOUT}, ! { "NETFAIL", DBG_NETFAIL}, { "CONFIG", DBG_CONFIG}, { "SCN", DBG_SCN}, --- 352,356 ---- { "BATCH", DBG_BATCH}, { "TIMEOUT", DBG_TIMEOUT}, ! { "CCCP", DBG_CCCP}, { "CONFIG", DBG_CONFIG}, { "SCN", DBG_SCN}, *************** *** 375,379 **** { "PURGE", DBG_PURGE}, { "DOMAIN", DBG_DOMAIN}, ! { "FAILSYNC", DBG_FAILSYNC}, { "CLIENT", DBG_CLIENT} }; --- 366,370 ---- { "PURGE", DBG_PURGE}, { "DOMAIN", DBG_DOMAIN}, ! { "unused", DBG_unused}, { "CLIENT", DBG_CLIENT} }; *************** *** 408,421 **** { mask |= options[i].opt_mask; ! fprintf(stderr, MSGSTR(DEBUG_ENABLE, ! "%s debugging enabled\n"), ! options[i].opt_name); } else { mask &= ~ options[i].opt_mask ; ! fprintf(stderr, MSGSTR(DEBUG_ENABLE, ! "%s debugging disabled\n"), ! options[i].opt_name); } break; --- 399,410 ---- { mask |= options[i].opt_mask; ! fprintf(stderr, ! "%s debugging enabled\n", options[i].opt_name); } else { mask &= ~ options[i].opt_mask ; ! fprintf(stderr, ! "%s debugging disabled\n", options[i].opt_name); } break; *************** *** 424,428 **** if (i >= sizeof(options)/sizeof(options[0])) { ! fprintf(stderr, MSGSTR(BAD_OPTION, "bad option flag '%s'\n"), p); print_debug_options(); } --- 413,417 ---- if (i >= sizeof(options)/sizeof(options[0])) { ! fprintf(stderr, "bad option flag '%s'\n", p); print_debug_options(); } *************** *** 456,460 **** { int i; ! printf(MSGSTR(DEBUG_OPTIONS, "Debug Options are:\n")); for (i = 0; i < sizeof(options)/sizeof(options[0]); i++) { printf("\t%s\n", options[i].opt_name); --- 445,449 ---- { int i; ! printf("Debug Options are:\n"); for (i = 0; i < sizeof(options)/sizeof(options[0]); i++) { printf("\t%s\n", options[i].opt_name); Index: dlm_daemon.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/user/dlmdu/dlm_daemon.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dlm_daemon.c 5 May 2005 18:55:21 -0000 1.8 --- dlm_daemon.c 25 May 2005 16:25:21 -0000 1.9 *************** *** 141,153 **** - #ifdef HAVING_NLS_ON_LINUX - /* for NLS */ - #include "cllockd_msg.h" - #define MSGSTR(Num, Str) catgets((struct _catalog_descriptor*)get_catd("cllockd.cat"), CLLOCKD, Num, Str) - /* end of NLS */ - #else /* HAVING_NLS_ON_LINUX */ - #define MSGSTR(Num, Str) Str - #endif /* HAVING_NLS_ON_LINUX */ - /* ============================================================ */ /* --- 141,144 ---- |
|
From: <mig...@us...> - 2005-05-25 16:25:32
|
Update of /cvsroot/opendlm/opendlm/src/kernel/dlmkernapi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13449/src/kernel/dlmkernapi Modified Files: Makefile.in Log Message: merge with debug-dbprintf-branch * unified logging under dlm_dbprintf * removal of unnecessary linux .h includes * introduction of dlm_module.h to consolidate linux module includes Index: Makefile.in =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/kernel/dlmkernapi/Makefile.in,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.in 29 Mar 2005 16:50:02 -0000 1.3 --- Makefile.in 25 May 2005 16:25:21 -0000 1.4 *************** *** 80,84 **** nodist_libdlmk_o_OBJECTS = api_data.$(OBJEXT) api_errno.$(OBJEXT) \ api_init.$(OBJEXT) api_purge.$(OBJEXT) api_vms.$(OBJEXT) \ ! msgtab.$(OBJEXT) api_domain.$(OBJEXT) libdlmk_o_OBJECTS = $(nodist_libdlmk_o_OBJECTS) libdlmk_o_LDADD = $(LDADD) --- 80,84 ---- nodist_libdlmk_o_OBJECTS = api_data.$(OBJEXT) api_errno.$(OBJEXT) \ api_init.$(OBJEXT) api_purge.$(OBJEXT) api_vms.$(OBJEXT) \ ! api_domain.$(OBJEXT) libdlmk_o_OBJECTS = $(nodist_libdlmk_o_OBJECTS) libdlmk_o_LDADD = $(LDADD) *************** *** 89,93 **** @AMDEP_TRUE@ ./$(DEPDIR)/api_errno.Po ./$(DEPDIR)/api_init.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/api_purge.Po ./$(DEPDIR)/api_vms.Po \ ! @AMDEP_TRUE@ ./$(DEPDIR)/msgtab.Po ./$(DEPDIR)/api_domain.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) --- 89,93 ---- @AMDEP_TRUE@ ./$(DEPDIR)/api_errno.Po ./$(DEPDIR)/api_init.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/api_purge.Po ./$(DEPDIR)/api_vms.Po \ ! @AMDEP_TRUE@ ./$(DEPDIR)/api_domain.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) *************** *** 224,234 **** #the 2.4 kernel build process nodist_libdlmk_o_SOURCES = \ ! api_data.c api_errno.c api_init.c api_purge.c api_vms.c msgtab.c \ api_domain.c else #This is ugly, I know but I couldn't get a for-loop to work properly -dcz nodist_libdlmk_o_SOURCES = \ ! $(src)/../../api/api_data.c $(src)/../../api/api_errno.c $(src)/../../api/api_init.c \ ! $(src)/../../api/api_purge.c $(src)/../../api/api_vms.c $(src)/../../api/msgtab.c \ $(src)/../../api/api_domain.c endif --- 224,235 ---- #the 2.4 kernel build process nodist_libdlmk_o_SOURCES = \ ! api_data.c api_errno.c api_init.c api_purge.c api_vms.c \ api_domain.c else #This is ugly, I know but I couldn't get a for-loop to work properly -dcz nodist_libdlmk_o_SOURCES = \ ! $(src)/../../api/api_data.c $(src)/../../api/api_errno.c \ ! $(src)/../../api/api_init.c \ ! $(src)/../../api/api_purge.c $(src)/../../api/api_vms.c \ $(src)/../../api/api_domain.c endif *************** *** 306,310 **** @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/api_purge.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/api_vms.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msgtab.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/api_domain.Po@am__quote@ --- 307,310 ---- |
|
From: <mig...@us...> - 2005-05-25 14:58:46
|
Update of /cvsroot/opendlm/opendlm/src/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27979/src/include Modified Files: Tag: debug-dbprintf-branch dlm_log.h Log Message: varibale args to #define dlm_dbprintf when it is not defined Index: dlm_log.h =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/include/Attic/dlm_log.h,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** dlm_log.h 12 May 2005 18:36:25 -0000 1.1.2.7 --- dlm_log.h 25 May 2005 14:58:20 -0000 1.1.2.8 *************** *** 115,119 **** #else ! #define dlm_dbprintf(arg) #endif /* DBPRINT */ --- 115,119 ---- #else ! #define dlm_dbprintf(arg, ...) #endif /* DBPRINT */ |
|
From: <mig...@us...> - 2005-05-12 18:42:36
|
Update of /cvsroot/opendlm/opendlm/src/api In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6125/src/api Modified Files: Tag: debug-dbprintf-branch api_ais_lock.c api_glue.c api_group.c api_init.c api_purge.c api_scn.c api_tune.c api_vms.c print.c Log Message: noNLS patch applied Index: api_ais_lock.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_ais_lock.c,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** api_ais_lock.c 5 May 2005 18:55:01 -0000 1.5 --- api_ais_lock.c 12 May 2005 18:41:56 -0000 1.5.2.1 *************** *** 18,30 **** #include "pti.h" - #ifdef HAVING_NLS_ON_LINUX - /* for NLS */ - #include "general_msg.h" - #define MSGSTR(Num, Str) catgets((struct _catalog_descriptor*)get_catd("general.cat"), GENERAL, Num, Str) - #else /* HAVING_NLS_ON_LINUX */ - #define MSGSTR(Num, Str) Str - #endif /* HAVING_NLS_ON_LINUX */ - /* end of NLS */ - #include "api_ais_lock.h" --- 18,21 ---- *************** *** 604,608 **** if (response.clm_status == DLM_WORKING) { ! printf(MSGSTR(DLM_WORKING, "DLM_WORKING_TER returned from API call!!\n")); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); --- 595,599 ---- if (response.clm_status == DLM_WORKING) { ! printf("DLM_WORKING_TER returned from API call!!\n"); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); Index: api_glue.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_glue.c,v retrieving revision 1.6.2.1 retrieving revision 1.6.2.2 diff -C2 -d -r1.6.2.1 -r1.6.2.2 *** api_glue.c 8 May 2005 14:19:28 -0000 1.6.2.1 --- api_glue.c 12 May 2005 18:41:56 -0000 1.6.2.2 *************** *** 60,74 **** #include "api_data.h" - #ifdef HAVING_NLS_ON_LINUX - /* for NLS */ - #include "general_msg.h" - #define MSGSTR(Num, Str) catgets(get_catd("general.cat"), GENERAL, Num, Str) - #else /* HAVING_NLS_ON_LINUX */ - #define MSGSTR(Num, Str) Str - #endif /* HAVING_NLS_ON_LINUX */ - /* end of NLS */ - - /* ============================================================ */ - #ifndef __KERNEL__ /* --- 60,63 ---- Index: api_group.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_group.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** api_group.c 27 Sep 2002 11:52:42 -0000 1.1.1.1 --- api_group.c 12 May 2005 18:41:56 -0000 1.1.1.1.2.1 *************** *** 65,76 **** #include "pti.h" - #ifdef HAVING_NLS_ON_LINUX - /* for NLS */ - #include "general_msg.h" - #define MSGSTR(Num, Str) catgets(get_catd("general.cat"), GENERAL, Num, Str) - #else /* HAVING_NLS_ON_LINUX */ - #define MSGSTR(Num, Str) Str - #endif /* HAVING_NLS_ON_LINUX */ - /* end of NLS */ #endif /* __KERNEL__ */ --- 65,68 ---- Index: api_init.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_init.c,v retrieving revision 1.9.2.1 retrieving revision 1.9.2.2 diff -C2 -d -r1.9.2.1 -r1.9.2.2 *** api_init.c 9 May 2005 17:19:53 -0000 1.9.2.1 --- api_init.c 12 May 2005 18:41:56 -0000 1.9.2.2 *************** *** 85,97 **** #include "clmutex_r.h" - #ifdef HAVING_NLS_ON_LINUX - /* for NLS */ - #include "general_msg.h" - #define MSGSTR(Num, Str) catgets((struct _catalog_descriptor*)get_catd("general.cat"), GENERAL, Num, Str) - #else /* HAVING_NLS_ON_LINUX */ - #define MSGSTR(Num, Str) Str - #endif /* HAVING_NLS_ON_LINUX */ - /* end of NLS */ - #include "api_data.h" #include "api_glue.h" --- 85,88 ---- *************** *** 373,378 **** } if (response->clm_sequence != seq) { ! fprintf(stderr, MSGSTR(TRANS_MISMATCH, ! "Transaction mismatch detected in API\n")); return -1; } --- 364,368 ---- } if (response->clm_sequence != seq) { ! fprintf(stderr, "Transaction mismatch detected in API\n"); return -1; } *************** *** 441,446 **** if (response->clm_sequence != seq) { ! fprint_error( MSGSTR(TRANS_MISMATCH, ! "Transaction mismatch detected in API\n")); return -1; } --- 431,435 ---- if (response->clm_sequence != seq) { ! fprint_error("Transaction mismatch detected in API\n"); return -1; } Index: api_purge.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_purge.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** api_purge.c 1 Apr 2004 16:52:53 -0000 1.2 --- api_purge.c 12 May 2005 18:41:56 -0000 1.2.2.1 *************** *** 29,33 **** * COMPONENT_NAME: DLM LIB * ! * FUNCTIONS: MSGSTR * clm_purge */ --- 29,33 ---- * COMPONENT_NAME: DLM LIB * ! * FUNCTIONS: * clm_purge */ *************** *** 68,80 **** #include "pti.h" - #ifdef HAVING_NLS_ON_LINUX - /* for NLS */ - #include "general_msg.h" - #define MSGSTR(Num, Str) catgets(get_catd("general.cat"), GENERAL, Num, Str) - #else /* HAVING_NLS_ON_LINUX */ - #define MSGSTR(Num, Str) Str - #endif /* HAVING_NLS_ON_LINUX */ - /* end of NLS */ - #include "api_data.h" #include "api_init.h" --- 68,71 ---- Index: api_scn.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_scn.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** api_scn.c 27 Sep 2002 11:52:42 -0000 1.1.1.1 --- api_scn.c 12 May 2005 18:41:56 -0000 1.1.1.1.2.1 *************** *** 47,59 **** #include "pti.h" - #ifdef HAVING_NLS_ON_LINUX - /* for NLS */ - #include "general_msg.h" - #define MSGSTR(Num, Str) catgets((struct _catalog_descriptor*)get_catd("general.cat"), GENERAL, Num, Str) - #else /* HAVING_NLS_ON_LINUX */ - #define MSGSTR(Num, Str) Str - #endif /* HAVING_NLS_ON_LINUX */ - /* end of NLS */ - #include "api_data.h" #include "api_init.h" --- 47,50 ---- *************** *** 118,123 **** if (response.clm_status == DLM_WORKING) { ! printf(MSGSTR(DLM_WORKING, ! "DLM_WORKING_TER returned from API call!!\n")); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); --- 109,113 ---- if (response.clm_status == DLM_WORKING) { ! printf("DLM_WORKING_TER returned from API call!!\n"); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); Index: api_tune.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_tune.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** api_tune.c 27 Sep 2002 11:52:42 -0000 1.1.1.1 --- api_tune.c 12 May 2005 18:41:56 -0000 1.1.1.1.2.1 *************** *** 51,63 **** #include "pti.h" - #ifdef HAVING_NLS_ON_LINUX - /* for NLS */ - #include "general_msg.h" - #define MSGSTR(Num, Str) catgets((struct _catalog_descriptor*)get_catd("general.cat"), GENERAL, Num, Str) - #else /* HAVING_NLS_ON_LINUX */ - #define MSGSTR(Num, Str) Str - #endif /* HAVING_NLS_ON_LINUX */ - /* end of NLS */ - #include "api_data.h" #include "api_init.h" --- 51,54 ---- *************** *** 128,132 **** if (response.clm_status == DLM_WORKING) { ! printf(MSGSTR(DLM_WORKING, "DLM_WORKING_TER returned from API call!!\n")); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); --- 119,123 ---- if (response.clm_status == DLM_WORKING) { ! printf("DLM_WORKING_TER returned from API call!!\n"); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); *************** *** 224,228 **** if (response.clm_status == DLM_WORKING) { ! printf(MSGSTR(DLM_WORKING, "DLM_WORKING_TER returned from API call!!\n")); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); --- 215,219 ---- if (response.clm_status == DLM_WORKING) { ! printf("DLM_WORKING_TER returned from API call!!\n"); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); Index: api_vms.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/api_vms.c,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -C2 -d -r1.10 -r1.10.2.1 *** api_vms.c 5 May 2005 18:55:01 -0000 1.10 --- api_vms.c 12 May 2005 18:41:56 -0000 1.10.2.1 *************** *** 76,89 **** #include "pti.h" - #ifdef HAVING_NLS_ON_LINUX - /* for NLS */ - #include "general_msg.h" - #define MSGSTR(Num, Str) catgets((struct _catalog_descriptor*)get_catd("general.cat"), GENERAL, Num, Str) - #else /* HAVING_NLS_ON_LINUX */ - #define MSGSTR(Num, Str) Str - #endif /* HAVING_NLS_ON_LINUX */ - /* end of NLS */ - - #include "api_data.h" #include "api_init.h" --- 76,79 ---- *************** *** 601,605 **** if (response.clm_status == DLM_WORKING) { ! printf(MSGSTR(DLM_WORKING, "DLM_WORKING_TER returned from API call!!\n")); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); --- 591,595 ---- if (response.clm_status == DLM_WORKING) { ! printf("DLM_WORKING_TER returned from API call!!\n"); if (api_response(&response) != 0) { ret_val = set_dlm_errno(DLM_NOLOCKMGR); Index: print.c =================================================================== RCS file: /cvsroot/opendlm/opendlm/src/api/print.c,v retrieving revision 1.1.1.1.2.1 retrieving revision 1.1.1.1.2.2 diff -C2 -d -r1.1.1.1.2.1 -r1.1.1.1.2.2 *** print.c 9 May 2005 17:19:54 -0000 1.1.1.1.2.1 --- print.c 12 May 2005 18:41:57 -0000 1.1.1.1.2.2 *************** *** 39,51 **** #include "dlm.h" - #ifdef HAVING_NLS_ON_LINUX - /* for NLS */ - #include "general_msg.h" - #define MSGSTR(Num, Str) catgets((struct _catalog_descriptor*)get_catd("general.cat"), GENERAL, Num, Str) - #else /* HAVING_NLS_ON_LINUX */ - #define MSGSTR(Num, Str) Str - #endif /* HAVING_NLS_ON_LINUX */ - /* end of NLS */ - /* ============================================================ */ --- 39,42 ---- *************** *** 60,66 **** static char buffer[50]; if (err < 0) { ! sprintf(buffer, ! MSGSTR(LOG_ERROR,"DLM Error %d\n"), ! err); return buffer; } --- 51,55 ---- static char buffer[50]; if (err < 0) { ! sprintf(buffer, "DLM Error %d\n", err); return buffer; } *************** *** 74,80 **** dlm_perror(const char *s) { ! fprintf(stderr, ! MSGSTR(ERROR_MSG,"%1$s: %2$s\n"), ! s, ! dlm_errmsg(dlm_errno)); } --- 63,66 ---- dlm_perror(const char *s) { ! fprintf(stderr, "%1$s: %2$s\n", s, dlm_errmsg(dlm_errno)); } |