ubik: rename DInit, call from initialization sequence
authorMarc Dionne <marc.c.dionne@gmail.com>
Thu, 20 Jan 2011 02:39:44 +0000 (21:39 -0500)
committerDerrick Brashear <shadow@dementia.org>
Sun, 6 Mar 2011 13:42:47 +0000 (05:42 -0800)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/ubik/disk.c
src/ubik/ubik.c
src/ubik/ubik.p.h

index c92117b..69a1115 100644 (file)
@@ -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;
index 20c19f1..a2d6fc0 100644 (file)
@@ -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();
index fe454a2..eb24e9d 100644 (file)
@@ -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,