[Sysfence-commit] sysfence getstats.c,1.12,1.13 getstats.h,1.8,1.9
Status: Alpha
Brought to you by:
emes
|
From: Michal S. <em...@us...> - 2004-05-28 23:27:42
|
Update of /cvsroot/sysfence/sysfence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11548 Modified Files: getstats.c getstats.h Log Message: + fs database handling * fixed DEBUG code Index: getstats.h =================================================================== RCS file: /cvsroot/sysfence/sysfence/getstats.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- getstats.h 26 May 2004 04:11:09 -0000 1.8 +++ getstats.h 28 May 2004 23:27:32 -0000 1.9 @@ -16,13 +16,15 @@ #define BUFSIZE 512 -#define FS_DATA_SIZE 32768 // 32k #define PROC_DATA_SIZE 524288 // 512k /* shared memory segments */ int db_shmid, fs_shmid, proc_shmid, rules_shmid; void *db_shm, *fs_shm, *proc_shm, *rules_shm; +/* temporary fs list (will be copied to *fs_shm after db initialization */ +sf_list *tmp_fs_db; + sf_database *main_db; sf_value get_stat_value (sf_stat_def *def); Index: getstats.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/getstats.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- getstats.c 26 May 2004 17:39:12 -0000 1.12 +++ getstats.c 28 May 2004 23:27:32 -0000 1.13 @@ -32,9 +32,16 @@ sf_value get_stat_fs (sf_stat_def *def, sf_list *fslist) { - sf_value res; - - bail_out (EXIT_BUG, "get_stat_fs(): NIY"); + sf_value res; + sf_fs_stats *fs = get_fs_entry_from_list (fslist, def->arg[1].path); + sf_res_state slctr = def->arg[0].resstat; + +#ifdef DEBUG + syslog (LOG_DEBUG, "get_stat_fs(): fslist @ %x", fslist); +#endif + + res.type = INTEGER; + res.ptr = &(fs->val[slctr]); return res; } @@ -52,7 +59,7 @@ sf_res_state selector = def->arg[0].resstat; #ifdef DEBUG - syslog (LOG_DEBUG, "get_stat_value(%s) called from %s", def_2_string(def), caller); + syslog (LOG_DEBUG, "get_stat_value(%s)", def_2_string(def)); #endif switch (def->label) { |