From: Simon Wilkinson Date: Fri, 10 Jul 2009 19:22:18 +0000 (+0100) Subject: Add prototypes for butc X-Git-Tag: openafs-devel-1_5_61~150 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=c244091b192053084d48af0607b0e25419674a76;p=packages%2Fo%2Fopenafs.git Add prototypes for butc Prototype, fix warnings, and ansify the butc directory Reviewed-on: http://gerrit.openafs.org/39 Verified-by: Derrick Brashear Reviewed-by: Derrick Brashear --- diff --git a/src/butc/butc_internal.h b/src/butc/butc_internal.h new file mode 100644 index 000000000..aebb21205 --- /dev/null +++ b/src/butc/butc_internal.h @@ -0,0 +1,48 @@ +/* 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 _BUTC_INTERNAL_H +#define _BUTC_INTERNAL_H + +/* dbentries.c */ +extern afs_int32 useTape(struct budb_tapeEntry *, afs_int32, char *, + afs_int32, afs_int32, Date, Date, afs_int32); +extern afs_int32 addVolume(struct budb_volumeEntry *, afs_int32, char *, + char *, afs_int32, Date, afs_int32, afs_int32, + int, afs_int32); +extern afs_int32 finishTape(struct budb_tapeEntry *, afs_int32); +extern afs_int32 flushSavedEntries(afs_int32); +extern void waitDbWatcher(void); +extern afs_int32 finishDump(struct budb_dumpEntry *); + +/* list.c */ +extern afs_int32 allocTaskId(void); + +/* lwps.h */ +extern int ReadLabel(struct tc_tapeLabel *); +extern void unmountTape(afs_int32, struct butm_tapeInfo *); +extern int tapeExpired(struct butm_tapeLabel *); +extern afs_int32 PromptForTape(int, char *, afs_uint32, afs_uint32, int); +extern void GetNewLabel(struct butm_tapeInfo *, char *, char *, + struct butm_tapeLabel *); +extern void FFlushInput(void); + +/* recoverDb.c */ +extern afs_int32 Ask(char *); +extern int extractTapeSeq(char *); +extern int databaseTape(char *); + +/* tcprocs.c */ + +extern int callPermitted(struct rx_call *); + +/* tcstatus.c */ +extern int checkAbortByTaskId(afs_uint32); + +#endif + diff --git a/src/butc/lwps.c b/src/butc/lwps.c index 9f35c6f8e..3127a3abf 100644 --- a/src/butc/lwps.c +++ b/src/butc/lwps.c @@ -31,12 +31,14 @@ #include #include /* PA */ #include +#include #include #include #include "error_macros.h" #include #include #include "butc_xbsa.h" +#include "butc_internal.h" /* GLOBAL CONFIGURATION PARAMETERS */ extern int queryoperator; @@ -122,7 +124,14 @@ struct timeval tp; struct timezone tzp; /* forward declaration */ -afs_int32 readVolumeHeader( /*char *buffer,afs_int32 bufloc,(struct volumeHeader *)vhptr */ ); +afs_int32 readVolumeHeader(char *, afs_int32, struct volumeHeader *); +int FindVolTrailer(char *, afs_int32, afs_int32 *, struct volumeHeader *); +int FindVolTrailer2(char *, afs_int32, afs_int32 *, char *, afs_int32, + afs_int32 *, struct volumeHeader *); +int SkipVolume(struct tc_restoreDesc *, afs_int32, afs_int32, afs_int32, + afs_int32); + + /* The on-disk volume header or trailer can differ in size from platform to platform */ static struct TapeBlock tapeBlock; @@ -262,8 +271,7 @@ ELog(task, str, a, b, c, d, e, f, g, h, i, j) /* first proc called by anybody who intends to use the device */ void -EnterDeviceQueue(devLatch) - struct deviceSyncNode *devLatch; +EnterDeviceQueue(struct deviceSyncNode *devLatch) { ObtainWriteLock(&(devLatch->lock)); devLatch->flags = TC_DEVICEINUSE; @@ -271,8 +279,7 @@ EnterDeviceQueue(devLatch) /* last proc called by anybody finishing using the device */ void -LeaveDeviceQueue(devLatch) - struct deviceSyncNode *devLatch; +LeaveDeviceQueue(struct deviceSyncNode *devLatch) { devLatch->flags = 0; ReleaseWriteLock(&(devLatch->lock)); @@ -395,15 +402,16 @@ GetResponseKey(int seconds, char *key) #endif return rc; } -#endif /* AFS_PTHREAD_ENV - * - * /* FFlushInput - * * flush all input - * * notes: - * * only external clients are in recoverDb.c. Was static. PA - */ +#endif /* AFS_PTHREAD_ENV */ + +/* + * FFlushInput + * flush all input + * notes: + * only external clients are in recoverDb.c. Was static. PA + */ void -FFlushInput() +FFlushInput(void) { int w; @@ -429,15 +437,9 @@ FFlushInput() } int -callOutRoutine(taskId, tapePath, flag, name, dbDumpId, tapecount) - afs_int32 taskId; - char *tapePath; - int flag; - char *name; - afs_uint32 dbDumpId; - int tapecount; +callOutRoutine(afs_int32 taskId, char *tapePath, int flag, char *name, + afs_uint32 dbDumpId, int tapecount) { - afs_int32 code = 0; int pid; char StapePath[256]; @@ -546,9 +548,7 @@ callOutRoutine(taskId, tapePath, flag, name, dbDumpId, tapecount) * (unless a tape is not mounted in the first place). */ void -unmountTape(taskId, tapeInfoPtr) - afs_int32 taskId; - struct butm_tapeInfo *tapeInfoPtr; +unmountTape(afs_int32 taskId, struct butm_tapeInfo *tapeInfoPtr) { afs_int32 code; int cpid, status, rcpid; @@ -602,9 +602,7 @@ unmountTape(taskId, tapeInfoPtr) */ void static -PrintPrompt(flag, name, dumpid) - int flag; - char *name; +PrintPrompt(int flag, char *name, int dumpid) { char tapename[BU_MAXTAPELEN + 32]; char *dn; @@ -678,12 +676,8 @@ PrintPrompt(flag, name, dumpid) * only external clients are in recoverDb.c. Was static PA */ afs_int32 -PromptForTape(flag, name, dbDumpId, taskId, tapecount) - int flag; - char *name; - afs_uint32 dbDumpId; /* Specific dump ID - If non-zero */ - afs_uint32 taskId; - int tapecount; +PromptForTape(int flag, char *name, afs_uint32 dbDumpId, afs_uint32 taskId, + int tapecount) { register afs_int32 code = 0; afs_int32 wcode; @@ -861,8 +855,8 @@ PromptForTape(flag, name, dbDumpId, taskId, tapecount) */ afs_int32 -VolHeaderToHost(hostVolHeader, tapeVolHeader) - struct volumeHeader *hostVolHeader, *tapeVolHeader; +VolHeaderToHost(struct volumeHeader *hostVolHeader, + struct volumeHeader *tapeVolHeader) { switch (ntohl(tapeVolHeader->versionflags)) { case TAPE_VERSION_0: @@ -903,10 +897,9 @@ VolHeaderToHost(hostVolHeader, tapeVolHeader) } afs_int32 -ReadVolHeader(taskId, tapeInfoPtr, volHeaderPtr) - afs_int32 taskId; - struct butm_tapeInfo *tapeInfoPtr; - struct volumeHeader *volHeaderPtr; +ReadVolHeader(afs_int32 taskId, + struct butm_tapeInfo *tapeInfoPtr, + struct volumeHeader *volHeaderPtr) { afs_int32 code = 0; afs_int32 nbytes; @@ -940,12 +933,8 @@ ReadVolHeader(taskId, tapeInfoPtr, volHeaderPtr) } afs_int32 static -GetVolumeHead(taskId, tapeInfoPtr, position, volName, volId) - afs_int32 taskId; - struct butm_tapeInfo *tapeInfoPtr; - afs_int32 position; - char *volName; - afs_int32 volId; +GetVolumeHead(afs_int32 taskId, struct butm_tapeInfo *tapeInfoPtr, + afs_int32 position, char *volName, afs_int32 volId) { afs_int32 code = 0; struct volumeHeader tapeVolHeader; @@ -1014,12 +1003,8 @@ GetVolumeHead(taskId, tapeInfoPtr, position, volName, volId) } afs_int32 -GetRestoreTape(taskId, tapeInfoPtr, tname, tapeID, prompt) - afs_int32 taskId; - struct butm_tapeInfo *tapeInfoPtr; - char *tname; - afs_int32 tapeID; - int prompt; +GetRestoreTape(afs_int32 taskId, struct butm_tapeInfo *tapeInfoPtr, + char *tname, afs_int32 tapeID, int prompt) { struct butm_tapeLabel tapeLabel; afs_int32 code = 0, rc; @@ -1084,9 +1069,7 @@ GetRestoreTape(taskId, tapeInfoPtr, tname, tapeID, prompt) } afs_int32 -xbsaRestoreVolumeData(call, rparamsPtr) - register struct rx_call *call; - struct restoreParams *rparamsPtr; +xbsaRestoreVolumeData(struct rx_call *call, struct restoreParams *rparamsPtr) { afs_int32 code = 0; #ifdef xbsa @@ -1237,9 +1220,7 @@ xbsaRestoreVolumeData(call, rparamsPtr) */ afs_int32 -restoreVolumeData(call, rparamsPtr) - register struct rx_call *call; - struct restoreParams *rparamsPtr; +restoreVolumeData(struct rx_call *call, struct restoreParams *rparamsPtr) { afs_int32 curChunk; afs_uint32 totalWritten = 0; @@ -1426,10 +1407,9 @@ restoreVolumeData(call, rparamsPtr) /* SkipTape * Find all the volumes on a specific tape and mark them to skip. */ -SkipTape(Restore, size, index, tapename, tapeid, taskid) - struct tc_restoreDesc *Restore; - afs_int32 size, index, tapeid, taskid; - char *tapename; +int +SkipTape(struct tc_restoreDesc *Restore, afs_int32 size, afs_int32 index, + char *tapename, afs_int32 tapeid, afs_int32 taskid) { afs_int32 i, tid; @@ -1449,9 +1429,9 @@ SkipTape(Restore, size, index, tapename, tapeid, taskid) /* SkipVolume * Find all the entries for a volume and mark them to skip. */ -SkipVolume(Restore, size, index, volid, taskid) - struct tc_restoreDesc *Restore; - afs_int32 size, index, volid, taskid; +int +SkipVolume(struct tc_restoreDesc *Restore, afs_int32 size, afs_int32 index, + afs_int32 volid, afs_int32 taskid) { afs_int32 i; int report = 1; @@ -1472,10 +1452,9 @@ SkipVolume(Restore, size, index, volid, taskid) return 0; } -xbsaRestoreVolume(taskId, restoreInfo, rparamsPtr) - afs_uint32 taskId; - struct tc_restoreDesc *restoreInfo; - struct restoreParams *rparamsPtr; +int +xbsaRestoreVolume(afs_uint32 taskId, struct tc_restoreDesc *restoreInfo, + struct restoreParams *rparamsPtr) { afs_int32 code = 0; #ifdef xbsa @@ -1664,10 +1643,9 @@ xbsaRestoreVolume(taskId, restoreInfo, rparamsPtr) return (code); } -restoreVolume(taskId, restoreInfo, rparamsPtr) - afs_uint32 taskId; - struct tc_restoreDesc *restoreInfo; - struct restoreParams *rparamsPtr; +int +restoreVolume(afs_uint32 taskId, struct tc_restoreDesc *restoreInfo, + struct restoreParams *rparamsPtr) { afs_int32 code = 0, rc; afs_int32 newServer, newPart, newVolId; @@ -1924,10 +1902,8 @@ Restorer(void *param) { /* this is just scaffolding, creates new tape label with name */ void -GetNewLabel(tapeInfoPtr, pName, AFSName, tapeLabel) - struct butm_tapeInfo *tapeInfoPtr; - char *pName, *AFSName; - struct butm_tapeLabel *tapeLabel; +GetNewLabel(struct butm_tapeInfo *tapeInfoPtr, char *pName, char *AFSName, + struct butm_tapeLabel *tapeLabel) { struct timeval tp; struct timezone tzp; @@ -1959,13 +1935,11 @@ GetNewLabel(tapeInfoPtr, pName, AFSName, tapeLabel) strcpy(tapeLabel->creator.cell, globalCellName); } -/* extracts trailer out of buffer, nbytes is set to total data in buffer - trailer size */ +/* extracts trailer out of buffer, nbytes is set to total data in + * buffer - trailer size */ afs_int32 -ExtractTrailer(buffer, size, nbytes, volTrailerPtr) - char *buffer; - afs_int32 *nbytes; - afs_int32 size; - struct volumeHeader *volTrailerPtr; +ExtractTrailer(char *buffer, afs_int32 size, afs_int32 *nbytes, + struct volumeHeader *volTrailerPtr) { afs_int32 code = 0; afs_int32 startPos; @@ -1993,11 +1967,8 @@ ExtractTrailer(buffer, size, nbytes, volTrailerPtr) } int -FindVolTrailer(buffer, size, dSize, volTrailerPtr) - char *buffer; - afs_int32 size; - struct volumeHeader *volTrailerPtr; - afs_int32 *dSize; /* dataSize */ +FindVolTrailer(char *buffer, afs_int32 size, afs_int32 *dSize, + struct volumeHeader *volTrailerPtr) { afs_int32 offset, s; int found; @@ -2017,15 +1988,9 @@ FindVolTrailer(buffer, size, dSize, volTrailerPtr) } int -FindVolTrailer2(buffera, sizea, dataSizea, bufferb, sizeb, dataSizeb, - volTrailerPtr) - char *buffera; - afs_int32 sizea; - afs_int32 *dataSizea; - char *bufferb; - afs_int32 sizeb; - afs_int32 *dataSizeb; - struct volumeHeader *volTrailerPtr; +FindVolTrailer2(char *buffera, afs_int32 sizea, afs_int32 *dataSizea, + char *bufferb, afs_int32 sizeb, afs_int32 *dataSizeb, + struct volumeHeader *volTrailerPtr) { afs_int32 offset, s; afs_int32 headB, tailB; @@ -2070,11 +2035,9 @@ FindVolTrailer2(buffera, sizea, dataSizea, bufferb, sizeb, dataSizeb, return found; } -/* Returns true or false depending on whether the tape is expired or not */ Date -ExpirationDate(dumpid) - afs_int32 dumpid; +ExpirationDate(afs_int32 dumpid) { afs_int32 code; Date expiration = 0; @@ -2084,9 +2047,10 @@ ExpirationDate(dumpid) if (dumpid) { /* - * Get the expiration date from DB if its there. The expiration of any tape - * will be the most future expiration of any dump in the set. Can't use - * bcdb_FindTape because dumpid here pertains to the initial dump id. + * Get the expiration date from DB if its there. The expiration of + * any tape will be the most future expiration of any dump in the + * set. Can't use bcdb_FindTape because dumpid here pertains to the + * initial dump id. */ code = bcdb_FindLastTape(dumpid, &dumpEntry, &tapeEntry, &volEntry); if (!code) @@ -2095,9 +2059,10 @@ ExpirationDate(dumpid) return (expiration); } +/* Returns true or false depending on whether the tape is expired or not */ + int -tapeExpired(tapeLabelPtr) - struct butm_tapeLabel *tapeLabelPtr; +tapeExpired(struct butm_tapeLabel *tapeLabelPtr) { Date expiration; struct timeval tp; @@ -2119,10 +2084,10 @@ tapeExpired(tapeLabelPtr) * and the dump path. */ -updateTapeLabel(labelIfPtr, tapeInfoPtr, newLabelPtr) - struct labelTapeIf *labelIfPtr; - struct butm_tapeInfo *tapeInfoPtr; - struct butm_tapeLabel *newLabelPtr; +int +updateTapeLabel(struct labelTapeIf *labelIfPtr, + struct butm_tapeInfo *tapeInfoPtr, + struct butm_tapeLabel *newLabelPtr) { struct butm_tapeLabel oldLabel; afs_int32 i, code = 0; @@ -2288,8 +2253,7 @@ Labeller(void *param) */ void -PrintTapeLabel(labelptr) - struct butm_tapeLabel *labelptr; +PrintTapeLabel(struct butm_tapeLabel *labelptr) { char tapeName[BU_MAXTAPELEN + 32]; time_t t; @@ -2323,8 +2287,8 @@ PrintTapeLabel(labelptr) * back only selected fields. */ -ReadLabel(label) - struct tc_tapeLabel *label; +int +ReadLabel(struct tc_tapeLabel *label) { struct butm_tapeLabel newTapeLabel; struct butm_tapeInfo tapeInfo; @@ -2413,14 +2377,9 @@ ReadLabel(label) into consideration, different word alignment rules. */ afs_int32 -readVolumeHeader(buffer, bufloc, header) - /*in */ - char *buffer; /* buffer to read header from */ - /*in */ afs_int32 bufloc; - /* header's location in buffer */ - /*out */ struct volumeHeader *header; - /* header structure */ - +readVolumeHeader(char *buffer, /* in - buffer to read header from */ + afs_int32 bufloc, /* in - header's location in buffer */ + struct volumeHeader *header) /* out -header structure */ { struct volumeHeader vhptr, *tempvhptr; afs_int32 firstSplice = (afs_int32) ((char*)& vhptr.pad - (char*) & vhptr); diff --git a/src/butc/read_tape.c b/src/butc/read_tape.c index 31db56d6d..91321a21a 100644 --- a/src/butc/read_tape.c +++ b/src/butc/read_tape.c @@ -48,12 +48,13 @@ struct fileMark { /* also in file_tm.c */ afs_uint32 nBytes; }; +/* Forward declarations */ +int writeData(char *data, afs_int32 size); + /* Read a tape block of size 16K */ afs_int32 -readblock(buffer) - char *buffer; +readblock(char *buffer) { - static rerror = 0; u_int nread, total = 0; int rc, fmcount = 0; @@ -81,8 +82,7 @@ readblock(buffer) } void -printLabel(tapeLabelPtr) - struct tapeLabel *tapeLabelPtr; +printLabel(struct tapeLabel *tapeLabelPtr) { tapeLabelPtr->label.dumpid = ntohl(tapeLabelPtr->label.dumpid); tapeLabelPtr->label.creationTime = @@ -130,11 +130,9 @@ printLabel(tapeLabelPtr) } void -printHeader(headerPtr, isvolheader) - struct volumeHeader *headerPtr; - afs_int32 *isvolheader; +printHeader(struct volumeHeader *headerPtr, afs_int32 *isvolheader) { - static volcount = 0; + static int volcount = 0; *isvolheader = 0; headerPtr->volumeID = ntohl(headerPtr->volumeID); @@ -186,15 +184,13 @@ printHeader(headerPtr, isvolheader) } int -openOutFile(headerPtr) - struct volumeHeader *headerPtr; +openOutFile(struct volumeHeader *headerPtr) { afs_int32 len; int ch; int rc; int oflag; int skip, first; - char rest[100]; afs_hyper_t size; /* If we were asked to skip this volume, then skip it */ @@ -235,12 +231,11 @@ openOutFile(headerPtr) first = 0; } while (ch != '\n'); if (skip) { - printf("Will not restore volume %s\n", headerPtr->volumeName, - headerPtr->volumeID); + printf("Will not restore volume %s\n", headerPtr->volumeName); return 0; } } else { - printf("Retreive volume %s (%u) to file %s\n", headerPtr->volumeName, + printf("Retrieve volume %s (%u) to file %s\n", headerPtr->volumeName, headerPtr->volumeID, filename); } @@ -280,7 +275,6 @@ int writeLastBlocks(char *lastblock, char *lastblock2) { int rc; - struct volumeHeader vh; char trailer[12]; struct blockMark *bmark, *bmark2; char *data; @@ -352,7 +346,7 @@ writeLastBlocks(char *lastblock, char *lastblock2) } int -closeOutFile() +closeOutFile(void) { if (!ofdIsOpen) return 0; @@ -366,9 +360,7 @@ closeOutFile() } int -writeData(data, size) - char *data; - afs_int32 size; +writeData(char *data, afs_int32 size) { int rc; u_int nwritten; @@ -542,12 +534,10 @@ WorkerBee(struct cmd_syndesc *as, void *arock) return 0; } -main(argc, argv) - int argc; - char **argv; +int +main(int argc, char **argv) { struct cmd_syndesc *ts; - struct cmd_item *ti; setlinebuf(stdout); diff --git a/src/butc/recoverDb.c b/src/butc/recoverDb.c index faf5ac929..9451f2450 100644 --- a/src/butc/recoverDb.c +++ b/src/butc/recoverDb.c @@ -31,6 +31,7 @@ #include #include #include "error_macros.h" +#include "butc_internal.h" #define BELLCHAR 7 /* ascii for bell */ diff --git a/src/butc/tcprocs.c b/src/butc/tcprocs.c index 4e1514ef0..57e57c58e 100644 --- a/src/butc/tcprocs.c +++ b/src/butc/tcprocs.c @@ -37,14 +37,16 @@ #include #include #include +#include +#include #include "error_macros.h" #include "butc_xbsa.h" #include "butc_prototypes.h" - -static CopyDumpDesc(); -static CopyRestoreDesc(); -static CopyTapeSetDesc(); +#include "butc_internal.h" +static int CopyDumpDesc(struct tc_dumpDesc *, tc_dumpArray *); +static int CopyRestoreDesc(struct tc_restoreDesc *, tc_restoreArray *); +static int CopyTapeSetDesc(struct tc_tapeSet *, struct tc_tapeSet *); int callPermitted(struct rx_call *call) @@ -146,9 +148,6 @@ STC_LabelTape(struct rx_call *acid, struct tc_tapeLabel *label, afs_uint32 *task statusP statusPtr = NULL; afs_int32 code; - extern statusP createStatusNode(); - extern afs_int32 allocTaskId(); - #ifdef xbsa if (CONF_XBSA) return (TC_BADTASK); /* LabelTape does not apply if XBSA */ @@ -225,8 +224,6 @@ STC_PerformDump(struct rx_call *rxCallId, struct tc_dumpInterface *tcdiPtr, tc_d #endif afs_int32 code = 0; - extern statusP createStatusNode(); - if (callPermitted(rxCallId) == 0) return (TC_NOTPERMITTED); @@ -323,8 +320,6 @@ STC_PerformRestore(struct rx_call *acid, char *dumpSetName, tc_restoreArray *are PROCESS pid; #endif - extern statusP createStatusNode(); - if (callPermitted(acid) == 0) return (TC_NOTPERMITTED); @@ -390,8 +385,6 @@ STC_ReadLabel(struct rx_call *acid, struct tc_tapeLabel *label, afs_uint32 *task { afs_int32 code; - extern int ReadLabel(); - #ifdef xbsa if (CONF_XBSA) return (TC_BADTASK); /* ReadLabel does not apply if XBSA */ @@ -421,9 +414,6 @@ STC_RestoreDb(struct rx_call *rxCall, afs_uint32 *taskId) statusP statusPtr; afs_int32 code = 0; - extern statusP createStatusNode(); - extern afs_int32 allocTaskId(); - #ifdef xbsa if (CONF_XBSA) return (TC_BADTASK); /* LabelTape does not apply if XBSA */ @@ -491,9 +481,6 @@ STC_SaveDb(struct rx_call *rxCall, Date archiveTime, afs_uint32 *taskId) afs_int32 code = 0; struct saveDbIf *ptr; - extern statusP createStatusNode(); - extern afs_int32 allocTaskId(); - #ifdef xbsa if (CONF_XBSA) return (TC_BADTASK); /* LabelTape does not apply if XBSA */ @@ -573,9 +560,6 @@ STC_ScanDumps(struct rx_call *acid, afs_int32 addDbFlag, afs_uint32 *taskId) statusP statusPtr = NULL; afs_int32 code = 0; - extern afs_int32 allocTaskId(); - extern statusP createStatusNode(); - #ifdef xbsa if (CONF_XBSA) return (TC_BADTASK); /* ScanDumps does not apply if XBSA */ @@ -664,8 +648,6 @@ STC_DeleteDump(struct rx_call *acid, afs_uint32 dumpID, afs_uint32 *taskId) PROCESS pid; #endif #endif - extern statusP createStatusNode(); - extern afs_int32 allocTaskId(); *taskId = 0; if (!CONF_XBSA) diff --git a/src/butc/tcstatus.c b/src/butc/tcstatus.c index 7f06ab510..bd2c17b54 100644 --- a/src/butc/tcstatus.c +++ b/src/butc/tcstatus.c @@ -28,11 +28,13 @@ #include #include #include +#include +#include +#include "butc_internal.h" + #include "error_macros.h" #include "butc_xbsa.h" - /* tape coordinator - task status management */ -extern statusP findStatus(); extern afs_int32 xbsaType; dlqlinkT statusHead; @@ -48,10 +50,8 @@ struct Lock cmdLineLock; */ afs_int32 -STC_GetStatus(call, taskId, statusPtr) - struct rx_call *call; - afs_uint32 taskId; - struct tciStatusS *statusPtr; +STC_GetStatus(struct rx_call *call, afs_uint32 taskId, + struct tciStatusS *statusPtr) { statusP ptr; int retval = 0; @@ -81,9 +81,7 @@ STC_GetStatus(call, taskId, statusPtr) } afs_int32 -STC_EndStatus(call, taskId) - struct rx_call *call; - afs_uint32 taskId; +STC_EndStatus(struct rx_call *call, afs_uint32 taskId) { statusP ptr; int retval = 0; @@ -104,9 +102,7 @@ STC_EndStatus(call, taskId) } afs_int32 -STC_RequestAbort(call, taskId) - struct rx_call *call; - afs_uint32 taskId; +STC_RequestAbort(struct rx_call *call, afs_uint32 taskId) { statusP ptr; int retval = 0; @@ -141,14 +137,10 @@ STC_RequestAbort(call, taskId) */ afs_int32 -STC_ScanStatus(call, taskId, statusPtr, flags) - struct rx_call *call; - afs_uint32 *taskId; - struct tciStatusS *statusPtr; - afs_uint32 *flags; +STC_ScanStatus(struct rx_call *call, afs_uint32 *taskId, + struct tciStatusS *statusPtr, afs_uint32 *flags) { statusP ptr = 0; - statusP nextPtr = 0; dlqlinkP dlqPtr; if (callPermitted(call) == 0) @@ -216,14 +208,12 @@ STC_ScanStatus(call, taskId, statusPtr, flags) * n - abort requested */ -checkAbortByTaskId(taskId) - afs_uint32 taskId; +int +checkAbortByTaskId(afs_uint32 taskId) { statusP statusPtr; int retval = 0; - extern statusP findStatus(); - lock_Status(); statusPtr = findStatus(taskId); if (statusPtr) { @@ -241,13 +231,10 @@ checkAbortByTaskId(taskId) */ afs_uint32 -getStatusFlag(taskId, flag) - afs_uint32 taskId; - afs_uint32 flag; +getStatusFlag(afs_uint32 taskId, afs_uint32 flag) { statusP statusPtr; int retval = 0; - extern statusP findStatus(); lock_Status(); statusPtr = findStatus(taskId);