#include <sys/file.h>
#include <netinet/in.h>
#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
#include <lock.h>
#include <rx/xdr.h>
#include <rx/rx.h>
#include "ubik_int.h"
int (*ubik_CheckRXSecurityProc)();
char *ubik_CheckRXSecurityRock;
+void printServerInfo();
/* routines for handling requests remotely-submitted by the sync site. These are
only write transactions (we don't propagate read trans), and there is at most one
* transactions: this is the code executed on the other servers when a
* sync site is executing a write transaction.
*/
-SDISK_Begin(rxcall, atid)
+afs_int32 SDISK_Begin(rxcall, atid)
register struct rx_call *rxcall;
struct ubik_tid *atid;
{
register afs_int32 code;
- if (code = ubik_CheckAuth(rxcall)) {
+ if ((code = ubik_CheckAuth(rxcall))) {
return code;
}
DBHOLD(ubik_dbase);
urecovery_CheckTid(atid);
if (ubik_currentTrans) {
/* If the thread is not waiting for lock - ok to end it */
+#if !defined(UBIK_PAUSE)
if (ubik_currentTrans->locktype != LOCKWAIT) {
+#endif /* UBIK_PAUSE */
udisk_end(ubik_currentTrans);
+#if !defined(UBIK_PAUSE)
}
+#endif /* UBIK_PAUSE */
ubik_currentTrans = (struct ubik_trans *) 0;
}
code = udisk_begin(ubik_dbase, UBIK_WRITETRANS, &ubik_currentTrans);
return code;}
-SDISK_Commit(rxcall, atid)
+afs_int32 SDISK_Commit(rxcall, atid)
register struct rx_call *rxcall;
struct ubik_tid *atid;
{
register afs_int32 code;
register struct ubik_dbase *dbase;
- if (code = ubik_CheckAuth(rxcall)) {
+ if ((code = ubik_CheckAuth(rxcall))) {
return code;
}
return code;
}
-SDISK_ReleaseLocks(rxcall, atid)
+afs_int32 SDISK_ReleaseLocks(rxcall, atid)
register struct rx_call *rxcall;
struct ubik_tid *atid;
{
register struct ubik_dbase *dbase;
register afs_int32 code;
- if (code = ubik_CheckAuth(rxcall)) {
+ if ((code = ubik_CheckAuth(rxcall))) {
return code;
}
}
/* If the thread is not waiting for lock - ok to end it */
+#if !defined(UBIK_PAUSE)
if (ubik_currentTrans->locktype != LOCKWAIT) {
- udisk_end(ubik_currentTrans);
- }
+#endif /* UBIK_PAUSE */
+ udisk_end(ubik_currentTrans);
+#if !defined(UBIK_PAUSE)
+ }
+#endif /* UBIK_PAUSE */
ubik_currentTrans = (struct ubik_trans *) 0;
DBRELE(dbase);
return 0;
}
-SDISK_Abort(rxcall, atid)
+afs_int32 SDISK_Abort(rxcall, atid)
register struct rx_call *rxcall;
struct ubik_tid *atid;
{
register afs_int32 code;
register struct ubik_dbase *dbase;
- if (code = ubik_CheckAuth(rxcall)) {
+ if ((code = ubik_CheckAuth(rxcall))) {
return code;
}
code = udisk_abort(ubik_currentTrans);
/* If the thread is not waiting for lock - ok to end it */
+#if !defined(UBIK_PAUSE)
if (ubik_currentTrans->locktype != LOCKWAIT) {
- udisk_end(ubik_currentTrans);
- }
+#endif /* UBIK_PAUSE */
+ udisk_end(ubik_currentTrans);
+#if !defined(UBIK_PAUSE)
+ }
+#endif /* UBIK_PAUSE */
ubik_currentTrans = (struct ubik_trans *) 0;
DBRELE(dbase);
return code;
}
-SDISK_Lock(rxcall, atid, afile, apos, alen, atype)
+afs_int32 SDISK_Lock(rxcall, atid, afile, apos, alen, atype)
register struct rx_call *rxcall;
struct ubik_tid *atid;
afs_int32 afile, apos, alen, atype; /* apos and alen are not used */
register struct ubik_dbase *dbase;
struct ubik_trans *ubik_thisTrans;
- if (code = ubik_CheckAuth(rxcall)) {
+ if ((code = ubik_CheckAuth(rxcall))) {
return code;
}
if (!ubik_currentTrans) {
}
/* Write a vector of data */
-SDISK_WriteV(rxcall, atid, io_vector, io_buffer)
+afs_int32 SDISK_WriteV(rxcall, atid, io_vector, io_buffer)
register struct rx_call *rxcall;
struct ubik_tid *atid;
iovec_wrt *io_vector;
struct ubik_iovec *iovec;
char *iobuf;
- if (code = ubik_CheckAuth(rxcall)) {
+ if ((code = ubik_CheckAuth(rxcall))) {
return code;
}
if (!ubik_currentTrans) {
return code;
}
-SDISK_Write(rxcall, atid, afile, apos, adata)
+afs_int32 SDISK_Write(rxcall, atid, afile, apos, adata)
register struct rx_call *rxcall;
struct ubik_tid *atid;
afs_int32 afile, apos;
register afs_int32 code;
register struct ubik_dbase *dbase;
- if (code = ubik_CheckAuth(rxcall)) {
+ if ((code = ubik_CheckAuth(rxcall))) {
return code;
}
if (!ubik_currentTrans) {
return code;
}
-SDISK_Truncate(rxcall, atid, afile, alen)
+afs_int32 SDISK_Truncate(rxcall, atid, afile, alen)
register struct rx_call *rxcall;
struct ubik_tid *atid;
afs_int32 afile;
register afs_int32 code;
register struct ubik_dbase *dbase;
- if (code = ubik_CheckAuth(rxcall)) {
+ if ((code = ubik_CheckAuth(rxcall))) {
return code;
}
if (!ubik_currentTrans) {
return code;
}
-SDISK_GetVersion(rxcall, aversion)
+afs_int32 SDISK_GetVersion(rxcall, aversion)
register struct rx_call *rxcall;
register struct ubik_version *aversion;
{
register afs_int32 code;
- if (code = ubik_CheckAuth(rxcall)) {
+ if ((code = ubik_CheckAuth(rxcall))) {
return code;
}
return 0;
}
-SDISK_GetFile(rxcall, file, version)
+afs_int32 SDISK_GetFile(rxcall, file, version)
register struct rx_call *rxcall;
register afs_int32 file;
struct ubik_version *version;
afs_int32 tlen;
afs_int32 length;
- if (code = ubik_CheckAuth(rxcall)) {
+ if ((code = ubik_CheckAuth(rxcall))) {
return code;
}
/* temporarily disabled because it causes problems for migration tool. Hey, it's just
return code;
}
-SDISK_SendFile(rxcall, file, length, avers)
+afs_int32 SDISK_SendFile(rxcall, file, length, avers)
register struct rx_call *rxcall;
afs_int32 file;
afs_int32 length;
register afs_int32 code;
register struct ubik_dbase *dbase;
char tbuffer[256];
- afs_int32 offset, t;
+ afs_int32 offset;
struct ubik_version tversion;
register int tlen;
struct rx_peer *tpeer;
/* send the file back to the requester */
- if (code = ubik_CheckAuth(rxcall)) {
+ if ((code = ubik_CheckAuth(rxcall))) {
goto failed;
}
This way, good label is only on good database. */
(*ubik_dbase->sync)(dbase, file);
code = (*ubik_dbase->setlabel)(dbase, file, avers);
- bcopy(avers, &ubik_dbase->version, sizeof(struct ubik_version));
+ memcpy(&ubik_dbase->version, avers, sizeof(struct ubik_version));
udisk_Invalidate(dbase, file); /* new dbase, flush disk buffers */
LWP_NoYieldSignal(&dbase->version);
DBRELE(dbase);
}
-SDISK_Probe(rxcall)
+afs_int32 SDISK_Probe(rxcall)
register struct rx_call *rxcall;
{
return 0;
* Send back my addresses to caller of this RPC
* Returns zero on success, else 1.
*/
-SDISK_UpdateInterfaceAddr(rxcall, inAddr, outAddr)
+afs_int32 SDISK_UpdateInterfaceAddr(rxcall, inAddr, outAddr)
register struct rx_call *rxcall;
UbikInterfaceAddr *inAddr, *outAddr;
{
for ( i=0; i < UBIK_MAX_INTERFACE_ADDR && inAddr->hostAddr[i]; i++)
ubik_print("%s ", afs_inet_ntoa(htonl(inAddr->hostAddr[i])));
ubik_print("\n");
+ fflush(stdout); fflush(stderr);
printServerInfo();
return UBADHOST;
}
return 0;
}
+void
printServerInfo()
{
struct ubik_server *ts;
ubik_print("\n");
}
-SDISK_SetVersion(rxcall, atid, oldversionp, newversionp)
+afs_int32 SDISK_SetVersion(rxcall, atid, oldversionp, newversionp)
struct rx_call *rxcall;
struct ubik_tid *atid;
struct ubik_version *oldversionp;
afs_int32 code=0;
struct ubik_dbase *dbase;
- if (code = ubik_CheckAuth(rxcall)) {
+ if ((code = ubik_CheckAuth(rxcall))) {
return(code);
}