Cluster Project branch, master, updated. gfs-kernel_0_1_22-202-g03781f0
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Cluster Project".
The branch, master has been updated
via 03781f0e840d268cbc5fffc9a36548fca28a3d76 (commit)
from 96078c8382cb000b85424d5826f6ac83d49ce2ee (commit)Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 03781f0e840d268cbc5fffc9a36548fca28a3d76
Author: Fabio M. Di Nitto <[email protected]> Date: Thu Apr 24 09:47:51 2008 +0200
[CMAN] Convert qdiskd to use logsys
-----------------------------------------------------------------------
Summary of changes:
cman/qdisk/Makefile | 6 +- cman/qdisk/clulog.c | 291 ---------------------------------------------- cman/qdisk/clulog.h | 161 ------------------------- cman/qdisk/daemon_init.c | 8 +- cman/qdisk/disk.c | 80 ++++++------- cman/qdisk/disk_util.c | 6 +- cman/qdisk/main.c | 156 ++++++++++++++----------- cman/qdisk/mkqdisk.c | 22 +++- cman/qdisk/proc.c | 42 ++++--- cman/qdisk/score.c | 23 ++-- 10 files changed, 187 insertions(+), 608 deletions(-) delete mode 100644 cman/qdisk/clulog.c delete mode 100644 cman/qdisk/clulog.h
cman/qdisk/Makefile +3 -3
@@ -25,17 +25,17 @@ include $(OBJDIR)/make/uninstall.mk CFLAGS += -D_GNU_SOURCE CFLAGS += -Werror -Wstrict-prototypes -Wshadow -CFLAGS += -I${ccsincdir} -I${cmanincdir} +CFLAGS += -I${ccsincdir} -I${cmanincdir} -L${openaisincdir} CFLAGS += -I$(S) CFLAGS += -I${incdir} +LDFLAGS += -L${openaislibdir} -llogsys -lpthread + EXTRA_LDFLAGS += -L${cmanlibdir} -L${ccslibdir} -lcman -lccs -EXTRA_LDFLAGS += -lpthread OBJS1= main.o \ score.o \ bitmap.o \ - clulog.o \ gettid.o \ daemon_init.o
cman/qdisk/clulog.c deleted +0 -291
291 lines not on this page · raw message
cman/qdisk/clulog.h deleted +0 -161
161 lines not on this page · raw message
cman/qdisk/daemon_init.c +5 -3
@@ -42,6 +42,7 @@#include <sys/errno.h> #include <libgen.h> #include <signal.h> +#include <openais/service/logsys.h> /* * This should ultimately go in a header file.
@@ -56,6 +57,7 @@ int check_process_running(char *prog, pid_t * pid);static void update_pidfile (char *prog);static int setup_sigmask (void ); +LOGSYS_DECLARE_SUBSYS ("QDISK" ,LOG_LEVEL_INFO );int check_pid_valid (pid_t pid,char *prog)
@@ -216,19 +218,19 @@ daemon_init(char *prog) uid =getuid ();if (uid) { -fprintf (stderr, +log_printf (LOG_ERR ,"daemon_init: Sorry, only root wants to run this.\n" );exit (1 ); }if (check_process_running (prog, &pid) && (pid !=getpid ())) { -fprintf (stderr, +log_printf (LOG_ERR ,"daemon_init: Process \"%s\" already running.\n" , prog);exit (1 ); }if (setup_sigmask () <0 ) { -fprintf (stderr,"daemon_init: Unable to set signal mask.\n" ); +log_printf (LOG_ERR ,"daemon_init: Unable to set signal mask.\n" );exit (1 ); }
cman/qdisk/disk.c +35 -45
282 lines not on this page · raw message
cman/qdisk/disk_util.c +4 -2
@@ -35,7 +35,9 @@#include <unistd.h> #include <sys/time.h> #include <time.h> +#include <openais/service/logsys.h> +LOGSYS_DECLARE_SUBSYS ("QDISK" ,LOG_LEVEL_INFO );inline void _diff_tv (struct timeval *dest,struct timeval *start,struct timeval *end)
@@ -204,7 +206,7 @@ qd_write_status(qd_ctx *ctx, int nid, disk_node_state_t state,if (qdisk_write (&ctx->qc_disk,qdisk_nodeid_offset (nid, ctx->qc_disk.d_blksz), &ps,sizeof (ps)) <0 ) { -printf ("Error writing node ID block %d\n" , nid); +log_printf (LOG_ERR ,"Error writing node ID block %d\n" , nid);return -1 ; }if (utime_ok && (get_time (&end, ctx->qc_flags&RF_UPTIME ) <0 ))
@@ -278,7 +280,7 @@ qd_read_print_status(target_info_t *disk, int nid)if (qdisk_read (disk,qdisk_nodeid_offset (nid, disk->d_blksz), &ps,sizeof (ps)) <0 ) { -printf ("Error reading node ID block %d\n" , nid); +log_printf (LOG_ERR ,"Error reading node ID block %d\n" , nid);return -1 ; }swab_status_block_t (&ps);
cman/qdisk/main.c +87 -69
502 lines not on this page · raw message
cman/qdisk/mkqdisk.c +19 -3
@@ -30,7 +30,11 @@#include <stdlib.h> #include <string.h> #include <unistd.h> +#include <openais/service/logsys.h> +LOGSYS_DECLARE_SYSTEM (NULL ,LOG_MODE_OUTPUT_STDERR |LOG_MODE_DISPLAY_DEBUG ,NULL ,SYSLOGFACILITY ); + +LOGSYS_DECLARE_SUBSYS ("QDISK" ,LOG_LEVEL_INFO );int main (int argc,char **argv)
@@ -41,18 +45,30 @@ main(int argc, char **argv)printf ("mkqdisk v" RELEASE_VERSION "\n\n" ); +/* XXX this is horrible but we need to prioritize options as long as +* we can't queue messages properly +*/ while ((rv =getopt (argc, argv,"Ldf:c:l:h" )) !=EOF ) {switch (rv) {case 'd' : ++verbose_level; +logsys_config_priority_set (LOG_LEVEL_DEBUG ); +break ; + } + } + +/* reset the option index to reparse */ + optind =0 ; + +while ((rv =getopt (argc, argv,"Ldf:c:l:h" )) !=EOF ) { +switch (rv) { +case 'd' : +/* processed above, needs to be here for compat */ break ;case 'L' :/* List */ -close (2 );return find_partitions (NULL ,NULL ,0 , verbose_level); -break ;case 'f' : -close (2 );return find_partitions ( optarg, device,sizeof (device), verbose_level);case 'c' :
cman/qdisk/proc.c +22 -20
92 lines not on this page · raw message
cman/qdisk/score.c +12 -11
@@ -31,7 +31,7 @@#include <pthread.h> #include <string.h> #include <ccs.h> -#include <clulog.h> +#include <openais/service/logsys.h> #include <sched.h> #include <sys/mman.h> #include "disk.h"
@@ -49,6 +49,7 @@ struct h_arg {int count; }; +LOGSYS_DECLARE_SUBSYS ("QDISK" ,LOG_LEVEL_INFO );/* XXX Messy, but works for now...
@@ -146,7 +147,7 @@ fork_heuristic(struct h_data *h)execv ("/bin/sh" , argv); -printf ("Execv failed\n" ); +log_printf (LOG_ERR ,"Execv failed\n" );return 0 ; }
@@ -162,7 +163,7 @@ total_score(struct h_data *h, int max, int *score, int *maxscore) *score =0 ; *maxscore =0 ; -//printf("max = %d\n", max); +log_printf (LOG_DEBUG ,"max = %d\n" , max);/* Allow operation w/o any heuristics */ if (!max) { *score = *maxscore =1 ;
@@ -211,7 +212,7 @@ check_heuristic(struct h_data *h, int block)/* Returned 0 and was not killed */ if (!h->available) { h->available =1 ; -clulog (LOG_INFO ,"Heuristic: '%s' UP\n" , h->program); +log_printf (LOG_INFO ,"Heuristic: '%s' UP\n" , h->program); } h->misses =0 ;return 0 ;
@@ -220,12 +221,12 @@ miss:if (h->available) { h->misses++;if (h->misses >= h->tko) { -clulog (LOG_INFO , +log_printf (LOG_INFO ,"Heuristic: '%s' DOWN (%d/%d)\n" , h->program, h->misses, h->tko); h->available =0 ; }else { -clulog (LOG_DEBUG , +log_printf (LOG_DEBUG ,"Heuristic: '%s' missed (%d/%d)\n" , h->program, h->misses, h->tko); }
@@ -324,13 +325,13 @@ configure_heuristics(int ccsfd, struct h_data *h, int max) h[x].tko =1 ; } -clulog (LOG_DEBUG , +log_printf (LOG_DEBUG ,"Heuristic: '%s' score=%d interval=%d tko=%d\n" , h[x].program, h[x].score, h[x].interval, h[x].tko); }while (++x < max); -clulog (LOG_DEBUG ,"%d heuristics loaded\n" , x); +log_printf (LOG_DEBUG ,"%d heuristics loaded\n" , x);return x; }
@@ -392,7 +393,7 @@ score_thread_main(void *arg)free (args->h);free (args); -printf ("Score thread going away\n" ); +log_printf (LOG_INFO ,"Score thread going away\n" );return (NULL ); }
@@ -475,14 +476,14 @@ main(int argc, char **argv) max =0 ;while (max <10 ) {get_my_score (&score,&maxscore); -printf ("current %d/%d\n" , score, maxscore); +log_printf (LOG_INFO ,"current %d/%d\n" , score, maxscore);sleep (1 ); ++max; }stop_score_thread ();get_my_score (&score,&maxscore); -printf ("final! %d/%d\n" , score, maxscore); +log_printf (LOG_INFO ,"final! %d/%d\n" , score, maxscore);return 0 ; }
hooks/post-receive
--
Cluster Project