From: Robert W. <wrw...@us...> - 2006-12-19 23:37:39
|
Update of /cvsroot/linuxisns/isnsNT/isnsserver/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv17389/src Modified Files: iSNSdb.c Log Message: fix initial index counters Index: iSNSdb.c =================================================================== RCS file: /cvsroot/linuxisns/isnsNT/isnsserver/src/iSNSdb.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** iSNSdb.c 18 Dec 2006 23:00:04 -0000 1.23 --- iSNSdb.c 19 Dec 2006 23:37:30 -0000 1.24 *************** *** 602,607 **** ISNSGetNewEntityIdx( void ) { ! static uint32_t indx = 1; ! return ( indx++ ); } --- 602,625 ---- ISNSGetNewEntityIdx( void ) { ! static uint32_t indx = 0; ! ISNS_DBKey key; ! int index = 0; ! ! key.tag = ENTITY_IDX_KEY; ! ! if (indx == 0) ! { ! while (SNSdbGetNextOfKey (&key) == SUCCESS) ! { ! index = key.val.idx.index; ! printf("********** INDEX:%i\n",index); ! if ( index > indx ) ! indx = index; ! } ! } ! ! indx++; ! ! return ( indx ); } *************** *** 612,617 **** ISNSGetNewISCSIIdx( void ) { ! static uint32_t indx = 1; ! return ( indx++ ); } --- 630,653 ---- ISNSGetNewISCSIIdx( void ) { ! static uint32_t indx = 0; ! ISNS_DBKey key; ! int index = 0; ! ! key.tag = ISCSI_IDX_KEY; ! ! if (indx == 0) ! { ! while (SNSdbGetNextOfKey (&key) == SUCCESS) ! { ! index = key.val.idx.index; ! printf("********** INDEX:%i\n",index); ! if ( index > indx ) ! indx = index; ! } ! } ! ! indx++; ! ! return ( indx ); } *************** *** 622,627 **** ISNSGetNewPortalIdx( void ) { ! static uint32_t indx = 1; ! return ( indx++ ); } --- 658,681 ---- ISNSGetNewPortalIdx( void ) { ! static uint32_t indx = 0; ! ISNS_DBKey key; ! int index = 0; ! ! key.tag = PORTAL_IDX_KEY; ! ! if (indx == 0) ! { ! while (SNSdbGetNextOfKey (&key) == SUCCESS) ! { ! index = key.val.idx.index; ! printf("********** INDEX:%i\n",index); ! if ( index > indx ) ! indx = index; ! } ! } ! ! indx++; ! ! return ( indx ); } |