Aneesh Kumar K.V
2002-02-21 11:14:13 UTC
Hi,
with some modification.
-aneesh
extern struct node_list * node_list ; /* Global containing all the node_list */
the node up routine( void *clms_handle,
int service,
clusternode_t node, /* The node in which we are interested */
clusternode_t surrogate,
void *private)
{
/* I will do here what is done inside the handle_new_topology */
int node_list_index = -1 ;
int i ;
/* MAXNODES from DLM do we need to sync this with NSC_MAX_NODE_VALUE */
for ( i = 0 ; i < MAXNODES; i++) {
if (node_list->node[i].nodeid == node ) {
node_list_index = i ;
break;
}
else
i++;
}
if ( node_list_index == -1 ) {
clms_node_add(new_nodeid) ;
return;
}
if(clm_is_running()) {
node_list->node[node_list_index] = -put the new information -
fix_low_high_version(node_list);
#ifdef CONFIG_PROC_FS
if ( node_list->node[node_list_index].proc_entry == NULL )
{
node_list->node[node_list_index].proc_entry =
dlm_proc_create_node_entry( node_list->node[ node_list_index ].nodeid );
}
#endif /* CONFIG_PROC_FS */
cccp_node_up( node);
}
}
the node down routine( void *clms_handle,
int service,
clusternode_t node, /* The node in which we are interested */
clusternode_t surrogate,
void *private)
{
/* I will do here what is done inside the handle_new_topology */
int node_list_index = -1 ;
int i ;
for ( i = 0 ; i < MAXNODES; i++) {
if (node_list->node[i].nodeid == node ) {
node_list_index = i ;
break;
}
else
i++;
}
CLM_ASSERT( node_list_index != -1, "Node down for the node that has not joined " );
node_list->node[node_list_index].saddr.s_addr = 0 ; /* KILL OLD */
node_list->node[node_list_index].version = 0 ;
fix_low_high_version(node_list) ;
cccp_node_down( node, TRUE ); /* TELL CCCP */
clms_node_down(node_list->node[node_list_index].nodeid) ;
}
with some modification.
-aneesh
extern struct node_list * node_list ; /* Global containing all the node_list */
the node up routine( void *clms_handle,
int service,
clusternode_t node, /* The node in which we are interested */
clusternode_t surrogate,
void *private)
{
/* I will do here what is done inside the handle_new_topology */
int node_list_index = -1 ;
int i ;
/* MAXNODES from DLM do we need to sync this with NSC_MAX_NODE_VALUE */
for ( i = 0 ; i < MAXNODES; i++) {
if (node_list->node[i].nodeid == node ) {
node_list_index = i ;
break;
}
else
i++;
}
if ( node_list_index == -1 ) {
clms_node_add(new_nodeid) ;
return;
}
if(clm_is_running()) {
node_list->node[node_list_index] = -put the new information -
fix_low_high_version(node_list);
#ifdef CONFIG_PROC_FS
if ( node_list->node[node_list_index].proc_entry == NULL )
{
node_list->node[node_list_index].proc_entry =
dlm_proc_create_node_entry( node_list->node[ node_list_index ].nodeid );
}
#endif /* CONFIG_PROC_FS */
cccp_node_up( node);
}
}
the node down routine( void *clms_handle,
int service,
clusternode_t node, /* The node in which we are interested */
clusternode_t surrogate,
void *private)
{
/* I will do here what is done inside the handle_new_topology */
int node_list_index = -1 ;
int i ;
for ( i = 0 ; i < MAXNODES; i++) {
if (node_list->node[i].nodeid == node ) {
node_list_index = i ;
break;
}
else
i++;
}
CLM_ASSERT( node_list_index != -1, "Node down for the node that has not joined " );
node_list->node[node_list_index].saddr.s_addr = 0 ; /* KILL OLD */
node_list->node[node_list_index].version = 0 ;
fix_low_high_version(node_list) ;
cccp_node_down( node, TRUE ); /* TELL CCCP */
clms_node_down(node_list->node[node_list_index].nodeid) ;
}