/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
- *
+ *
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
#include <afsconfig.h>
#include <afs/param.h>
-RCSID
- ("$Header$");
-
-#ifdef AFS_NT40_ENV
-#include <winsock2.h>
-#else
-#include <netinet/in.h>
-#include <sys/file.h>
-#include <sys/param.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
+#include <roken.h>
-#include <sys/types.h>
#include <afs/stds.h>
#include <afs/bubasics.h>
-#include <stdio.h>
#include <lock.h>
#include <ubik.h>
#include <lwp.h>
#include <rx/xdr.h>
#include <rx/rx.h>
#include <rx/rxkad.h>
-#include <des.h>
#include <afs/cellconfig.h>
#include <afs/auth.h>
-#include <errno.h>
+#include <afs/audit.h>
+#include <afs/afsutil.h>
+
#include "budb.h"
#include "budb_errs.h"
#include "database.h"
+#include "budb_internal.h"
#include "error_macros.h"
#include "globals.h"
-#include "afs/audit.h"
-#include <afs/afsutil.h>
#undef min
#undef max
extern struct ubik_dbase *BU_dbase;
extern struct afsconf_dir *BU_conf; /* for getting cell info */
-extern afs_int32 myHost;
-extern struct memoryDB db; /* incore copies of db structures */
-afs_int32 AddVolume(), AddVolumes(), CreateDump(), DoDeleteDump(),
-DoDeleteTape(), ListDumps();
-afs_int32 DeleteVDP(), FindClone(), FindDump(), FindLatestDump();
-afs_int32 FinishDump(), FinishTape(), GetDumps(), getExpiration(),
-T_DumpDatabase();
-afs_int32 makeAppended(), MakeDumpAppended(), FindLastTape(), GetTapes();
-afs_int32 GetVolumes(), UseTape(), T_DumpHashTable(), T_GetVersion();
+afs_int32 AddVolume(struct rx_call *, struct budb_volumeEntry *);
+afs_int32 AddVolumes(struct rx_call *, struct budb_volumeList *);
+afs_int32 CreateDump(struct rx_call *, struct budb_dumpEntry *);
+afs_int32 DoDeleteDump(struct rx_call *, dumpId, Date, Date, budb_dumpsList *);
+afs_int32 DoDeleteTape(struct rx_call *, struct budb_tapeEntry *);
+afs_int32 ListDumps(struct rx_call *, afs_int32, afs_int32, Date, Date,
+ budb_dumpsList *, budb_dumpsList *);
+afs_int32 DeleteVDP(struct rx_call *, char *, char *, afs_int32);
+afs_int32 FindClone(struct rx_call *, afs_int32, char *, afs_int32 *);
+afs_int32 FindDump(struct rx_call *, char *, afs_int32,
+ struct budb_dumpEntry *);
+afs_int32 FindLatestDump(struct rx_call *, char *, char *,
+ struct budb_dumpEntry *);
+afs_int32 FinishDump(struct rx_call *, struct budb_dumpEntry *);
+afs_int32 FinishTape(struct rx_call *, struct budb_tapeEntry *);
+afs_int32 GetDumps(struct rx_call *, afs_int32, afs_int32, char *,
+ afs_int32, afs_int32, afs_int32, afs_int32 *,
+ afs_int32 *, budb_dumpList *);
+afs_int32 getExpiration(struct ubik_trans *ut, struct tape *);
+afs_int32 makeAppended(struct ubik_trans *ut, afs_int32, afs_int32,
+ afs_int32);
+afs_int32 MakeDumpAppended(struct rx_call *, afs_int32, afs_int32,
+ afs_int32);
+afs_int32 FindLastTape(struct rx_call *, afs_int32, struct budb_dumpEntry *,
+ struct budb_tapeEntry *, struct budb_volumeEntry *);
+afs_int32 GetTapes(struct rx_call *, afs_int32, afs_int32, char *, afs_int32,
+ afs_int32, afs_int32, afs_int32 *, afs_int32 *,
+ budb_tapeList *);
+afs_int32 GetVolumes(struct rx_call *, afs_int32, afs_int32, char *,
+ afs_int32, afs_int32, afs_int32, afs_int32 *,
+ afs_int32 *, budb_volumeList *);
+afs_int32 UseTape(struct rx_call *, struct budb_tapeEntry *, int *);
+afs_int32 T_DumpHashTable(struct rx_call *, int, char *);
+afs_int32 T_GetVersion(struct rx_call *, int *);
+afs_int32 T_DumpDatabase(struct rx_call *, char *);
+
+int volFragsDump(struct ubik_trans *, FILE *, dbadr);
/* Text block management */
/* This variable is protected by the procsInited flag. */
-static int (*rebuildDatabase) ();
+static int (*rebuildDatabase) (struct ubik_trans *);
-/* AwaitInitialization
+/* AwaitInitialization
* Wait unitl budb has initialized (InitProcs). If it hasn't
* within 5 seconds, then return no quorum.
*/
afs_int32
-AwaitInitialization()
+AwaitInitialization(void)
{
afs_int32 start = 0;
start = time(0);
else if (time(0) - start > 5)
return UNOQUORUM;
+#ifdef AFS_PTHREAD_ENV
+ sleep(1);
+#else
IOMGR_Sleep(1);
+#endif
}
return 0;
}
*/
char *
-tailCompPtr(pathNamePtr)
- char *pathNamePtr;
+tailCompPtr(char *pathNamePtr)
{
char *ptr;
ptr = strrchr(pathNamePtr, '/');
* 1 - yes
*/
-callPermitted(call)
- struct rx_call *call;
+int
+callPermitted(struct rx_call *call)
{
int permitted = 0;
struct afsconf_dir *acdir;
if (afsconf_SuperUser(acdir, call, NULL))
permitted = 1;
- exit:
if (acdir)
afsconf_Close(acdir);
return (permitted);
*/
afs_int32
-InitRPC(ut, lock, this_op)
- struct ubik_trans **ut;
- int lock; /* indicate read/write transaction */
- int this_op; /* opcode of RCP, for COUNT_ABO */
+InitRPC(struct ubik_trans **ut,
+ int lock, /* indicate read/write transaction */
+ int this_op) /* opcode of RCP, for COUNT_ABO */
{
int code;
float wait = 0.91; /* start waiting for 1 second */
start:
/* wait for server initialization to finish if this is not InitProcs calling */
if (this_op)
- if (code = AwaitInitialization())
+ if ((code = AwaitInitialization()))
return code;
for (code = UNOQUORUM; code == UNOQUORUM;) {
Log("Waiting for quorum election\n");
if (wait < 15.0)
wait *= 1.1;
+#ifdef AFS_PTHREAD_ENV
+ sleep((int)wait);
+#else
IOMGR_Sleep((int)wait);
+#endif
}
}
if (code)
Log("Have established quorum\n");
/* set lock at posiion 1, for 1 byte of type lock */
- if (code = ubik_SetLock(*ut, 1, 1, lock)) {
+ if ((code = ubik_SetLock(*ut, 1, 1, lock))) {
ubik_AbortTrans(*ut);
return code;
}
/* check that dbase is initialized and setup cheader */
if (lock == LOCKREAD) {
/* init but don't fix because this is read only */
- if (code = CheckInit(*ut, 0)) {
+ if ((code = CheckInit(*ut, 0))) {
ubik_AbortTrans(*ut);
- if (code = InitRPC(ut, LOCKWRITE, 0)) { /* Now fix the database */
+ if ((code = InitRPC(ut, LOCKWRITE, 0))) { /* Now fix the database */
LogError(code, "InitRPC: InitRPC failed\n");
return code;
}
- if (code = ubik_EndTrans(*ut)) {
+ if ((code = ubik_EndTrans(*ut))) {
LogError(code, "InitRPC: ubik_EndTrans failed\n");
return code;
}
goto start; /* now redo the read transaction */
}
} else {
- if (code = CheckInit(*ut, rebuildDatabase)) {
+ if ((code = CheckInit(*ut, rebuildDatabase))) {
ubik_AbortTrans(*ut);
return code;
}
/* This is called to initialize a newly created database */
static int
-initialize_database(ut)
- struct ubik_trans *ut;
+initialize_database(struct ubik_trans *ut)
{
return 0;
}
static int recheckNoAuth; /* global state */
afs_int32
-InitProcs()
+InitProcs(void)
{
struct ubik_trans *ut;
afs_int32 code = 0;
rebuildDatabase = initialize_database;
- if (code = InitRPC(&ut, LOCKREAD, 0)) {
+ if ((code = InitRPC(&ut, LOCKREAD, 0))) {
LogError(code, "InitProcs: InitRPC failed\n");
return code;
}
};
static void
-InitReturnList(list)
- struct returnList *list;
+InitReturnList(struct returnList *list)
{
list->nElements = 0;
list->allocSize = 0;
}
static void
-FreeReturnList(list)
- struct returnList *list;
+FreeReturnList(struct returnList *list)
{
if (list->elements)
free(list->elements);
* with SendReturnList(). The first *to_skipP are not recorded.
*/
static afs_int32
-AddToReturnList(list, a, to_skipP)
- struct returnList *list;
- dbadr a;
- afs_int32 *to_skipP;
+AddToReturnList(struct returnList *list, dbadr a, afs_int32 *to_skipP)
{
char *tmp;
afs_int32 size;
return 0;
}
- /* Up to 5 plus a maximum so SendReturnList() knows if we
+ /* Up to 5 plus a maximum so SendReturnList() knows if we
* need to come back for more.
*/
if (list->nElements >= BUDB_MAX_RETURN_LIST + 5)
tmp = (char *)malloc(sizeof(dbadr) * size);
} else {
size = list->allocSize + 10;
- tmp = (char *)realloc(list->elements, sizeof(dbadr) * size);
+ tmp = realloc(list->elements, sizeof(dbadr) * size);
}
if (!tmp)
return BUDB_NOMEM;
}
afs_int32
-FillVolEntry(ut, va, vol)
- struct ubik_trans *ut;
- dbadr va;
- struct budb_volumeEntry *vol;
+FillVolEntry(struct ubik_trans *ut, dbadr va, void *rock)
{
+ struct budb_volumeEntry *vol = (struct budb_volumeEntry *) rock;
struct dump d;
struct tape t;
struct volInfo vi;
}
afs_int32
-FillDumpEntry(ut, da, dump)
- struct ubik_trans *ut;
- dbadr da;
- struct budb_dumpEntry *dump;
+FillDumpEntry(struct ubik_trans *ut, dbadr da, void *rock)
{
+ struct budb_dumpEntry *dump = (struct budb_dumpEntry *)rock;
struct dump d, ad;
if (dbread(ut, da, &d, sizeof(d)))
}
afs_int32
-FillTapeEntry(ut, ta, tape)
- struct ubik_trans *ut;
- dbadr ta;
- struct budb_tapeEntry *tape;
+FillTapeEntry(struct ubik_trans *ut, dbadr ta, void *rock)
{
+ struct budb_tapeEntry *tape=(struct budb_tapeEntry *) rock;
struct tape t;
struct dump d;
afs_int32 code;
return BUDB_IO;
/* Get the tape's expiration date */
- if (code = getExpiration(ut, &t))
+ if ((code = getExpiration(ut, &t)))
return (code);
strcpy(tape->name, t.name);
* if there are more and how many to skip on the next request.
*/
static afs_int32
-SendReturnList(ut, list, FillProc, e_size, index, nextIndexP, dbTimeP, eList)
- struct ubik_trans *ut;
- struct returnList *list; /* list of elements to return */
-afs_int32(*FillProc) (); /* proc to fill entry */
- int e_size; /* size of each element */
- afs_int32 index; /* index from previous call */
- afs_int32 *nextIndexP; /* if more elements are available */
- afs_int32 *dbTimeP; /* time of last db update */
- budb_dumpList *eList; /* rxgen list structure (e.g.) */
+SendReturnList(struct ubik_trans *ut,
+ struct returnList *list, /* list of elements to return */
+ afs_int32(*FillProc) (struct ubik_trans *, dbadr da,
+ void *),
+ /* proc to fill entry */
+ int e_size, /* size of each element */
+ afs_int32 index, /* index from previous call */
+ afs_int32 *nextIndexP, /* if more elements are available */
+ afs_int32 *dbTimeP, /* time of last db update */
+ budb_dumpList *eList) /* rxgen list structure (e.g.) */
{
afs_int32 code;
int to_return;
/* Allocate space for the return values if needed and zero it */
if (eList->budb_dumpList_val == 0) {
- eList->budb_dumpList_val =
- (struct budb_dumpEntry *)malloc(e_size * to_return);
+ eList->budb_dumpList_val = calloc(to_return, e_size);
if (!eList->budb_dumpList_val)
return (BUDB_NOMEM);
+ } else {
+ memset(eList->budb_dumpList_val, 0, e_size * to_return);
}
- memset(eList->budb_dumpList_val, 0, e_size * to_return);
+
eList->budb_dumpList_len = to_return;
e = (char *)(eList->budb_dumpList_val);
for (i = 0; i < to_return; i++, e += e_size) {
- code = (*FillProc) (ut, list->elements[i], e);
+ code = (*FillProc) (ut, list->elements[i], (budb_dumpEntry *) e);
if (code)
return code;
}
/* Come here to delete a volInfo structure. */
static afs_int32
-DeleteVolInfo(ut, via, vi)
- struct ubik_trans *ut;
- dbadr via;
- struct volInfo *vi;
+DeleteVolInfo(struct ubik_trans *ut, dbadr via, struct volInfo *vi)
{
afs_int32 code;
dbadr hvia;
write it out. */
static afs_int32
-DeleteVolFragment(ut, va, v)
- struct ubik_trans *ut;
- dbadr va;
- struct volFragment *v;
+DeleteVolFragment(struct ubik_trans *ut, dbadr va, struct volFragment *v)
{
afs_int32 code;
struct volInfo vi;
if (code)
return code;
if (vi.firstFragment == 0)
- if (code = DeleteVolInfo(ut, via, &vi))
+ if ((code = DeleteVolInfo(ut, via, &vi)))
return code;
- if (code = FreeStructure(ut, volFragment_BLOCK, va))
+ if ((code = FreeStructure(ut, volFragment_BLOCK, va)))
return code;
/* decrement frag counter */
* also responsible for writing the tape out if necessary. */
static afs_int32
-DeleteTape(ut, ta, t)
- struct ubik_trans *ut;
- dbadr ta;
- struct tape *t;
+DeleteTape(struct ubik_trans *ut, dbadr ta, struct tape *t)
{
afs_int32 code;
struct dump d;
}
static afs_int32
-DeleteDump(ut, da, d)
- struct ubik_trans *ut;
- dbadr da;
- struct dump *d;
+DeleteDump(struct ubik_trans *ut, dbadr da, struct dump *d)
{
afs_int32 code = 0;
*/
static int
-VolInfoMatch(vol, vi)
- struct budb_volumeEntry *vol;
- struct volInfo *vi;
+VolInfoMatch(struct budb_volumeEntry *vol, struct volInfo *vi)
{
return ((strcmp(vol->name, vi->name) == 0) && /* same volume name */
(vol->id == ntohl(vi->id)) && /* same volume id */
*/
static afs_int32
-GetVolInfo(ut, volP, viaP, viP)
- struct ubik_trans *ut;
- struct budb_volumeEntry *volP;
- dbadr *viaP;
- struct volInfo *viP;
+GetVolInfo(struct ubik_trans *ut, struct budb_volumeEntry *volP, dbadr *viaP,
+ struct volInfo *viP)
{
dbadr hvia, via;
struct volInfo hvi;
if (eval)
ERROR(eval);
- LogDebug(4, "volume Info for %s placed at %d\n", db.volName, via);
+ LogDebug(4, "volume Info for %s placed at %d\n", volP->name, via);
}
else if (!VolInfoMatch(volP, viP)) { /* Not the head volinfo struct */
}
/* deletesomevolumesfromtape
- * Deletes a specified number of volumes from a tape. The tape
+ * Deletes a specified number of volumes from a tape. The tape
* and dump are modified to reflect the smaller number of volumes.
* The transaction is not terminated, it is up to the caller to
* finish the transaction and start a new one (if desired).
*/
afs_int32
-deleteSomeVolumesFromTape(ut, tapeAddr, tapePtr, maxVolumesToDelete)
- struct ubik_trans *ut;
- dbadr tapeAddr;
- struct tape *tapePtr;
- int maxVolumesToDelete;
+deleteSomeVolumesFromTape(struct ubik_trans *ut, dbadr tapeAddr,
+ struct tape *tapePtr, int maxVolumesToDelete)
{
dbadr volFragAddr, nextVolFragAddr, dumpAddr;
struct volFragment volFrag;
*/
afs_int32
-deleteDump(call, id, dumps)
- struct rx_call *call;
- dumpId id;
- budb_dumpsList *dumps;
+deleteDump(struct rx_call *call, dumpId id, budb_dumpsList *dumps)
{
struct ubik_trans *ut;
dbadr dumpAddr, tapeAddr, appendedDump;
struct dump dump;
struct tape tape;
dumpId dumpid;
- int firstdump;
afs_int32 eval, code = 0;
- int partialDel;
+ int partialDel = 0;
/* iterate until the dump is truly deleted */
(afs_int32 *) malloc(sizeof(afs_int32));
else
dumps->budb_dumpsList_val =
- (afs_int32 *) realloc(dumps->budb_dumpsList_val,
- (dumps->budb_dumpsList_len +
- 1) * sizeof(afs_int32));
+ realloc(dumps->budb_dumpsList_val,
+ (dumps->budb_dumpsList_len + 1)
+ * sizeof(afs_int32));
if (!dumps->budb_dumpsList_val)
ABORT(BUDB_NOMEM);
};
-wantDump(dumpAddrParam, dumpParam, dumpListPtrParam)
- char *dumpAddrParam;
- char *dumpParam;
- char *dumpListPtrParam;
+int
+wantDump(dbadr dumpAddr, void *dumpParam, void *dumpListPtrParam)
{
- dbadr dumpAddr;
struct dump *dumpPtr;
struct wantDumpRock *rockPtr;
- dumpAddr = (dbadr) dumpAddrParam;
dumpPtr = (struct dump *)dumpParam;
rockPtr = (struct wantDumpRock *)dumpListPtrParam;
return (0);
}
-rememberDump(dumpAddrParam, dumpParam, dumpListPtrParam)
- char *dumpAddrParam;
- char *dumpParam;
- char *dumpListPtrParam;
+int
+rememberDump(dbadr dumpAddr, void *dumpParam, void *dumpListPtrParam)
{
- dbadr dumpAddr;
struct dump *dumpPtr;
struct wantDumpRock *rockPtr;
struct chosenDump *ptr, *deletedPtr, **nextPtr;
- dumpAddr = (dbadr) dumpAddrParam;
dumpPtr = (struct dump *)dumpParam;
rockPtr = (struct wantDumpRock *)dumpListPtrParam;
- ptr = (struct chosenDump *)malloc(sizeof(*ptr));
+ ptr = calloc(1, sizeof(*ptr));
if (!ptr)
return (0);
- memset(ptr, 0, sizeof(*ptr));
ptr->addr = dumpAddr;
ptr->date = (afs_uint32) ntohl(dumpPtr->created);
*/
afs_int32
-SBUDB_AddVolume(call, vol)
- struct rx_call *call;
- struct budb_volumeEntry *vol;
+SBUDB_AddVolume(struct rx_call *call, struct budb_volumeEntry *vol)
{
afs_int32 code;
}
afs_int32
-AddVolume(call, vol)
- struct rx_call *call;
- struct budb_volumeEntry *vol;
+AddVolume(struct rx_call *call, struct budb_volumeEntry *vol)
{
struct ubik_trans *ut;
dbadr da, ta, via, va;
afs_int32
-SBUDB_AddVolumes(call, vols)
- struct rx_call *call;
- struct budb_volumeList *vols;
+SBUDB_AddVolumes(struct rx_call *call, struct budb_volumeList *vols)
{
afs_int32 code;
}
afs_int32
-AddVolumes(call, vols)
- struct rx_call *call;
- struct budb_volumeList *vols;
+AddVolumes(struct rx_call *call, struct budb_volumeList *vols)
{
struct budb_volumeEntry *vol, *vol1;
struct ubik_trans *ut;
*/
afs_int32
-SBUDB_CreateDump(call, dump)
- struct rx_call *call;
- struct budb_dumpEntry *dump;
+SBUDB_CreateDump(struct rx_call *call, struct budb_dumpEntry *dump)
{
afs_int32 code;
}
afs_int32
-CreateDump(call, dump)
- struct rx_call *call;
- struct budb_dumpEntry *dump;
+CreateDump(struct rx_call *call, struct budb_dumpEntry *dump)
{
struct ubik_trans *ut;
dbadr findDumpAddr, da;
}
/* dump id is in use - wait a while */
+#ifdef AFS_PTHREAD_ENV
+ sleep(1);
+#else
IOMGR_Sleep(1);
+#endif
} /*w */
} else {
/* dump id supplied (e.g. for database restore) */
dump->created = dump->id;
d.created = htonl(dump->created);
- principal_hton(&principal, &d.dumper);
+ principal = d.dumper;
tapeSet_hton(&dump->tapes, &d.tapes);
d.flags = htonl(dump->flags | BUDB_DUMP_INPROGRESS);
}
afs_int32
-SBUDB_DeleteDump(call, id, fromTime, toTime, dumps)
- struct rx_call *call;
- dumpId id;
- Date fromTime;
- Date toTime;
- budb_dumpsList *dumps;
+SBUDB_DeleteDump(struct rx_call *call, dumpId id, Date fromTime, Date toTime,
+ budb_dumpsList *dumps)
{
afs_int32 code;
#define MAXOFFS 30
afs_int32
-DoDeleteDump(call, id, fromTime, toTime, dumps)
- struct rx_call *call;
- dumpId id;
- Date fromTime;
- Date toTime;
- budb_dumpsList *dumps;
+DoDeleteDump(struct rx_call *call, dumpId id, Date fromTime, Date toTime,
+ budb_dumpsList *dumps)
{
afs_int32 code = 0;
}
afs_int32
-SBUDB_ListDumps(call, sflags, name, groupid, fromTime, toTime, dumps, flags)
- struct rx_call *call;
- afs_int32 sflags, groupid;
- char *name;
- Date fromTime, toTime;
- budb_dumpsList *dumps, *flags;
+SBUDB_ListDumps(struct rx_call *call, afs_int32 sflags, char *name,
+ afs_int32 groupid, Date fromTime, Date toTime,
+ budb_dumpsList *dumps, budb_dumpsList *flags)
{
afs_int32 code;
}
afs_int32
-ListDumps(call, sflags, groupid, fromTime, toTime, dumps, flags)
- struct rx_call *call;
- afs_int32 sflags, groupid;
- Date fromTime, toTime;
- budb_dumpsList *dumps, *flags;
+ListDumps(struct rx_call *call, afs_int32 sflags, afs_int32 groupid,
+ Date fromTime, Date toTime, budb_dumpsList *dumps,
+ budb_dumpsList *flags)
{
struct ubik_trans *ut;
struct memoryHashTable *mht;
dbadr dbAddr, dbAppAddr;
afs_int32 eval, code = 0;
- int old, hash, length, entrySize, j, k, count = 0;
- afs_uint32 toList, toFlag;
+ int old, hash, length, entrySize, count = 0;
if (!callPermitted(call))
return BUDB_NOTPERMITTED;
sizeof(afs_int32));
} else {
dumps->budb_dumpsList_val =
- (afs_int32 *) realloc(dumps->
- budb_dumpsList_val,
- count *
- sizeof(afs_int32));
+ realloc(dumps->budb_dumpsList_val,
+ count * sizeof(afs_int32));
flags->budb_dumpsList_val =
- (afs_int32 *) realloc(flags->
- budb_dumpsList_val,
- count *
- sizeof(afs_int32));
+ realloc(flags->budb_dumpsList_val,
+ count * sizeof(afs_int32));
}
if (!dumps->budb_dumpsList_val
|| !dumps->budb_dumpsList_val)
}
afs_int32
-SBUDB_DeleteTape(call, tape)
- struct rx_call *call;
- struct budb_tapeEntry *tape; /* tape info */
+SBUDB_DeleteTape(struct rx_call *call,
+ struct budb_tapeEntry *tape) /* tape info */
{
afs_int32 code;
}
afs_int32
-DoDeleteTape(call, tape)
- struct rx_call *call;
- struct budb_tapeEntry *tape; /* tape info */
+DoDeleteTape(struct rx_call *call,
+ struct budb_tapeEntry *tape) /* tape info */
{
struct ubik_trans *ut;
struct tape t;
*/
afs_int32
-SBUDB_DeleteVDP(call, dsname, dumpPath, curDumpId)
- struct rx_call *call;
- char *dsname;
- char *dumpPath;
- afs_int32 curDumpId;
+SBUDB_DeleteVDP(struct rx_call *call, char *dsname, char *dumpPath,
+ afs_int32 curDumpId)
{
afs_int32 code;
}
afs_int32
-DeleteVDP(call, dsname, dumpPath, curDumpId)
- struct rx_call *call;
- char *dsname;
- char *dumpPath;
- afs_int32 curDumpId;
+DeleteVDP(struct rx_call *call, char *dsname, char *dumpPath,
+ afs_int32 curDumpId)
{
struct dump dump;
dbadr dumpAddr;
/* BUDB_FindClone
* notes:
- * Given a volume name, and a dumpID, find the volume in that dump and
- * return the clone date of the volume (this is the clone date of the
+ * Given a volume name, and a dumpID, find the volume in that dump and
+ * return the clone date of the volume (this is the clone date of the
* volume at the time it was dumped).
- *
- * Hashes on the volume name and traverses the fragments. Will need to read
+ *
+ * Hashes on the volume name and traverses the fragments. Will need to read
* the volumes tape entry to determine if it belongs to the dump. If the
* volume is not found in the dump, then look for it in its parent dump.
*/
afs_int32
-SBUDB_FindClone(call, dumpID, volName, clonetime)
- struct rx_call *call;
- afs_int32 dumpID;
- char *volName;
- afs_int32 *clonetime;
+SBUDB_FindClone(struct rx_call *call, afs_int32 dumpID, char *volName,
+ afs_int32 *clonetime)
{
afs_int32 code;
}
afs_int32
-FindClone(call, dumpID, volName, clonetime)
- struct rx_call *call;
- afs_int32 dumpID;
- char *volName;
- afs_int32 *clonetime;
+FindClone(struct rx_call *call, afs_int32 dumpID, char *volName,
+ afs_int32 *clonetime)
{
struct ubik_trans *ut;
- dbadr da, ta, hvia, via, vfa;
+ dbadr da, hvia, via, vfa;
struct dump d;
struct tape t;
struct volFragment vf;
* Re-write to do lookups by volume name.
*/
afs_int32
-FindClone(call, dumpID, volName, clonetime)
- struct rx_call *call;
- afs_int32 dumpID;
- char *volName;
- afs_int32 *clonetime;
+FindClone(struct rx_call *call, afs_int32 dumpID, char *volName,
+ afs_int32 *clonetime)
{
struct ubik_trans *ut;
dbadr diskAddr, tapeAddr, volFragmentAddr;
*/
afs_int32
-SBUDB_FindDump(call, volumeName, beforeDate, deptr)
- struct rx_call *call;
- char *volumeName;
- afs_int32 beforeDate;
- struct budb_dumpEntry *deptr;
+SBUDB_FindDump(struct rx_call *call, char *volumeName, afs_int32 beforeDate,
+ struct budb_dumpEntry *deptr)
{
afs_int32 code;
}
afs_int32
-FindDump(call, volumeName, beforeDate, deptr)
- struct rx_call *call;
- char *volumeName;
- afs_int32 beforeDate;
- struct budb_dumpEntry *deptr;
+FindDump(struct rx_call *call, char *volumeName, afs_int32 beforeDate,
+ struct budb_dumpEntry *deptr)
{
struct ubik_trans *ut;
dbadr volInfoAddr, volFragmentAddr;
*/
afs_int32
-SBUDB_FindLatestDump(call, vsname, dumpPath, dumpentry)
- struct rx_call *call;
- char *vsname, *dumpPath;
- struct budb_dumpEntry *dumpentry;
+SBUDB_FindLatestDump(struct rx_call *call, char *vsname, char *dumpPath,
+ struct budb_dumpEntry *dumpentry)
{
afs_int32 code;
}
afs_int32
-FindLatestDump(call, vsname, dumpPath, dumpentry)
- struct rx_call *call;
- char *vsname, *dumpPath;
- struct budb_dumpEntry *dumpentry;
+FindLatestDump(struct rx_call *call, char *vsname, char *dumpPath,
+ struct budb_dumpEntry *dumpentry)
{
struct ubik_trans *ut;
dbadr curdbaddr, retdbaddr, firstdbaddr;
afs_int32
-SBUDB_FinishDump(call, dump)
- struct rx_call *call;
- struct budb_dumpEntry *dump;
+SBUDB_FinishDump(struct rx_call *call, struct budb_dumpEntry *dump)
{
afs_int32 code;
}
afs_int32
-FinishDump(call, dump)
- struct rx_call *call;
- struct budb_dumpEntry *dump;
+FinishDump(struct rx_call *call, struct budb_dumpEntry *dump)
{
struct ubik_trans *ut;
dbadr a;
}
afs_int32
-SBUDB_FinishTape(call, tape)
- struct rx_call *call;
- struct budb_tapeEntry *tape;
+SBUDB_FinishTape(struct rx_call *call, struct budb_tapeEntry *tape)
{
afs_int32 code;
}
afs_int32
-FinishTape(call, tape)
- struct rx_call *call;
- struct budb_tapeEntry *tape;
+FinishTape(struct rx_call *call, struct budb_tapeEntry *tape)
{
struct ubik_trans *ut;
dbadr a;
* flags - for search and select operations. Broken down into flags
* for name, start point, end point and time.
* name - name to search for. Interpretation based on flags
- * end
+ * end
* index
* nextIndexP
* dbTimeP
* exit:
- * nextIndexP
+ * nextIndexP
* dbTimeP - time at which the database was last modified. Up to
* caller (client) to take appropriate action if database
* modified between successive calls
*/
afs_int32
-SBUDB_GetDumps(call, majorVersion, flags, name, start, end, index, nextIndexP,
- dbTimeP, dumps)
- struct rx_call *call;
- afs_int32 majorVersion; /* version of interface structures */
- afs_int32 flags; /* search & select controls */
- char *name; /* s&s parameters */
- afs_int32 start;
- afs_int32 end;
- afs_int32 index; /* start index of returned entries */
- afs_int32 *nextIndexP; /* output index for next call */
- afs_int32 *dbTimeP;
- budb_dumpList *dumps; /* pointer to buffer */
+SBUDB_GetDumps(struct rx_call *call,
+ afs_int32 majorVersion, /* version of interface structures */
+ afs_int32 flags, /* search & select controls */
+ char *name, /* s&s parameters */
+ afs_int32 start,
+ afs_int32 end,
+ afs_int32 index, /* start index of returned entries */
+ afs_int32 *nextIndexP, /* output index for next call */
+ afs_int32 *dbTimeP,
+ budb_dumpList *dumps) /* pointer to buffer */
{
afs_int32 code;
}
afs_int32
-GetDumps(call, majorVersion, flags, name, start, end, index, nextIndexP,
- dbTimeP, dumps)
- struct rx_call *call;
- afs_int32 majorVersion; /* version of interface structures */
- afs_int32 flags; /* search & select controls */
- char *name; /* s&s parameters */
- afs_int32 start;
- afs_int32 end;
- afs_int32 index; /* start index of returned entries */
- afs_int32 *nextIndexP; /* output index for next call */
- afs_int32 *dbTimeP;
- budb_dumpList *dumps; /* pointer to buffer */
+GetDumps(struct rx_call *call,
+ afs_int32 majorVersion, /* version of interface structures */
+ afs_int32 flags, /* search & select controls */
+ char *name, /* s&s parameters */
+ afs_int32 start,
+ afs_int32 end,
+ afs_int32 index, /* start index of returned entries */
+ afs_int32 *nextIndexP, /* output index for next call */
+ afs_int32 *dbTimeP,
+ budb_dumpList *dumps) /* pointer to buffer */
{
struct ubik_trans *ut;
dbadr da;
struct wantDumpRock rock;
struct chosenDump *ptr, *nextPtr;
- extern wantDump(), rememberDump();
-
/* no other flags should be set */
/* end specifies how many dumps */
if (eval)
ABORT(eval);
- error_exit:
FreeReturnList(&list);
code = ubik_EndTrans(ut);
return code;
return code;
}
-/*
+/*
* Get the expiration of a tape. Since the dump could have appended dumps,
- * we should use the most recent expiration date. Put the most recent
+ * we should use the most recent expiration date. Put the most recent
* expiration tape into the given tape structure.
*/
afs_int32
-getExpiration(ut, tapePtr)
- struct ubik_trans *ut;
- struct tape *tapePtr;
+getExpiration(struct ubik_trans *ut, struct tape *tapePtr)
{
dbadr ad;
struct dump d;
tapePtr->expires = t.expires;
/* Step to and read the next appended dump */
- if (ad = ntohl(d.appendedDumpChain)) {
+ if ((ad = ntohl(d.appendedDumpChain))) {
eval = dbread(ut, ad, &d, sizeof(d));
if (eval)
ERROR(eval);
/* Mark the following dump as appended to another, intial dump */
afs_int32
-makeAppended(ut, appendedDumpID, initialDumpID, startTapeSeq)
- struct ubik_trans *ut;
- afs_int32 appendedDumpID;
- afs_int32 initialDumpID;
- afs_int32 startTapeSeq;
+makeAppended(struct ubik_trans *ut, afs_int32 appendedDumpID,
+ afs_int32 initialDumpID, afs_int32 startTapeSeq)
{
dbadr ada, da, lastDumpAddr;
struct dump ad, d;
/* Update the appended dump's tape format with that of the initial */
strcpy(ad.tapes.format, d.tapes.format);
- /* starting with the initial dump step through its appended dumps till
- * we reach the last appended dump.
+ /* starting with the initial dump step through its appended dumps till
+ * we reach the last appended dump.
*/
lastDumpAddr = da;
while (d.appendedDumpChain) {
}
afs_int32
-SBUDB_MakeDumpAppended(call, appendedDumpID, initialDumpID, startTapeSeq)
- struct rx_call *call;
- afs_int32 appendedDumpID;
- afs_int32 initialDumpID;
- afs_int32 startTapeSeq;
+SBUDB_MakeDumpAppended(struct rx_call *call, afs_int32 appendedDumpID,
+ afs_int32 initialDumpID, afs_int32 startTapeSeq)
{
afs_int32 code;
}
afs_int32
-MakeDumpAppended(call, appendedDumpID, initialDumpID, startTapeSeq)
- struct rx_call *call;
- afs_int32 appendedDumpID;
- afs_int32 initialDumpID;
- afs_int32 startTapeSeq;
+MakeDumpAppended(struct rx_call *call, afs_int32 appendedDumpID,
+ afs_int32 initialDumpID, afs_int32 startTapeSeq)
{
struct ubik_trans *ut;
afs_int32 eval, code = 0;
/* Find the last tape of a dump-set. This includes any appended dumps */
afs_int32
-SBUDB_FindLastTape(call, dumpID, dumpEntry, tapeEntry, volEntry)
- struct rx_call *call;
- afs_int32 dumpID;
- struct budb_dumpEntry *dumpEntry;
- struct budb_tapeEntry *tapeEntry;
- struct budb_volumeEntry *volEntry;
+SBUDB_FindLastTape(struct rx_call *call, afs_int32 dumpID,
+ struct budb_dumpEntry *dumpEntry,
+ struct budb_tapeEntry *tapeEntry,
+ struct budb_volumeEntry *volEntry)
{
afs_int32 code;
}
afs_int32
-FindLastTape(call, dumpID, dumpEntry, tapeEntry, volEntry)
- struct rx_call *call;
- afs_int32 dumpID;
- struct budb_dumpEntry *dumpEntry;
- struct budb_tapeEntry *tapeEntry;
- struct budb_volumeEntry *volEntry;
+FindLastTape(struct rx_call *call, afs_int32 dumpID,
+ struct budb_dumpEntry *dumpEntry,
+ struct budb_tapeEntry *tapeEntry,
+ struct budb_volumeEntry *volEntry)
{
struct ubik_trans *ut;
struct dump d;
afs_int32
-SBUDB_GetTapes(call, majorVersion, flags, name, start, end, index, nextIndexP,
- dbTimeP, tapes)
- struct rx_call *call;
- afs_int32 majorVersion; /* version of interface structures */
- afs_int32 flags; /* search & select controls */
- char *name; /* s&s parameters */
- afs_int32 start;
- afs_int32 end; /* reserved: MBZ */
- afs_int32 index; /* start index of returned entries */
- afs_int32 *nextIndexP; /* output index for next call */
- afs_int32 *dbTimeP;
- budb_tapeList *tapes; /* pointer to buffer */
+SBUDB_GetTapes(struct rx_call *call,
+ afs_int32 majorVersion, /* version of interface structures */
+ afs_int32 flags, /* search & select controls */
+ char *name, /* s&s parameters */
+ afs_int32 start,
+ afs_int32 end, /* reserved: MBZ */
+ afs_int32 index, /* start index of returned entries */
+ afs_int32 *nextIndexP, /* output index for next call */
+ afs_int32 *dbTimeP,
+ budb_tapeList *tapes) /* pointer to buffer */
{
afs_int32 code;
}
afs_int32
-GetTapes(call, majorVersion, flags, name, start, end, index, nextIndexP,
- dbTimeP, tapes)
- struct rx_call *call;
- afs_int32 majorVersion; /* version of interface structures */
- afs_int32 flags; /* search & select controls */
- char *name; /* s&s parameters */
- afs_int32 start;
- afs_int32 end; /* reserved: MBZ */
- afs_int32 index; /* start index of returned entries */
- afs_int32 *nextIndexP; /* output index for next call */
- afs_int32 *dbTimeP;
- budb_tapeList *tapes; /* pointer to buffer */
+GetTapes(struct rx_call *call,
+ afs_int32 majorVersion, /* version of interface structures */
+ afs_int32 flags, /* search & select controls */
+ char *name, /* s&s parameters */
+ afs_int32 start,
+ afs_int32 end, /* reserved: MBZ */
+ afs_int32 index, /* start index of returned entries */
+ afs_int32 *nextIndexP, /* output index for next call */
+ afs_int32 *dbTimeP,
+ budb_tapeList *tapes) /* pointer to buffer */
{
struct ubik_trans *ut;
dbadr da, ta;
*/
afs_int32
-SBUDB_GetVolumes(call, majorVersion, flags, name, start, end, index,
- nextIndexP, dbTimeP, volumes)
- struct rx_call *call;
- afs_int32 majorVersion; /* version of interface structures */
- afs_int32 flags; /* search & select controls */
- char *name; /* - parameters for search */
- afs_int32 start; /* - usage depends which BUDP_OP_* */
- afs_int32 end; /* - bits are set */
- afs_int32 index; /* start index of returned entries */
- afs_int32 *nextIndexP; /* output index for next call */
- afs_int32 *dbTimeP;
- budb_volumeList *volumes; /* pointer to buffer */
+SBUDB_GetVolumes(struct rx_call *call,
+ afs_int32 majorVersion, /* version of interface structures */
+ afs_int32 flags, /* search & select controls */
+ char *name, /* - parameters for search */
+ afs_int32 start, /* - usage depends which BUDP_OP */
+ afs_int32 end, /* - bits are set */
+ afs_int32 index, /* start index of returned entries */
+ afs_int32 *nextIndexP, /* output index for next call */
+ afs_int32 *dbTimeP,
+ budb_volumeList *volumes) /* pointer to buffer */
{
afs_int32 code;
}
afs_int32
-GetVolumes(call, majorVersion, flags, name, start, end, index, nextIndexP,
- dbTimeP, volumes)
- struct rx_call *call;
- afs_int32 majorVersion; /* version of interface structures */
- afs_int32 flags; /* search & select controls */
- char *name; /* - parameters for search */
- afs_int32 start; /* - usage depends which BUDP_OP_* */
- afs_int32 end; /* - bits are set */
- afs_int32 index; /* start index of returned entries */
- afs_int32 *nextIndexP; /* output index for next call */
- afs_int32 *dbTimeP;
- budb_volumeList *volumes; /* pointer to buffer */
+GetVolumes(struct rx_call *call,
+ afs_int32 majorVersion, /* version of interface structures */
+ afs_int32 flags, /* search & select controls */
+ char *name, /* - parameters for search */
+ afs_int32 start, /* - usage depends which BUDP_OP_* */
+ afs_int32 end, /* - bits are set */
+ afs_int32 index, /* start index of returned entries */
+ afs_int32 *nextIndexP, /* output index for next call */
+ afs_int32 *dbTimeP,
+ budb_volumeList *volumes) /* pointer to buffer */
{
struct ubik_trans *ut;
dbadr via;
if (eval)
ABORT(eval);
- error_exit:
+ /* error_exit: */
FreeReturnList(&vollist);
code = ubik_EndTrans(ut);
return code;
}
afs_int32
-SBUDB_UseTape(call, tape, new)
- struct rx_call *call;
- struct budb_tapeEntry *tape; /* tape info */
- afs_int32 *new; /* set if tape is new */
+SBUDB_UseTape(struct rx_call *call,
+ struct budb_tapeEntry *tape, /* tape info */
+ afs_int32 *new) /* set if tape is new */
{
afs_int32 code;
}
afs_int32
-UseTape(call, tape, new)
- struct rx_call *call;
- struct budb_tapeEntry *tape; /* tape info */
- int *new; /* set if tape is new */
+UseTape(struct rx_call *call,
+ struct budb_tapeEntry *tape, /* tape info */
+ int *new) /* set if tape is new */
{
struct ubik_trans *ut;
dbadr da, a;
*/
afs_int32
-SBUDB_T_DumpHashTable(call, type, filename)
- struct rx_call *call;
- afs_int32 type;
- char *filename;
+SBUDB_T_DumpHashTable(struct rx_call *call, afs_int32 type, char *filename)
{
afs_int32 code;
}
afs_int32
-T_DumpHashTable(call, type, filename)
- struct rx_call *call;
- int type;
- char *filename;
+T_DumpHashTable(struct rx_call *call, int type, char *filename)
{
struct ubik_trans *ut;
struct memoryHashTable *mht;
afs_uint32 hash;
dbadr a, first_a;
char e[sizeof(struct block)]; /* unnecessarily conservative */
+ struct dump e_dump;
+ struct tape e_tape;
+ struct volInfo e_volinfo;
int e_size;
int old;
fprintf(DUMP, " at %d is ", a);
switch (type) {
case HT_dumpIden_FUNCTION:
- fprintf(DUMP, "%d\n", ntohl(((struct dump *)e)->id));
+ memcpy(&e_dump, e, sizeof(e_dump));
+ fprintf(DUMP, "%d\n", ntohl(e_dump.id));
break;
case HT_dumpName_FUNCTION:
- fprintf(DUMP, "%s\n", ((struct dump *)e)->dumpName);
+ memcpy(&e_dump, e, sizeof(e_dump));
+ fprintf(DUMP, "%s\n", e_dump.dumpName);
break;
case HT_tapeName_FUNCTION:
- fprintf(DUMP, "%s\n", ((struct tape *)e)->name);
+ memcpy(&e_tape, e, sizeof(e_tape));
+ fprintf(DUMP, "%s\n", e_tape.name);
break;
case HT_volName_FUNCTION:
- fprintf(DUMP, "%s\n", ((struct volInfo *)e)->name);
+ memcpy(&e_volinfo, e, sizeof(e_volinfo));
+ fprintf(DUMP, "%s\n", e_volinfo.name);
break;
}
if ((ht_HashEntry(mht, e) % length) != hash)
}
afs_int32
-SBUDB_T_GetVersion(call, majorVersion)
- struct rx_call *call;
- afs_int32 *majorVersion;
+SBUDB_T_GetVersion(struct rx_call *call, afs_int32 *majorVersion)
{
afs_int32 code;
}
afs_int32
-T_GetVersion(call, majorVersion)
- struct rx_call *call;
- int *majorVersion;
+T_GetVersion(struct rx_call *call, int *majorVersion)
{
struct ubik_trans *ut;
afs_int32 code;
*/
afs_int32
-SBUDB_T_DumpDatabase(call, filename)
- struct rx_call *call;
- char *filename;
+SBUDB_T_DumpDatabase(struct rx_call *call, char *filename)
{
afs_int32 code;
}
afs_int32
-T_DumpDatabase(call, filename)
- struct rx_call *call;
- char *filename;
+T_DumpDatabase(struct rx_call *call, char *filename)
{
FILE *dumpfid;
int entrySize;
char *path = 0;
dbadr dbAddr;
int type, old, length, hash;
- int block, index;
struct memoryHashTable *mht;
afs_int32 eval, code = 0;
if (!callPermitted(call))
return BUDB_NOTPERMITTED;
- path = (char *)malloc(strlen(gettmpdir()) + 1 + strlen(filename) + 1);
+ asprintf(&path, "%s/%s", gettmpdir(), filename);
if (!path)
return (BUDB_INTERNALERROR);
- sprintf(path, "%s/%s", gettmpdir(), filename);
-
dumpfid = fopen(path, "w");
if (!dumpfid)
return (BUDB_BADARGUMENT);
ERROR(eval);
fprintf(dumpfid,
- "\ndumpId hash %d, entry at %u: block %d, index %d\n",
- hash, dbAddr, block, index);
+ "\ndumpId hash %d, entry at %u\n",
+ hash, dbAddr);
fprintf(dumpfid,
"----------------------------\n");
dump_ntoh(&diskDump, &hostDump);
ERROR(eval);
fprintf(dumpfid,
- "\ndumpname hash %d, entry at %u: block %d, index %d\n",
- hash, dbAddr, block, index);
+ "\ndumpname hash %d, entry at %u\n",
+ hash, dbAddr);
fprintf(dumpfid,
"----------------------------\n");
dump_ntoh(&diskDump, &hostDump);
ERROR(eval);
fprintf(dumpfid,
- "\ntapename hash %d, entry at %u: block %d, index %d\n",
- hash, dbAddr, block, index);
+ "\ntapename hash %d, entry at %u\n",
+ hash, dbAddr);
fprintf(dumpfid,
"----------------------------\n");
tape_ntoh(&diskTape, &hostTape);
ERROR(eval);
fprintf(dumpfid,
- "\nvolname hash %d, entry at %u: block %d, index %d\n",
- hash, dbAddr, block, index);
+ "\nvolname hash %d, entry at %u\n",
+ hash, dbAddr);
fprintf(dumpfid,
"----------------------------\n");
volInfo_ntoh(&diskVolInfo, &hostVolInfo);
return (code);
}
-volFragsDump(ut, dumpfid, dbAddr)
- struct ubik_trans *ut;
- FILE *dumpfid;
- dbadr dbAddr;
+int
+volFragsDump(struct ubik_trans *ut, FILE *dumpfid, dbadr dbAddr)
{
struct volFragment hostVolFragment, diskVolFragment;
afs_int32 code;
- int block, index;
while (dbAddr) {
code =
return (0);
}
- fprintf(dumpfid, "\nvolfragment entry at %u: block %d, index %d\n",
- dbAddr, block, index);
+ fprintf(dumpfid, "\nvolfragment entry at %u\n", dbAddr);
fprintf(dumpfid, "----------------------------\n");
volFragment_ntoh(&diskVolFragment, &hostVolFragment);
printVolFragment(dumpfid, &hostVolFragment);
* currently used for debug only
*/
-volFragmentDiskToHost(diskVfPtr, hostVfPtr)
- struct volFragment *diskVfPtr, *hostVfPtr;
+void
+volFragmentDiskToHost(struct volFragment *diskVfPtr,
+ struct volFragment *hostVfPtr)
{
hostVfPtr->vol = ntohl(diskVfPtr->vol);
hostVfPtr->sameNameChain = ntohl(diskVfPtr->sameNameChain);
hostVfPtr->sequence = ntohs(diskVfPtr->sequence);
}
-volInfoDiskToHost(diskViPtr, hostViPtr)
- struct volInfo *diskViPtr, *hostViPtr;
+void
+volInfoDiskToHost(struct volInfo *diskViPtr, struct volInfo *hostViPtr)
{
strcpy(hostViPtr->name, diskViPtr->name);
hostViPtr->nameHashChain = ntohl(diskViPtr->nameHashChain);
hostViPtr->nFrags = ntohl(diskViPtr->nFrags);
}
-tapeDiskToHost(diskTapePtr, hostTapePtr)
- struct tape *diskTapePtr, *hostTapePtr;
+void
+tapeDiskToHost(struct tape *diskTapePtr, struct tape *hostTapePtr)
{
strcpy(hostTapePtr->name, diskTapePtr->name);
hostTapePtr->nameHashChain = ntohl(diskTapePtr->nameHashChain);
hostTapePtr->useCount = ntohl(diskTapePtr->useCount);
}
-dumpDiskToHost(diskDumpPtr, hostDumpPtr)
- struct dump *diskDumpPtr, *hostDumpPtr;
+void
+dumpDiskToHost(struct dump *diskDumpPtr, struct dump *hostDumpPtr)
{
hostDumpPtr->id = ntohl(diskDumpPtr->id);
hostDumpPtr->idHashChain = ntohl(diskDumpPtr->idHashChain);
#endif /* notdef */
-checkHash(ut, hashType)
- struct ubik_trans *ut;
- int hashType;
+int
+checkHash(struct ubik_trans *ut, int hashType)
{
struct memoryHashTable *mhtPtr;
int entrySize, hashTableLength;
int bucket;
int old;
- afs_int32 code;
+ afs_int32 code = 0;
mhtPtr = ht_GetType(hashType, &entrySize);
if (mhtPtr == 0)