--- /dev/null
+/*
+ * 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
+ */
+
+#ifndef _BUDB_PROTOTYPES_H
+#define _BUDB_PROTOTYPES_H
+
+/* budb.ss.c */
+int BUDB_ExecuteRequest(register struct rx_call *z_call);
+
+/* db_alloc.c */
+afs_int32 InitDBalloc(void);
+afs_int32 AllocStructure(struct ubik_trans *ut, char type, dbadr related,
+ dbadr *saP, void *s);
+afs_int32 FreeStructure(struct ubik_trans *ut, char type, dbadr sa);
+afs_int32 AllocBlock(struct ubik_trans *, struct block *, dbadr *);
+afs_int32 FreeBlock(struct ubik_trans *, struct blockHeader *, dbadr);
+
+/* db_dump.c */
+afs_int32 writeDatabase(struct ubik_trans *, int);
+
+/* db_hash.c */
+
+afs_int32 InitDBhash(void);
+void ht_DBInit(void);
+afs_int32 ht_HashOut(struct ubik_trans *ut, struct memoryHashTable *mht,
+ dbadr ea, void *e);
+afs_int32 RemoveFromList(struct ubik_trans *ut, dbadr ea, void *e,
+ dbadr *head, dbadr ta, void *t, dbadr *thread);
+afs_int32 ht_LookupEntry(struct ubik_trans *ut, struct memoryHashTable *mht,
+ void *key, dbadr *eaP, void *e);
+afs_int32 ht_HashIn(struct ubik_trans *ut, struct memoryHashTable *mht,
+ dbadr ea, void *e);
+afs_int32 scanHashTable(struct ubik_trans *ut, struct memoryHashTable *mhtPtr,
+ int (*selectFn) (dbadr, void *, void *),
+ int (*operationFn) (dbadr, void *, void *),
+ void *rockPtr);
+
+/* db_lock.c */
+int checkLockHandle(struct ubik_trans *, afs_uint32);
+
+/* dbs_dump.c */
+afs_int32 badEntry(afs_uint32 dbAddr);
+
+/* ol_verify.c */
+afs_int32 checkDiskAddress(unsigned long, int, int *, int *);
+
+/* procs.c */
+afs_int32 InitProcs(void);
+int callPermitted(struct rx_call *);
+afs_int32 InitRPC(struct ubik_trans **, int lock, int this_op);
+
+/* server.c */
+
+void Log(char *fmt, ... );
+void LogError(long code, char *fmt, ... );
+void LogDebug(int level, char *fmt, ... );
+
+/* struct_ops.c */
+
+void tape_ntoh(struct tape *, struct tape *);
+void principal_hton(struct budb_principal *, struct budb_principal *);
+void principal_ntoh(struct budb_principal *, struct budb_principal *);
+void structDumpHeader_hton(struct structDumpHeader *,
+ struct structDumpHeader *);
+
+int tapeSet_ntoh(struct budb_tapeSet *, struct budb_tapeSet *);
+int tapeSet_hton(struct budb_tapeSet *, struct budb_tapeSet *);
+void volInfo_ntoh(struct volInfo *, struct volInfo *);
+void volFragment_ntoh(struct volFragment *, struct volFragment *);
+void dump_ntoh(struct dump *, struct dump *);
+
+int dumpToBudbDump(dbDumpP, struct budb_dumpEntry *);
+
+int tapeToBudbTape(struct tape *r, struct budb_tapeEntry *);
+int volsToBudbVol(struct volFragment *, struct volInfo *,
+ struct budb_volumeEntry *);
+
+
+void printDump(FILE *, struct dump *);
+int printPrincipal(struct budb_principal *ptr);
+int printTape(FILE *, struct tape *);
+int printTapeSet(struct budb_tapeSet *, afs_int32);
+int printVolInfo(FILE *, struct volInfo *);
+int printVolFragment(FILE *, struct volFragment *);
+int printMemoryHashTable(FILE *, struct memoryHashTable *);
+
+/* database.c */
+afs_int32 CheckInit(struct ubik_trans *, int (*db_init) (struct ubik_trans *));
+afs_int32 InitDB(void);
+
+#endif
#include "budb_errs.h"
#include "database.h"
#include "error_macros.h"
+#include "budb_prototypes.h"
#include "afs/audit.h"
#include <string.h>
struct memoryDB db; /* really allocate it here */
void
-db_panic(reason)
- char *reason;
+db_panic(char *reason)
{
LogError(0, "db_panic: %s\n", reason);
BUDB_EXIT(-1);
}
afs_int32
-InitDB()
+InitDB(void)
{
afs_int32 code;
manner, to avoid bogusly reinitializing the db. */
afs_int32
-CheckInit(ut, db_init)
- struct ubik_trans *ut;
- int (*db_init) (); /* procedure to call if rebuilding DB */
+CheckInit(struct ubik_trans *ut,
+ int (*db_init) (struct ubik_trans *ut)) /* call if rebuilding DB */
{
register afs_int32 code;
#define MAX(x,y) ((x) > (y) ? (x) : (y))
#endif /* notdef */
-struct memoryHashTable *ht_GetType();
-extern afs_uint32 ht_HashEntry();
-extern dbadr ht_LookupBucket();
+struct memoryHashTable *ht_GetType(int type, int *e_sizeP);
+extern afs_uint32 ht_HashEntry(struct memoryHashTable *mht, char *e);
+extern dbadr ht_LookupBucket(struct ubik_trans *ut,
+ struct memoryHashTable *mht,
+ afs_uint32 hash, int old);
extern afs_int32 dbwrite(struct ubik_trans *ut, afs_int32 pos, void *buff, afs_int32 len);
extern afs_int32 dbread(struct ubik_trans *ut, afs_int32 pos, void *buff, afs_int32 len);
#include <afs/bubasics.h>
#include "budb_errs.h"
#include "database.h"
-
+#include "budb_prototypes.h"
/* block and structure allocation routines */
static int sizeEntries[NBLOCKTYPES];
afs_int32
-InitDBalloc()
+InitDBalloc(void)
{
nEntries[0] = 0;
sizeEntries[0] = 0;
*/
afs_int32
-AllocBlock(ut, block, aP)
- struct ubik_trans *ut;
- struct block *block; /* copy of data */
- dbadr *aP; /* db addr of block */
+AllocBlock(struct ubik_trans *ut,
+ struct block *block, /* copy of data */
+ dbadr *aP) /* db addr of block */
{
dbadr a;
*/
afs_int32
-FreeBlock(ut, bh, a)
- struct ubik_trans *ut;
- struct blockHeader *bh; /* copy of data */
- dbadr a; /* db address of block */
+FreeBlock(struct ubik_trans *ut,
+ struct blockHeader *bh, /* copy of data */
+ dbadr a) /* db address of block */
{
if (a != BlockBase(a))
db_panic("Block addr no good");
*/
afs_int32
-AllocStructure(ut, type, related, saP, s)
- struct ubik_trans *ut;
- char type;
- dbadr related;
- dbadr *saP;
- char *s;
+AllocStructure(struct ubik_trans *ut, char type, dbadr related, dbadr *saP, void *s)
{
dbadr a; /* block addr */
struct block b; /* copy of data */
}
bs = (afs_int32 *) b.a; /* ptr to first structure of block */
- if (db.h.freePtrs[type] == 0) {
+ if (db.h.freePtrs[(int) type] == 0) {
/* no free items of specified type */
if (AllocBlock(ut, &b, &a)
- || set_header_word(ut, freePtrs[type], htonl(a))
+ || set_header_word(ut, freePtrs[(int) type], htonl(a))
) {
return BUDB_IO;
}
b.h.next = 0;
b.h.type = type;
b.h.flags = 0;
- b.h.nFree = ntohs(nEntries[type] - 1);
+ b.h.nFree = ntohs(nEntries[(int) type] - 1);
*bs = 1; /* not free anymore */
if (dbwrite(ut, a, (char *)&b, sizeof(b)))
*/
while (1) {
- a = ntohl(db.h.freePtrs[type]);
+ a = ntohl(db.h.freePtrs[(int) type]);
if (dbread(ut, a, (char *)&b, sizeof(b)))
return BUDB_IO;
/* Completely empty blocks go to generic free list if there are
* more blocks on this free list
*/
- if (b.h.next && (nFree == nEntries[type]) && (count-- > 0)) {
- if (set_header_word(ut, freePtrs[type], b.h.next)
+ if (b.h.next && (nFree == nEntries[(int) type]) && (count-- > 0)) {
+ if (set_header_word(ut, freePtrs[(int) type], b.h.next)
|| FreeBlock(ut, &b.h, a)
) {
return BUDB_IO;
/* we found a free structure */
if (nFree == 1) {
/* if last free one: unthread block */
- if (set_header_word(ut, freePtrs[type], b.h.next))
+ if (set_header_word(ut, freePtrs[(int) type], b.h.next))
return BUDB_IO;
}
break;
i = 0;
while (*bs) {
i++;
- bs = (afs_int32 *) ((char *)bs + sizeEntries[type]);
+ bs = (afs_int32 *) ((char *)bs + sizeEntries[(int) type]);
}
- if (i >= nEntries[type])
+ if (i >= nEntries[(int) type])
db_panic("free count inconsistent with block");
b.h.nFree = htons(nFree - 1);
afs_int32
-FreeStructure(ut, type, sa)
- struct ubik_trans *ut;
- char type; /* type of structure to allocate */
- dbadr sa; /* db addr of structure */
+FreeStructure(struct ubik_trans *ut,
+ char type, /* type of structure to allocate */
+ dbadr sa) /* db addr of structure */
{
struct blockHeader bh; /* header of containing block */
dbadr a; /* db address of block */
db_panic("block and structure of different types");
bh.nFree = htons(nFree = ntohs(bh.nFree) + 1);
- if (nFree > nEntries[type])
+ if (nFree > nEntries[(int) type])
db_panic("free count too large");
if (nFree == 1) { /* add to free list for type */
- bh.next = db.h.freePtrs[type];
- if (set_header_word(ut, freePtrs[type], htonl(a)))
+ bh.next = db.h.freePtrs[(int) type];
+ if (set_header_word(ut, freePtrs[(int) type], htonl(a)))
return BUDB_IO;
}
#include "globals.h"
#include "error_macros.h"
#include "budb_errs.h"
+#include "budb_prototypes.h"
#include "afs/audit.h"
*/
afs_int32
-canWrite(fid)
- int fid;
+canWrite(int fid)
{
afs_int32 code = 0;
extern dumpSyncP dumpSyncPtr;
*/
void
-haveWritten(nbytes)
- afs_int32 nbytes;
+haveWritten(afs_int32 nbytes)
{
afs_int32 code = 0;
extern dumpSyncP dumpSyncPtr;
*/
void
-doneWriting(error)
- afs_int32 error;
+doneWriting(afs_int32 error)
{
afs_int32 code = 0;
*/
afs_int32
-writeStructHeader(fid, type)
- int fid;
- afs_int32 type;
+writeStructHeader(int fid, afs_int32 type)
{
struct structDumpHeader hostDumpHeader, netDumpHeader;
*/
afs_int32
-writeTextHeader(fid, type)
- int fid;
- afs_int32 type;
+writeTextHeader(int fid, afs_int32 type)
{
struct structDumpHeader hostDumpHeader, netDumpHeader;
}
afs_int32
-writeDbHeader(fid)
- int fid;
+writeDbHeader(int fid)
{
struct DbHeader header;
afs_int32 curtime;
*/
afs_int32
-writeDump(fid, dumpPtr)
- int fid;
- dbDumpP dumpPtr;
+writeDump(int fid, dbDumpP dumpPtr)
{
struct budb_dumpEntry dumpEntry;
afs_int32 code = 0, tcode;
}
afs_int32
-writeTape(fid, tapePtr, dumpid)
- int fid;
- struct tape *tapePtr;
- afs_int32 dumpid;
+writeTape(int fid, struct tape *tapePtr, afs_int32 dumpid)
{
struct budb_tapeEntry tapeEntry;
afs_int32 code = 0, tcode;
/* combines volFragment and volInfo */
afs_int32
-writeVolume(ut, fid, volFragmentPtr, volInfoPtr, dumpid, tapeName)
- struct ubik_trans *ut;
- int fid;
- struct volFragment *volFragmentPtr;
- struct volInfo *volInfoPtr;
- afs_int32 dumpid;
- char *tapeName;
+writeVolume(struct ubik_trans *ut, int fid, struct volFragment *volFragmentPtr,
+ struct volInfo *volInfoPtr, afs_int32 dumpid, char *tapeName)
{
struct budb_volumeEntry budbVolume;
afs_int32 code = 0;
*/
afs_int32
-checkLock(textType)
- afs_int32 textType;
+checkLock(afs_int32 textType)
{
db_lockP lockPtr;
* check the integrity of the specified text type
*/
-checkText(ut, textType)
- struct ubik_trans *ut;
- afs_int32 textType;
+int
+checkText(struct ubik_trans *ut, afs_int32 textType)
{
struct textBlock *tbPtr;
afs_int32 nBytes = 0; /* accumulated actual size */
*/
afs_int32
-writeText(ut, fid, textType)
- struct ubik_trans *ut;
- int fid;
- int textType;
+writeText(struct ubik_trans *ut, int fid, int textType)
{
struct textBlock *tbPtr;
afs_int32 textSize, writeSize;
#define MAXAPPENDS 200
afs_int32
-writeDatabase(ut, fid)
- struct ubik_trans *ut;
- int fid;
+writeDatabase(struct ubik_trans *ut, int fid)
{
dbadr dbAddr, dbAppAddr;
struct dump diskDump, apDiskDump;
#ifdef notdef
afs_int32
-canWrite(fid)
- int fid;
+canWrite(int fid)
{
afs_int32 in, out, except;
struct timeval tp;
#include <afs/bubasics.h>
#include "budb_errs.h"
#include "database.h"
+#include "budb_prototypes.h"
#include "error_macros.h"
int sizeFunctions[HT_MAX_FUNCTION + 1];
int nHTBuckets = NhtBucketS; /* testing: we need small HT blocks */
+int ht_minHBlocks(struct memoryHashTable *mht);
+
/* ht_TableSize - return the size of table necessary to represent a hashtable
* of given length in memory. It basically rounds the length up by the number
* of buckets per block. */
int
-ht_TableSize(length)
- int length;
+ht_TableSize(int length)
{
int n;
if (length == 0)
* It also resets the global variable nHTBuckets. */
static void
-ht_ResetT(blocksP, sizeP, length)
- struct memoryHTBlock ***blocksP;
- int *sizeP;
- int length;
+ht_ResetT(struct memoryHTBlock ***blocksP, int *sizeP, int length)
{
struct memoryHTBlock **b = *blocksP;
int newsize;
*/
void
-ht_Reset(mht)
- struct memoryHashTable *mht;
+ht_Reset(struct memoryHashTable *mht)
{
- struct hashTable *ht;
+ struct hashTable *ht = NULL;
if (!(mht && (ht = mht->ht)))
db_panic("some ht called with bad mht");
test - initialization parameters: bit 4 is small ht. */
afs_int32
-InitDBhash()
+InitDBhash(void)
{
sizeFunctions[0] = 0;
/* ht_DBInit - When rebuilding database, this sets up the hash tables. */
void
-ht_DBInit()
+ht_DBInit(void)
{
db.h.nHTBuckets = htonl(nHTBuckets);
}
afs_int32
-ht_AllocTable(ut, mht)
- struct ubik_trans *ut;
- struct memoryHashTable *mht;
+ht_AllocTable(struct ubik_trans *ut, struct memoryHashTable *mht)
{
- struct hashTable *ht;
+ struct hashTable *ht = NULL;
afs_int32 code;
int len;
int nb, mnb; /* number of blocks for hashTable */
if (code)
return code;
}
- if (code = set_word_addr(ut, 0, &db.h, &ht->table, htonl(b[0]->a)))
+ if ((code = set_word_addr(ut, 0, &db.h, &ht->table, htonl(b[0]->a))))
return code;
- if (code = set_word_addr(ut, 0, &db.h, &ht->length, htonl(len)))
+ if ((code = set_word_addr(ut, 0, &db.h, &ht->length, htonl(len))))
return code;
mht->length = len;
return 0;
}
afs_int32
-ht_FreeTable(ut, mht)
- struct ubik_trans *ut;
- struct memoryHashTable *mht;
+ht_FreeTable(struct ubik_trans *ut, struct memoryHashTable *mht)
{
- struct hashTable *ht;
+ struct hashTable *ht = NULL;
afs_int32 code;
struct blockHeader bh;
dbadr a, na;
return BUDB_IO;
}
na = ntohl(bh.next);
- if (code = FreeBlock(ut, &bh, a))
+ if ((code = FreeBlock(ut, &bh, a)))
return code;
}
if (set_word_addr(ut, 0, &db.h, &ht->oldTable, 0)
}
afs_int32
-ht_GetTableBlock(ut, mht, hash, old, blockP, boP)
- struct ubik_trans *ut;
- struct memoryHashTable *mht;
- afs_uint32 hash;
- int old;
- struct memoryHTBlock **blockP;
- int *boP;
+ht_GetTableBlock(struct ubik_trans *ut, struct memoryHashTable *mht,
+ afs_uint32 hash, int old, struct memoryHTBlock **blockP,
+ int *boP)
{
- struct hashTable *ht;
+ struct hashTable *ht = NULL;
struct memoryHTBlock **b;
int hi, bi;
struct memoryHTBlock ***blocksP;
*/
static afs_int32
-ht_MaybeAdjust(ut, mht)
- struct ubik_trans *ut;
- struct memoryHashTable *mht;
+ht_MaybeAdjust(struct ubik_trans *ut, struct memoryHashTable *mht)
{
struct hashTable *ht = mht->ht;
int numberEntries = ntohl(ht->entries);
}
dbadr
-ht_LookupBucket(ut, mht, hash, old)
- struct ubik_trans *ut;
- struct memoryHashTable *mht;
- afs_uint32 hash;
- int old;
+ht_LookupBucket(struct ubik_trans *ut, struct memoryHashTable *mht,
+ afs_uint32 hash, int old)
{
struct memoryHTBlock *block;
int bo;
* from insufficient mixing of the hash information. */
afs_uint32
-Old2StringHashFunction(str)
- unsigned char *str;
+Old2StringHashFunction(unsigned char *str)
{
afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */
while (*str)
* problem is that the hash needs to be mixed up not the incoming character. */
afs_uint32
-Old3StringHashFunction(str)
- unsigned char *str;
+Old3StringHashFunction(unsigned char *str)
{
afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */
while (*str)
* It behaves especially badly for hash tables whose size is a power of two. */
afs_uint32
-Old4StringHashFunction(str)
- unsigned char *str;
+Old4StringHashFunction(unsigned char *str)
{
afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */
while (*str)
* #3 with a hash table as big as 8200. */
afs_uint32
-Old5StringHashFunction(str)
- unsigned char *str;
+Old5StringHashFunction(unsigned char *str)
{
afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */
while (*str)
* better than the random hash function. */
afs_uint32
-Old6StringHashFunction(str)
- unsigned char *str;
+Old6StringHashFunction(unsigned char *str)
{
afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */
while (*str)
* well. All these differences are fairly small, however. */
afs_uint32
-Old7StringHashFunction(str)
- unsigned char *str;
+Old7StringHashFunction(unsigned char *str)
{
afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */
while (*str)
* multiplies, which may be faster on some architectures. */
afs_uint32
-Old8StringHashFunction(str)
- unsigned char *str;
+Old8StringHashFunction(unsigned char *str)
{
afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */
while (*str)
* odd. It behaves beeter than the random hash function. */
afs_uint32
-StringHashFunction(str)
- unsigned char *str;
+StringHashFunction(unsigned char *str)
{
afs_uint32 hash = 1000003; /* big prime to make "" hash nicely */
/* The multiplicative constant should be odd and have a goodly number of
}
afs_uint32
-IdHashFunction(id)
- afs_uint32 id;
+IdHashFunction(afs_uint32 id)
{
afs_uint32 l, r;
id *= 81847;
* twice the number of buckets.
*/
int
-ht_minHBlocks(mht)
- struct memoryHashTable *mht;
+ht_minHBlocks(struct memoryHashTable *mht)
{
int retval;
default:
db_panic("Illegal hash function type");
+ retval = -1; /* not reached */
}
return (retval);
}
afs_uint32
-ht_HashEntry(mht, e)
- struct memoryHashTable *mht;
- char *e; /* entry's address (in b) */
+ht_HashEntry(struct memoryHashTable *mht,
+ char *e) /* entry's address (in b) */
{
int type = ntohl(mht->ht->functionType);
afs_uint32 retval;
break;
case HT_dumpName_FUNCTION:
- retval = StringHashFunction(((struct dump *)e)->dumpName);
+ retval = StringHashFunction((unsigned char *)((struct dump *)e)->dumpName);
LogDebug(5, "HashEntry: dumpname returns %d\n", retval);
break;
case HT_tapeName_FUNCTION:
- retval = StringHashFunction(((struct tape *)e)->name);
+ retval = StringHashFunction((unsigned char *)((struct tape *)e)->name);
LogDebug(5, "HashEntry: tapename returns %d\n", retval);
break;
case HT_volName_FUNCTION:
- retval = StringHashFunction(((struct volInfo *)e)->name);
+ retval = StringHashFunction((unsigned char *)((struct volInfo *)e)->name);
LogDebug(5, "HashEntry: volname returns %d\n", retval);
break;
default:
db_panic("illegal hash function");
+ retval = -1; /* not reached */
}
return (retval);
*/
struct memoryHashTable *
-ht_GetType(type, e_sizeP)
- int type;
- int *e_sizeP;
+ht_GetType(int type, int *e_sizeP)
{
struct memoryHashTable *mht;
}
static int
-ht_KeyMatch(type, key, e)
- int type;
- char *key;
- char *e;
+ht_KeyMatch(int type, char *key, char *e)
{
switch (type) {
case HT_dumpIden_FUNCTION:
*/
afs_int32
-ht_LookupEntry(ut, mht, key, eaP, e)
- struct ubik_trans *ut;
- struct memoryHashTable *mht;
- char *key; /* pointer to lookup key to match */
- dbadr *eaP; /* db addr of entry found or zero */
- char *e; /* contents of located entry */
+ht_LookupEntry(struct ubik_trans *ut,
+ struct memoryHashTable *mht,
+ void *key, /* pointer to lookup key to match */
+ dbadr *eaP, /* db addr of entry found or zero */
+ void *e) /* contents of located entry */
{
- struct hashTable *ht;
+ struct hashTable *ht = NULL;
int type;
int e_size;
int old;
*eaP = a;
return 0;
}
- a = ntohl(*(dbadr *) (e + mht->threadOffset));
+ a = ntohl(*(dbadr *) ((char *)e + mht->threadOffset));
}
if (old)
return 0;
*/
static afs_int32
-ht_HashInList(ut, mht, opQuota, block, blockOffset)
- struct ubik_trans *ut;
- struct memoryHashTable *mht;
- int *opQuota;
- struct memoryHTBlock *block;
- int blockOffset;
+ht_HashInList(struct ubik_trans *ut, struct memoryHashTable *mht,
+ int *opQuota, struct memoryHTBlock *block, int blockOffset)
{
struct hashTable *ht = mht->ht;
afs_int32 code;
int e_size = sizeFunctions[ntohl(ht->functionType)];
if (mht->length == 0) {
- if (code = ht_AllocTable(ut, mht)) {
+ if ((code = ht_AllocTable(ut, mht))) {
Log("ht_HashInList: ht_AllocTable failed\n");
return code;
}
*/
static afs_int32
-ht_MoveEntries(ut, mht)
- struct ubik_trans *ut;
- struct memoryHashTable *mht;
+ht_MoveEntries(struct ubik_trans *ut, struct memoryHashTable *mht)
{
struct memoryHTBlock *block;
afs_uint32 hash;
#ifdef notdef
static afs_int32
-ht_MoveEntries(ut, mht)
- struct ubik_trans *ut;
- struct memoryHashTable *mht;
+ht_MoveEntries(struct ubik_trans *ut, struct memoryHashTable *mht)
{
afs_uint32 hash;
int bo;
#endif /* notdef */
afs_int32
-ht_HashIn(ut, mht, ea, e)
- struct ubik_trans *ut;
- struct memoryHashTable *mht;
- dbadr ea; /* block db address */
- char *e; /* entry's address (in b) */
+ht_HashIn(struct ubik_trans *ut,
+ struct memoryHashTable *mht,
+ dbadr ea, /* block db address */
+ void *e) /* entry's address (in b) */
{
- struct hashTable *ht;
+ struct hashTable *ht = NULL;
afs_uint32 hash;
struct memoryHTBlock *block;
int bo;
if (!(mht && (ht = mht->ht)))
db_panic("some ht called with bad mht");
- if (code = ht_MaybeAdjust(ut, mht))
+ if ((code = ht_MaybeAdjust(ut, mht)))
return code;
if (mht->length == 0)
- if (code = ht_AllocTable(ut, mht))
+ if ((code = ht_AllocTable(ut, mht)))
return code;
hash = ht_HashEntry(mht, e);
* but is not otherwise used. */
afs_int32
-RemoveFromList(ut, ea, e, head, ta, t, thread)
- struct ubik_trans *ut;
- dbadr ea; /* db addr of head structure */
- char *e; /* head structure */
- dbadr *head; /* address of head pointer */
- dbadr ta; /* db addr of strucure to be removed */
- char *t; /* structure being removed */
- dbadr *thread; /* pointer to thread pointer */
+RemoveFromList(struct ubik_trans *ut,
+ dbadr ea, /* db addr of head structure */
+ void *e, /* head structure */
+ dbadr *head, /* address of head pointer */
+ dbadr ta, /* db addr of strucure to be removed */
+ void *t, /* structure being removed */
+ dbadr *thread) /* pointer to thread pointer */
{
afs_int32 code;
- int threadOffset = ((char *)thread - t);
+ int threadOffset = ((char *)thread - (char *)t);
dbadr next_a; /* db addr of next element in list */
dbadr loop_a; /* db addr of current list element */
}
afs_int32
-ht_HashOutT(ut, mht, hash, ea, e, old)
- struct ubik_trans *ut;
- struct memoryHashTable *mht;
- afs_uint32 hash;
- dbadr ea;
- char *e;
- int old;
+ht_HashOutT(struct ubik_trans *ut, struct memoryHashTable *mht,
+ afs_uint32 hash, dbadr ea, char *e, int old)
{
struct memoryHTBlock *block;
int bo;
}
afs_int32
-ht_HashOut(ut, mht, ea, e)
- struct ubik_trans *ut;
- struct memoryHashTable *mht;
- dbadr ea;
- char *e;
+ht_HashOut(struct ubik_trans *ut, struct memoryHashTable *mht, dbadr ea,
+ void *e)
{
afs_uint32 hash;
afs_int32 code;
afs_int32
-scanHashTableBlock(ut, mhtPtr, htBlockPtr, old, length, index, selectFn,
- operationFn, rockPtr)
- struct ubik_trans *ut;
- struct memoryHashTable *mhtPtr;
- struct htBlock *htBlockPtr;
- int old;
- afs_int32 length; /* size of whole hash table */
- int index; /* base index of this block */
- int (*selectFn) ();
- int (*operationFn) ();
- char *rockPtr;
+scanHashTableBlock(struct ubik_trans *ut,
+ struct memoryHashTable *mhtPtr,
+ struct htBlock *htBlockPtr,
+ int old,
+ afs_int32 length, /* size of whole hash table */
+ int index, /* base index of this block */
+ int (*selectFn) (dbadr, void *, void *),
+ int (*operationFn) (dbadr, void *, void *),
+ void *rockPtr)
{
int type; /* hash table type */
int entrySize; /* hashed entry size */
- afs_uint32 *mapEntryPtr = 0; /* for status checks */
-
char entry[sizeof(struct block)];
dbadr entryAddr, nextEntryAddr;
int i;
- afs_int32 code = 0;
type = ntohl(mhtPtr->ht->functionType);
entrySize = sizeFunctions[type];
}
afs_int32
-scanHashTable(ut, mhtPtr, selectFn, operationFn, rockPtr)
- struct ubik_trans *ut;
- struct memoryHashTable *mhtPtr;
- int (*selectFn) ();
- int (*operationFn) ();
- char *rockPtr;
+scanHashTable(struct ubik_trans *ut, struct memoryHashTable *mhtPtr,
+ int (*selectFn) (dbadr, void *, void *),
+ int (*operationFn) (dbadr, void *, void *),
+ void *rockPtr)
{
struct htBlock hashTableBlock;
dbadr tableAddr; /* disk addr of hash block */
#include <afs/bubasics.h>
#include "budb_errs.h"
#include "database.h"
+#include "budb_prototypes.h"
#include "error_macros.h"
#include "afs/audit.h"
#define DBH_POS(ptr) ( (char *) (ptr) - (char *) &db.h )
-afs_int32 FreeAllLocks(), FreeLock(), GetInstanceId(), GetLock();
+afs_int32 FreeAllLocks(struct rx_call *, afs_uint32);
+afs_int32 FreeLock(struct rx_call *, afs_uint32);
+afs_int32 GetInstanceId(struct rx_call *, afs_uint32 *);
+afs_int32 GetLock(struct rx_call *, afs_uint32, afs_int32, afs_int32,
+ afs_uint32 *);
afs_int32
-SBUDB_FreeAllLocks(call, instanceId)
- struct rx_call *call;
- afs_uint32 instanceId;
+SBUDB_FreeAllLocks(struct rx_call *call, afs_uint32 instanceId)
{
afs_int32 code;
}
afs_int32
-FreeAllLocks(call, instanceId)
- struct rx_call *call;
- afs_uint32 instanceId;
+FreeAllLocks(struct rx_call *call, afs_uint32 instanceId)
{
db_lockP startPtr, endPtr;
struct ubik_trans *ut;
}
afs_int32
-SBUDB_FreeLock(call, lockHandle)
- struct rx_call *call;
- afs_uint32 lockHandle;
+SBUDB_FreeLock(struct rx_call *call, afs_uint32 lockHandle)
{
afs_int32 code;
}
afs_int32
-FreeLock(call, lockHandle)
- struct rx_call *call;
- afs_uint32 lockHandle;
+FreeLock(struct rx_call *call, afs_uint32 lockHandle)
{
db_lockP lockPtr = 0;
struct ubik_trans *ut;
}
afs_int32
-SBUDB_GetInstanceId(call, instanceId)
- struct rx_call *call;
- afs_uint32 *instanceId;
+SBUDB_GetInstanceId(struct rx_call *call, afs_uint32 *instanceId)
{
afs_int32 code;
}
afs_int32
-GetInstanceId(call, instanceId)
- struct rx_call *call;
- afs_uint32 *instanceId;
+GetInstanceId(struct rx_call *call, afs_uint32 *instanceId)
{
struct ubik_trans *ut;
afs_int32 code;
afs_int32
-SBUDB_GetLock(call, instanceId, lockName, expiration, lockHandle)
- struct rx_call *call;
- afs_uint32 instanceId;
- afs_int32 lockName;
- afs_int32 expiration;
- afs_uint32 *lockHandle;
+SBUDB_GetLock(struct rx_call *call, afs_uint32 instanceId, afs_int32 lockName,
+ afs_int32 expiration, afs_uint32 *lockHandle)
{
afs_int32 code;
}
afs_int32
-GetLock(call, instanceId, lockName, expiration, lockHandle)
- struct rx_call *call;
- afs_uint32 instanceId;
- afs_int32 lockName;
- afs_int32 expiration;
- afs_uint32 *lockHandle;
+GetLock(struct rx_call *call, afs_uint32 instanceId, afs_int32 lockName,
+ afs_int32 expiration, afs_uint32 *lockHandle)
{
struct timeval tv;
db_lockP lockPtr;
* 0 - if invalid handle
* 1 - if handle is valid
*/
-
-checkLockHandle(ut, lockHandle)
- struct ubik_trans *ut;
- afs_uint32 lockHandle;
+int
+checkLockHandle(struct ubik_trans *ut, afs_uint32 lockHandle)
{
return (((lockHandle > 0) && (lockHandle <= TB_NUM)) ? 1 : 0);
}
#include "budb_errs.h"
#include "database.h"
#include "error_macros.h"
+#include "budb_prototypes.h"
#include "afs/audit.h"
#include <afs/afsutil.h>
* routine mallocs storage for charListPtr, freed by stub
*/
-afs_int32 GetText(), GetTextVersion(), SaveText();
+afs_int32 GetText(struct rx_call *, afs_uint32, afs_int32, afs_int32,
+ afs_int32, afs_int32 *, charListT *);
+afs_int32 GetTextVersion(struct rx_call *, afs_int32, afs_uint32 *);
+afs_int32 SaveText(struct rx_call *, afs_uint32, afs_int32, afs_int32,
+ afs_int32, charListT *);
afs_int32
-SBUDB_GetText(call, lockHandle, textType, maxLength, offset, nextOffset,
- charListPtr)
- struct rx_call *call;
- afs_uint32 lockHandle;
- afs_int32 textType;
- afs_int32 maxLength;
- afs_int32 offset;
- afs_int32 *nextOffset;
- charListT *charListPtr;
+SBUDB_GetText(struct rx_call *call, afs_uint32 lockHandle, afs_int32 textType,
+ afs_int32 maxLength, afs_int32 offset, afs_int32 *nextOffset,
+ charListT *charListPtr)
{
afs_int32 code;
}
afs_int32
-GetText(call, lockHandle, textType, maxLength, offset, nextOffset,
- charListPtr)
- struct rx_call *call;
- afs_uint32 lockHandle;
- afs_int32 textType;
- afs_int32 maxLength;
- afs_int32 offset;
- afs_int32 *nextOffset;
- charListT *charListPtr;
+GetText(struct rx_call *call, afs_uint32 lockHandle, afs_int32 textType,
+ afs_int32 maxLength, afs_int32 offset, afs_int32 *nextOffset,
+ charListT *charListPtr)
{
struct ubik_trans *ut = 0;
struct block block;
*nextOffset = -1;
}
- error_exit:
+ /* error_exit: */
code = ubik_EndTrans(ut);
/* printf("in error exit, code=%ld\n", code); */
return (code);
return (code);
}
-freeOldBlockChain(ut, diskAddr)
- struct ubik_trans *ut;
- dbadr diskAddr;
+int
+freeOldBlockChain(struct ubik_trans *ut, dbadr diskAddr)
{
struct blockHeader blockHeader;
dbadr nextDiskAddr;
- afs_int32 code;
+ afs_int32 code = 0;
while (diskAddr != 0) {
/* read in the header */
*/
afs_int32
-SBUDB_GetTextVersion(call, textType, tversion)
- struct rx_call *call;
- afs_int32 textType;
- afs_uint32 *tversion;
+SBUDB_GetTextVersion(struct rx_call *call, afs_int32 textType,
+ afs_uint32 *tversion)
{
afs_int32 code;
}
afs_int32
-GetTextVersion(call, textType, tversion)
- struct rx_call *call;
- afs_int32 textType;
- afs_uint32 *tversion;
+GetTextVersion(struct rx_call *call, afs_int32 textType,
+ afs_uint32 *tversion)
{
afs_int32 code;
struct ubik_trans *ut;
*/
afs_int32
-SBUDB_SaveText(call, lockHandle, textType, offset, flags, charListPtr)
- struct rx_call *call;
- afs_uint32 lockHandle;
- afs_int32 textType;
- afs_int32 offset;
- afs_int32 flags;
- charListT *charListPtr;
+SBUDB_SaveText(struct rx_call *call, afs_uint32 lockHandle,
+ afs_int32 textType, afs_int32 offset, afs_int32 flags,
+ charListT *charListPtr)
{
afs_int32 code;
}
afs_int32
-SaveText(call, lockHandle, textType, offset, flags, charListPtr)
- struct rx_call *call;
- afs_uint32 lockHandle;
- afs_int32 textType;
- afs_int32 offset;
- afs_int32 flags;
- charListT *charListPtr;
+SaveText(struct rx_call *call, afs_uint32 lockHandle, afs_int32 textType,
+ afs_int32 offset, afs_int32 flags, charListT *charListPtr)
{
struct ubik_trans *ut;
struct block diskBlock;
if (code)
ABORT(code);
- error_exit:
+/*error_exit: */
code = ubik_EndTrans(ut);
return (code);
/* debug support */
void
-saveTextToFile(ut, tbPtr)
- struct ubik_trans *ut;
- struct textBlock *tbPtr;
-
+saveTextToFile(struct ubik_trans *ut, struct textBlock *tbPtr)
{
afs_int32 blockAddr;
struct block block;
*/
int
-mkstemp(st)
- char *st;
+mkstemp(char *st)
{
int retval = -1;
#include "budb.h"
#include "budb_errs.h"
#include "database.h"
+#include "budb_prototypes.h"
#include "error_macros.h"
#include "globals.h"
#include "afs/audit.h"
+afs_int32 DumpDB(struct rx_call *, int, afs_int32, charListT *, afs_int32 *);
+afs_int32 RestoreDbHeader(struct rx_call *, struct DbHeader *);
void *dumpWatcher(void *);
/* dump ubik database - interface routines */
*/
afs_int32
-badEntry(dbAddr)
- afs_uint32 dbAddr;
+badEntry(afs_uint32 dbAddr)
{
/* return entry ok */
return (0);
}
-afs_int32 DumpDB(), RestoreDbHeader();
afs_int32
-SBUDB_DumpDB(call, firstcall, maxLength, charListPtr, done)
- struct rx_call *call;
- int firstcall;
- afs_int32 maxLength;
- charListT *charListPtr;
- afs_int32 *done;
+SBUDB_DumpDB(struct rx_call *call, int firstcall, afs_int32 maxLength,
+ charListT *charListPtr, afs_int32 *done)
{
afs_int32 code;
}
afs_int32
-DumpDB(call, firstcall, maxLength, charListPtr, done)
- struct rx_call *call;
- int firstcall; /* 1 - init. 0 - no init */
- afs_int32 maxLength;
- charListT *charListPtr;
- afs_int32 *done;
+DumpDB(struct rx_call *call,
+ int firstcall, /* 1 - init. 0 - no init */
+ afs_int32 maxLength,
+ charListT *charListPtr,
+ afs_int32 *done)
{
#ifdef AFS_PTHREAD_ENV
pthread_t dumperPid, watcherPid;
}
afs_int32
-SBUDB_RestoreDbHeader(call, header)
- struct rx_call *call;
- struct DbHeader *header;
+SBUDB_RestoreDbHeader(struct rx_call *call, struct DbHeader *header)
{
afs_int32 code;
}
afs_int32
-RestoreDbHeader(call, header)
- struct rx_call *call;
- struct DbHeader *header;
+RestoreDbHeader(struct rx_call *call, struct DbHeader *header)
{
struct ubik_trans *ut = 0;
afs_int32 code = 0;
#include "database.h"
#include "error_macros.h"
#include "budb_errs.h"
+#include "budb_prototypes.h"
#include <afs/cellconfig.h>
#include "afs/audit.h"
struct mapCompatability {
short trigger; /* these bits trigger this element */
} mapC[] = {
-MAP_FREE, MAP_HTBLOCK, MAP_DUMPHASH | MAP_IDHASH,
- MAP_TAPEHASH | MAP_TAPEONDUMP, MAP_VOLINFOONNAME,
- MAP_VOLINFONAMEHEAD | MAP_VOLHASH,
- MAP_VOLFRAGONTAPE | MAP_VOLFRAGONVOL, MAP_TEXTBLOCK};
+ {MAP_FREE}, {MAP_HTBLOCK}, {MAP_DUMPHASH | MAP_IDHASH},
+ {MAP_TAPEHASH | MAP_TAPEONDUMP}, {MAP_VOLINFOONNAME},
+ {MAP_VOLINFONAMEHEAD | MAP_VOLHASH},
+ {MAP_VOLFRAGONTAPE | MAP_VOLFRAGONVOL}, {MAP_TEXTBLOCK}};
/* no. of entries in the mapC array */
int NMAPCs = (sizeof(mapC) / sizeof(mapC[0]));
extern int sizeFunctions[];
extern int nHTBuckets;
+afs_int32 DbVerify(struct rx_call *call, afs_int32 *status,
+ afs_int32 *orphans, afs_int32 *host);
+afs_int32 verifyTextChain(struct ubik_trans *ut, struct textBlock *tbPtr);
+
+
#define DBBAD BUDB_DATABASEINCONSISTENT
/* ------------------------------------
*/
afs_int32
-BumpErrors()
+BumpErrors(void)
{
if (++miscData.errors >= miscData.maxErrors)
return (1);
*/
afs_int32
-checkDiskAddress(address, type, blockIndexPtr, entryIndexPtr)
- unsigned long address;
- int type;
- int *blockIndexPtr;
- int *entryIndexPtr;
+checkDiskAddress(unsigned long address, int type, int *blockIndexPtr,
+ int *entryIndexPtr)
{
int index, offset;
*/
afs_int32
-ConvertDiskAddress(address, blockIndexPtr, entryIndexPtr)
- afs_uint32 address;
- int *blockIndexPtr;
- int *entryIndexPtr;
+ConvertDiskAddress(afs_uint32 address, int *blockIndexPtr, int *entryIndexPtr)
{
int index, type;
afs_int32 code;
}
char *
-TypeName(index)
- int index;
+TypeName(int index)
{
static char error[36];
* to the dump.
*/
afs_int32
-verifyDumpEntry(ut, dumpAddr, ai, ao, dumpPtr)
- struct ubik_trans *ut;
- afs_int32 dumpAddr;
- int ai, ao;
- struct dump *dumpPtr;
+verifyDumpEntry(struct ubik_trans *ut, afs_int32 dumpAddr, int ai, int ao,
+ void *param)
{
+ struct dump *dumpPtr = (struct dump *)param;
+
struct tape tape;
afs_int32 tapeAddr, tapeCount = 0, volCount = 0, appDumpCount = 0;
afs_int32 appDumpAddr, appDumpIndex, appDumpOffset;
* they belong to the tape.
*/
afs_int32
-verifyTapeEntry(ut, tapeAddr, ai, ao, tapePtr)
- struct ubik_trans *ut;
- afs_int32 tapeAddr;
- int ai, ao;
- struct tape *tapePtr;
+verifyTapeEntry(struct ubik_trans *ut, afs_int32 tapeAddr, int ai, int ao,
+ void *param)
{
+ struct tape *tapePtr = (struct tape *) param;
int volCount = 0, ccheck = 1;
afs_int32 volFragAddr;
int blockIndex, entryIndex;
* So no check is done agaist it.
*/
afs_int32
-verifyVolFragEntry(ut, va, ai, ao, v)
- struct ubik_trans *ut;
- afs_int32 va;
- int ai, ao;
- struct volFragment *v;
+verifyVolFragEntry(struct ubik_trans *ut, afs_int32 va, int ai, int ao,
+ void *param)
{
+ /* struct volFragment *v = (struct volFragment *)param; */
misc->nVolFrag++;
return 0;
}
* also verify all entries are also on the chain.
*/
afs_int32
-verifyVolInfoEntry(ut, volInfoAddr, ai, ao, volInfo)
- struct ubik_trans *ut;
- afs_int32 volInfoAddr;
- int ai, ao;
- struct volInfo *volInfo;
+verifyVolInfoEntry(struct ubik_trans *ut, afs_int32 volInfoAddr, int ai,
+ int ao, void *param)
{
+ struct volInfo *volInfo = (struct volInfo *) param;
+
int volCount = 0, ccheck = 1;
afs_int32 volFragAddr;
int blockIndex, entryIndex;
* blockMap array. Also check that the type of block is good.
*/
afs_int32
-verifyBlocks(ut)
- struct ubik_trans *ut;
+verifyBlocks(struct ubik_trans *ut)
{
struct block block;
int blocktype;
* entry and is not threaded on multiple lists.
*/
afs_int32
-verifyHashTableBlock(ut, mhtPtr, htBlockPtr, old, length, index, mapBit)
- struct ubik_trans *ut;
- struct memoryHashTable *mhtPtr;
- struct htBlock *htBlockPtr;
- int old;
- afs_int32 length; /* size of whole hash table */
- int index; /* base index of this block */
- int mapBit;
+verifyHashTableBlock(struct ubik_trans *ut,
+ struct memoryHashTable *mhtPtr,
+ struct htBlock *htBlockPtr,
+ int old,
+ afs_int32 length, /* size of whole hash table */
+ int index, /* base index of this block */
+ int mapBit)
{
int type; /* hash table type */
int entrySize; /* hashed entry size */
* the hash table.
*/
afs_int32
-verifyHashTable(ut, mhtPtr, mapBit)
- struct ubik_trans *ut;
- struct memoryHashTable *mhtPtr;
- int mapBit;
+verifyHashTable(struct ubik_trans *ut, struct memoryHashTable *mhtPtr,
+ int mapBit)
{
struct hashTable *htPtr = mhtPtr->ht;
* the integrity of each allocated structure.
*/
afs_int32
-verifyEntryChains(ut)
- struct ubik_trans *ut;
+verifyEntryChains(struct ubik_trans *ut)
{
afs_int32 code;
afs_int32 offset;
int type;
int nFree;
- static afs_int32(*checkEntry[NBLOCKTYPES]) ()
+ static afs_int32(*checkEntry[NBLOCKTYPES]) (struct ubik_trans *,
+ afs_int32, int, int, void *)
= {
/* FIXME: this list does not match typeName[] and may be incorrect */
0, /* free block */
afs_int32
-verifyFreeLists()
+verifyFreeLists(void)
{
int i;
afs_int32 addr;
* checking the bits for compatibility.
*/
afs_int32
-verifyMapBits()
+verifyMapBits(void)
{
int blockIndex, entryIndex, i, entrySize, type, bits;
afs_int32 offset;
}
afs_int32
-verifyText(ut)
- struct ubik_trans *ut;
+verifyText(struct ubik_trans *ut)
{
int i;
afs_int32 code;
- extern afs_int32 verifyTextChain();
/* check each of the text types in use */
for (i = 0; i < TB_NUM; i++) {
* check the integrity of a text chain. Also checks the new chain.
*/
afs_int32
-verifyTextChain(ut, tbPtr)
- struct ubik_trans *ut;
- struct textBlock *tbPtr;
+verifyTextChain(struct ubik_trans *ut, struct textBlock *tbPtr)
{
dbadr blockAddr;
int blockIndex, entryIndex;
*/
afs_int32
-verifyDatabase(ut, recreateFile)
- struct ubik_trans *ut;
- FILE *recreateFile; /* not used */
+verifyDatabase(struct ubik_trans *ut,
+ FILE *recreateFile) /* not used */
{
afs_int32 eof;
int bmsize;
- afs_int32 code = 0, tcode;
+ afs_int32 code = 0, tcode = 0;
extern int nBlocks; /* no. blocks in database */
- extern struct ubik_dbase *BU_dbase;
/* clear verification statistics */
misc = &miscData;
* orphans - no. of orphan blocks
* host - address of host that did verification
*/
-afs_int32 DbVerify();
afs_int32
-SBUDB_DbVerify(call, status, orphans, host)
- struct rx_call *call;
- afs_int32 *status;
- afs_int32 *orphans;
- afs_int32 *host;
+SBUDB_DbVerify(struct rx_call *call, afs_int32 *status, afs_int32 *orphans,
+ afs_int32 *host)
{
afs_int32 code;
}
afs_int32
-DbVerify(call, status, orphans, host)
- struct rx_call *call;
- afs_int32 *status;
- afs_int32 *orphans;
- afs_int32 *host;
+DbVerify(struct rx_call *call, afs_int32 *status, afs_int32 *orphans,
+ afs_int32 *host)
{
struct ubik_trans *ut = 0;
afs_int32 code = 0, tcode;
/* check_header
* do a simple sanity check on the database header
*/
-
-check_header(callerst)
- char *callerst;
+void
+check_header(char *callerst)
{
static int iteration_count = 0;
afs_int32 eof;
#include "budb.h"
#include "budb_errs.h"
#include "database.h"
+#include "budb_prototypes.h"
#include "error_macros.h"
#include "globals.h"
#include "afs/audit.h"
extern struct ubik_dbase *BU_dbase;
extern struct afsconf_dir *BU_conf; /* for getting cell info */
-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
* 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;
*/
char *
-tailCompPtr(pathNamePtr)
- char *pathNamePtr;
+tailCompPtr(char *pathNamePtr)
{
char *ptr;
ptr = strrchr(pathNamePtr, '/');
*/
int
-callPermitted(call)
- struct rx_call *call;
+callPermitted(struct rx_call *call)
{
int permitted = 0;
struct afsconf_dir *acdir;
*/
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("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;
}
afs_int32
-FillVolEntry(ut, va, vol)
- struct ubik_trans *ut;
- dbadr va;
- struct budb_volumeEntry *vol;
+FillVolEntry(struct ubik_trans *ut, dbadr va, struct budb_volumeEntry *vol)
{
struct dump d;
struct tape t;
}
afs_int32
-FillDumpEntry(ut, da, dump)
- struct ubik_trans *ut;
- dbadr da;
- struct budb_dumpEntry *dump;
+FillDumpEntry(struct ubik_trans *ut, dbadr da, struct budb_dumpEntry *dump)
{
struct dump d, ad;
}
afs_int32
-FillTapeEntry(ut, ta, tape)
- struct ubik_trans *ut;
- dbadr ta;
- struct budb_tapeEntry *tape;
+FillTapeEntry(struct ubik_trans *ut, dbadr ta, struct budb_tapeEntry *tape)
{
struct tape t;
struct dump d;
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,
+ budb_dumpEntry *),
+ /* 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;
int i;
- char *e;
+ void *e;
*nextIndexP = -1;
*dbTimeP = ntohl(db.h.lastUpdate);
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;
*/
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;
int
-wantDump(dumpAddrParam, dumpParam, dumpListPtrParam)
- char *dumpAddrParam;
- char *dumpParam;
- char *dumpListPtrParam;
+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;
}
int
-rememberDump(dumpAddrParam, dumpParam, dumpListPtrParam)
- char *dumpAddrParam;
- char *dumpParam;
- char *dumpListPtrParam;
+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;
*/
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;
}
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;
}
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;
*/
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, hvia, via, vfa;
* 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;
*/
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 */
* 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;
}
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_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;
}
int
-volFragsDump(ut, dumpfid, dbAddr)
- struct ubik_trans *ut;
- FILE *dumpfid;
- dbadr dbAddr;
+volFragsDump(struct ubik_trans *ut, FILE *dumpfid, dbadr dbAddr)
{
struct volFragment hostVolFragment, diskVolFragment;
afs_int32 code;
* 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 */
int
-checkHash(ut, hashType)
- struct ubik_trans *ut;
- int hashType;
+checkHash(struct ubik_trans *ut, int hashType)
{
struct memoryHashTable *mhtPtr;
int entrySize, hashTableLength;
#include "budb_errs.h"
#include "database.h"
#include "error_macros.h"
+#include "budb_prototypes.h"
#include "globals.h"
#include "afs/audit.h"
struct afsconf_dir *BU_conf; /* for getting cell info */
int argHandler(struct cmd_syndesc *, void *);
+int truncateDatabase(void);
+int parseServerList(struct cmd_item *);
char lcell[MAXKTCREALMLEN];
afs_int32 myHost = 0;
/* check whether caller is authorized to manage RX statistics */
int
-BU_rxstat_userok(call)
- struct rx_call *call;
+BU_rxstat_userok(struct rx_call *call)
{
return afsconf_SuperUser(BU_conf, call, NULL);
}
int
-convert_cell_to_ubik(cellinfo, myHost, serverList)
- struct afsconf_cell *cellinfo;
- afs_int32 *myHost;
- afs_int32 *serverList;
+convert_cell_to_ubik(struct afsconf_cell *cellinfo, afs_int32 *myHost,
+ afs_int32 *serverList)
{
int i;
char hostname[64];
*/
void
-initializeArgHandler()
+initializeArgHandler(void)
{
struct cmd_syndesc *cptr;
/* --- */
-parseServerList(itemPtr)
- struct cmd_item *itemPtr;
+int
+parseServerList(struct cmd_item *itemPtr)
{
struct cmd_item *save;
char **serverArgs;
* truncates just the database file.
*/
-truncateDatabase()
+int
+truncateDatabase(void)
{
char *path;
afs_int32 code = 0;
#include "AFS_component_version_number.c"
-main(argc, argv)
- int argc;
- char *argv[];
+int
+main(int argc, char **argv)
{
char *whoami = argv[0];
char *dbNamePtr = 0;
struct rx_service *tservice;
struct rx_securityClass *sca[3];
- extern int afsconf_ServerAuth();
- extern int afsconf_CheckAuth();
-
extern int rx_stackSize;
- extern int BUDB_ExecuteRequest();
#ifdef AFS_NT40_ENV
/* initialize winsock */
/* initialize ubik */
ubik_CRXSecurityProc = afsconf_ClientAuth;
- ubik_CRXSecurityRock = (char *)BU_conf;
+ ubik_CRXSecurityRock = BU_conf;
ubik_SRXSecurityProc = afsconf_ServerAuth;
- ubik_SRXSecurityRock = (char *)BU_conf;
+ ubik_SRXSecurityRock = BU_conf;
ubik_CheckRXSecurityProc = afsconf_CheckAuth;
- ubik_CheckRXSecurityRock = (char *)BU_conf;
+ ubik_CheckRXSecurityRock = BU_conf;
if (ubik_nBuffers == 0)
ubik_nBuffers = 400;
}
void
-consistencyCheckDb()
+consistencyCheckDb(void)
{
/* do consistency checks on structure sizes */
if ((sizeof(struct htBlock) > BLOCKSIZE)
}
}
- /*VARARGS*/
-LogDebug(level, a, b, c, d, e, f, g, h, i)
- int level;
- char *a, *b, *c, *d, *e, *f, *g, *h, *i;
+void
+LogDebug(int level, char *fmt, ... )
{
+ va_list ap;
+ va_start(ap, fmt);
+
if (debugging >= level) {
/* log normally closed so can remove it */
globalConfPtr->log = fopen(AFSDIR_SERVER_BUDBLOG_FILEPATH, "a");
if (globalConfPtr->log != NULL) {
- fprintf(globalConfPtr->log, a, b, c, d, e, f, g, h, i);
+ vfprintf(globalConfPtr->log, fmt, ap);
fflush(globalConfPtr->log);
fclose(globalConfPtr->log);
}
}
- return 0;
+ va_end(ap);
}
static char *
return timestamp;
}
- /*VARARGS*/
-Log(a, b, c, d, e, f, g, h, i)
- char *a, *b, *c, *d, *e, *f, *g, *h, *i;
+void
+Log(char *fmt, ...)
{
+ va_list ap;
time_t now;
+ va_start(ap, fmt);
globalConfPtr->log = fopen(AFSDIR_SERVER_BUDBLOG_FILEPATH, "a");
if (globalConfPtr->log != NULL) {
now = time(0);
fprintf(globalConfPtr->log, "%s ", TimeStamp(now));
- fprintf(globalConfPtr->log, a, b, c, d, e, f, g, h, i);
+ vfprintf(globalConfPtr->log, fmt, ap);
fflush(globalConfPtr->log);
fclose(globalConfPtr->log);
}
- return 0;
+ va_end(ap);
}
- /*VARARGS*/
-LogError(code, a, b, c, d, e, f, g, h, i)
- long code;
- char *a, *b, *c, *d, *e, *f, *g, *h, *i;
+void
+LogError(long code, char *fmt, ... )
{
+ va_list ap;
time_t now;
+ va_start(ap, fmt);
globalConfPtr->log = fopen(AFSDIR_SERVER_BUDBLOG_FILEPATH, "a");
if (globalConfPtr->log != NULL) {
if (code)
fprintf(globalConfPtr->log, "%s: %s\n", afs_error_table_name(code),
afs_error_message(code));
- fprintf(globalConfPtr->log, a, b, c, d, e, f, g, h, i);
+ vfprintf(globalConfPtr->log, fmt, ap );
fflush(globalConfPtr->log);
fclose(globalConfPtr->log);
}
- return 0;
}
* ----------------
*/
-
-LogNetDump(dumpPtr)
- struct dump *dumpPtr;
+void
+LogNetDump(struct dump *dumpPtr)
{
struct dump hostDump;
extern buServerConfP globalConfPtr;
printDump(globalConfPtr->log, &hostDump);
fclose(globalConfPtr->log);
}
- return 0;
}
+
#include "budb.h"
#include "budb_errs.h"
#include "database.h"
-
+#include "budb_prototypes.h"
/* ----------------------------------
* structure printing utilities
*/
void
-printHashTable(fid, htptr)
- FILE *fid;
- struct hashTable *htptr;
+printHashTable(FILE *fid, struct hashTable *htptr)
{
fprintf(fid, "functionType = %d\n", htptr->functionType);
fprintf(fid, "threadOffset = %d\n", htptr->threadOffset);
* print the hash table structure, i.e. the header structure.
*/
int
-printMemoryHashTable(fid, mhtptr)
- FILE *fid;
- struct memoryHashTable *mhtptr;
+printMemoryHashTable(FILE *fid, struct memoryHashTable *mhtptr)
{
fprintf(fid, "threadOffset = %d\n", mhtptr->threadOffset);
fprintf(fid, "length = %d\n", mhtptr->length);
}
int
-printPrincipal(ptr)
- struct ktc_principal *ptr;
+printPrincipal(struct budb_principal *ptr)
{
printf("name = %s\n", ptr->name);
printf("instance = %s\n", ptr->instance);
}
int
-printStructDumpHeader(ptr)
- struct structDumpHeader *ptr;
+printStructDumpHeader(struct structDumpHeader *ptr)
{
printf("type = %d\n", ptr->type);
printf("structure version = %d\n", ptr->structversion);
}
int
-printTapeSet(tsptr, nss)
- struct budb_tapeSet *tsptr;
- afs_int32 nss; /* is the tapeserver name an accurate name */
+printTapeSet(struct budb_tapeSet *tsptr,
+ afs_int32 nss) /* is the tapeserver name an accurate name */
{
printf("Group id = %d\n", tsptr->id);
printf("tapeServer = %s%s\n", tsptr->tapeServer,
}
int
-printVolInfo(fid, viptr)
- FILE *fid;
- struct volInfo *viptr;
+printVolInfo(FILE *fid, struct volInfo *viptr)
{
fprintf(fid, "name = %s\n", viptr->name);
fprintf(fid, "nameHashChain = %d\n", viptr->nameHashChain);
*/
void
-volFragment_ntoh(netVfPtr, hostVfPtr)
- struct volFragment *netVfPtr, *hostVfPtr;
+volFragment_ntoh(struct volFragment *netVfPtr,
+ struct volFragment *hostVfPtr)
{
hostVfPtr->vol = ntohl(netVfPtr->vol);
hostVfPtr->sameNameChain = ntohl(netVfPtr->sameNameChain);
}
void
-volInfo_ntoh(netViPtr, hostViPtr)
- struct volInfo *netViPtr, *hostViPtr;
+volInfo_ntoh(struct volInfo *netViPtr,
+ struct volInfo *hostViPtr)
{
strcpy(hostViPtr->name, netViPtr->name);
hostViPtr->nameHashChain = ntohl(netViPtr->nameHashChain);
}
void
-tape_ntoh(netTapePtr, hostTapePtr)
- struct tape *netTapePtr, *hostTapePtr;
+tape_ntoh(struct tape *netTapePtr,
+ struct tape *hostTapePtr)
{
strcpy(hostTapePtr->name, netTapePtr->name);
hostTapePtr->nameHashChain = ntohl(netTapePtr->nameHashChain);
}
void
-dump_ntoh(netDumpPtr, hostDumpPtr)
- struct dump *netDumpPtr, *hostDumpPtr;
+dump_ntoh(struct dump *netDumpPtr,
+ struct dump *hostDumpPtr)
{
hostDumpPtr->id = ntohl(netDumpPtr->id);
hostDumpPtr->idHashChain = ntohl(netDumpPtr->idHashChain);
}
void
-DbHeader_ntoh(netptr, hostptr)
- struct DbHeader *netptr, *hostptr;
+DbHeader_ntoh(struct DbHeader *netptr,
+ struct DbHeader *hostptr)
{
hostptr->dbversion = ntohl(netptr->dbversion);
hostptr->created = ntohl(netptr->created);
}
void
-dumpEntry_ntoh(netptr, hostptr)
- struct budb_dumpEntry *netptr, *hostptr;
+dumpEntry_ntoh(struct budb_dumpEntry *netptr,
+ struct budb_dumpEntry *hostptr)
{
hostptr->id = ntohl(netptr->id);
hostptr->initialDumpID = ntohl(netptr->initialDumpID);
principal_ntoh(&netptr->dumper, &hostptr->dumper);
}
-principal_hton(hostptr, netptr)
- struct ktc_principal *hostptr, *netptr;
+void
+principal_hton(struct budb_principal *hostptr,
+ struct budb_principal *netptr)
{
strcpy(netptr->name, hostptr->name);
strcpy(netptr->instance, hostptr->instance);
strcpy(netptr->cell, hostptr->cell);
- return 0;
}
-principal_ntoh(netptr, hostptr)
- struct ktc_principal *netptr, *hostptr;
+void
+principal_ntoh(struct budb_principal *netptr,
+ struct budb_principal *hostptr)
{
strcpy(hostptr->name, netptr->name);
strcpy(hostptr->instance, netptr->instance);
strcpy(hostptr->cell, netptr->cell);
- return 0;
}
void
-structDumpHeader_hton(hostPtr, netPtr)
- struct structDumpHeader *hostPtr, *netPtr;
+structDumpHeader_hton(struct structDumpHeader *hostPtr,
+ struct structDumpHeader *netPtr)
{
netPtr->type = htonl(hostPtr->type);
netPtr->structversion = htonl(hostPtr->structversion);
}
void
-structDumpHeader_ntoh(netPtr, hostPtr)
- struct structDumpHeader *hostPtr, *netPtr;
+structDumpHeader_ntoh(struct structDumpHeader *netPtr,
+ struct structDumpHeader *hostPtr)
{
hostPtr->type = ntohl(netPtr->type);
hostPtr->structversion = ntohl(netPtr->structversion);
}
void
-tapeEntry_ntoh(netptr, hostptr)
- struct budb_tapeEntry *netptr, *hostptr;
+tapeEntry_ntoh(struct budb_tapeEntry *netptr,
+ struct budb_tapeEntry *hostptr)
{
strcpy(hostptr->name, netptr->name);
hostptr->flags = ntohl(netptr->flags);
}
int
-tapeSet_hton(hostptr, netptr)
- struct budb_tapeSet *hostptr, *netptr;
+tapeSet_hton(struct budb_tapeSet *hostptr,
+ struct budb_tapeSet *netptr)
{
netptr->id = htonl(hostptr->id);
strcpy(netptr->tapeServer, hostptr->tapeServer);
}
int
-tapeSet_ntoh(netptr, hostptr)
- struct budb_tapeSet *netptr, *hostptr;
+tapeSet_ntoh(struct budb_tapeSet *netptr,
+ struct budb_tapeSet *hostptr)
{
hostptr->id = ntohl(netptr->id);
strcpy(hostptr->tapeServer, netptr->tapeServer);
}
void
-textBlock_hton(hostptr, netptr)
- struct textBlock *hostptr, *netptr;
+textBlock_hton(struct textBlock *hostptr,
+ struct textBlock *netptr)
{
netptr->version = htonl(hostptr->version);
netptr->size = htonl(hostptr->size);
}
void
-textBlock_ntoh(netptr, hostptr)
- struct textBlock *netptr, *hostptr;
+textBlock_ntoh(struct textBlock *netptr,
+ struct textBlock *hostptr)
{
hostptr->version = ntohl(netptr->version);
hostptr->size = ntohl(netptr->size);
}
void
-textLock_hton(hostptr, netptr)
- db_lockP hostptr, netptr;
+textLock_hton(db_lockP hostptr, db_lockP netptr)
{
netptr->type = htonl(hostptr->type);
netptr->lockState = htonl(hostptr->lockState);
}
void
-textLock_ntoh(netptr, hostptr)
- db_lockP netptr, hostptr;
+textLock_ntoh(db_lockP netptr, db_lockP hostptr)
{
hostptr->type = ntohl(netptr->type);
hostptr->lockState = ntohl(netptr->lockState);
}
void
-volumeEntry_ntoh(netptr, hostptr)
- struct budb_volumeEntry *netptr, *hostptr;
+volumeEntry_ntoh(struct budb_volumeEntry *netptr,
+ struct budb_volumeEntry *hostptr)
{
strcpy(hostptr->name, netptr->name);
hostptr->flags = ntohl(netptr->flags);
*/
void
-copy_ktcPrincipal_to_budbPrincipal(ktcPtr, budbPtr)
- struct ktc_principal *ktcPtr;
- struct budb_principal *budbPtr;
+copy_ktcPrincipal_to_budbPrincipal(struct ktc_principal *ktcPtr,
+ struct budb_principal *budbPtr)
{
strncpy(budbPtr->name, ktcPtr->name, sizeof(budbPtr->name));
strncpy(budbPtr->instance, ktcPtr->instance, sizeof(budbPtr->instance));
* dumpPtr - host format
*/
-dumpToBudbDump(dumpPtr, budbDumpPtr)
- dbDumpP dumpPtr;
- struct budb_dumpEntry *budbDumpPtr;
+int
+dumpToBudbDump(dbDumpP dumpPtr, struct budb_dumpEntry *budbDumpPtr)
{
budbDumpPtr->id = dumpPtr->id;
budbDumpPtr->initialDumpID = dumpPtr->initialDumpID;
return (0);
}
-tapeToBudbTape(tapePtr, budbTapePtr)
- struct tape *tapePtr;
- struct budb_tapeEntry *budbTapePtr;
+int
+tapeToBudbTape(struct tape *tapePtr, struct budb_tapeEntry *budbTapePtr)
{
strcpy(budbTapePtr->name, tapePtr->name);
budbTapePtr->flags = tapePtr->flags;
return (0);
}
-volsToBudbVol(volFragPtr, volInfoPtr, budbVolPtr)
- struct volFragment *volFragPtr;
- struct volInfo *volInfoPtr;
- struct budb_volumeEntry *budbVolPtr;
+int
+volsToBudbVol(struct volFragment *volFragPtr, struct volInfo *volInfoPtr,
+ struct budb_volumeEntry *budbVolPtr)
{
strcpy(budbVolPtr->name, volInfoPtr->name);
budbVolPtr->flags = volInfoPtr->flags;
* n - error
*/
-default_tapeset(tapesetPtr, dumpname)
- struct budb_tapeSet *tapesetPtr;
- char *dumpname;
+int
+default_tapeset(struct budb_tapeSet *tapesetPtr, char *dumpname)
{
memset(tapesetPtr, 0, sizeof(*tapesetPtr));