From: Marc Dionne Date: Thu, 20 Jan 2011 02:39:44 +0000 (-0500) Subject: ubik: rename DInit, call from initialization sequence X-Git-Tag: upstream/1.8.0_pre1^2~4095 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=ba80a8a88b0f934b67171faefb75d0757b1a7421;p=packages%2Fo%2Fopenafs.git ubik: rename DInit, call from initialization sequence Rename DInit to udisk_Init, and call it from the general initialization sequence. udisk_begin can now assume that this has been done. Change-Id: I88f38b7a846b635e0c42f42cdf8c9005bb4bf62d Reviewed-on: http://gerrit.openafs.org/4140 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Reviewed-by: Derrick Brashear --- diff --git a/src/ubik/disk.c b/src/ubik/disk.c index c92117b39..69a1115e8 100644 --- a/src/ubik/disk.c +++ b/src/ubik/disk.c @@ -57,7 +57,6 @@ static int calls = 0, ios = 0, lastb = 0; static char *BufferData; static struct buffer *newslot(struct ubik_dbase *adbase, afs_int32 afid, afs_int32 apage); -static int initd = 0; #define BADFID 0xffffffff static int DTrunc(struct ubik_trans *atrans, afs_int32 fid, afs_int32 length); @@ -247,8 +246,8 @@ udisk_LogWriteData(struct ubik_dbase *adbase, afs_int32 afile, void *abuffer, return 0; } -static int -DInit(int abuffers) +int +udisk_Init(int abuffers) { /* Initialize the venus buffer system. */ int i; @@ -847,11 +846,6 @@ udisk_begin(struct ubik_dbase *adbase, int atype, struct ubik_trans **atrans) struct ubik_trans *tt; *atrans = (struct ubik_trans *)NULL; - /* Make sure system is initialized before doing anything */ - if (!initd) { - initd = 1; - DInit(ubik_nBuffers); - } if (atype == UBIK_WRITETRANS) { if (adbase->flags & DBWRITING) return USYNC; diff --git a/src/ubik/ubik.c b/src/ubik/ubik.c index 20c19f1fe..a2d6fc0ca 100644 --- a/src/ubik/ubik.c +++ b/src/ubik/ubik.c @@ -423,6 +423,8 @@ ubik_ServerInitCommon(afs_uint32 myHost, short myPort, if (code < 0) return code; + udisk_Init(ubik_nBuffers); + ubik_callPortal = myPort; /* try to get an additional security object */ ubik_sc[0] = rxnull_NewServerSecurityObject(); diff --git a/src/ubik/ubik.p.h b/src/ubik/ubik.p.h index fe454a2f1..eb24e9dbe 100644 --- a/src/ubik/ubik.p.h +++ b/src/ubik/ubik.p.h @@ -420,6 +420,7 @@ extern void *ubeacon_Interact(void *); /*\}*/ /*! \name disk.c */ +extern int udisk_Init(int nBUffers); extern void udisk_Debug(struct ubik_debug *aparm); extern int udisk_Invalidate(struct ubik_dbase *adbase, afs_int32 afid); extern int udisk_read(struct ubik_trans *atrans, afs_int32 afile,