#include <sys/resource.h>
#endif
-#ifdef HAVE_STRING_H
#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-
#include <sys/types.h>
#include <afs/stds.h>
#include <afs/bubasics.h>
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();
start = time(0);
else if (time(0) - start > 5)
return UNOQUORUM;
+#ifdef AFS_PTHREAD_ENV
+ sleep(1);
+#else
IOMGR_Sleep(1);
+#endif
}
return 0;
}
* 1 - yes
*/
+int
callPermitted(call)
struct rx_call *call;
{
if (afsconf_SuperUser(acdir, call, NULL))
permitted = 1;
- exit:
if (acdir)
afsconf_Close(acdir);
return (permitted);
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)
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 */
};
+int
wantDump(dumpAddrParam, dumpParam, dumpListPtrParam)
char *dumpAddrParam;
char *dumpParam;
return (0);
}
+int
rememberDump(dumpAddrParam, dumpParam, dumpListPtrParam)
char *dumpAddrParam;
char *dumpParam;
}
/* 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) */
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;
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;
if (eval)
ABORT(eval);
- error_exit:
FreeReturnList(&list);
code = ubik_EndTrans(ut);
return code;
char *path = 0;
dbadr dbAddr;
int type, old, length, hash;
- int block, index;
struct memoryHashTable *mht;
afs_int32 eval, code = 0;
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);
}
+int
volFragsDump(ut, dumpfid, dbAddr)
struct ubik_trans *ut;
FILE *dumpfid;
{
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);
#endif /* notdef */
+int
checkHash(ut, hashType)
struct ubik_trans *ut;
int hashType;
int entrySize, hashTableLength;
int bucket;
int old;
- afs_int32 code;
+ afs_int32 code = 0;
mhtPtr = ht_GetType(hashType, &entrySize);
if (mhtPtr == 0)