#include <afsconfig.h>
#include <afs/param.h>
-RCSID
- ("$Header$");
+#include <roken.h>
+
+#include <afs/afs_AdminErrors.h>
#include "vsprocs.h"
#include "vosutils.h"
#include "lockprocs.h"
#include "../adminutil/afs_AdminInternal.h"
-#include <afs/afs_AdminErrors.h>
#include "afs_vosAdmin.h"
-#include <string.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef AFS_NT40_ENV
-#include <io.h>
-#endif
-static afs_int32 GroupEntries();
+static afs_int32 GroupEntries(struct rx_connection *server, volintInfo * pntr, afs_int32 count,
+ struct qHead *myQueue, afs_int32 apart);
struct release {
afs_int32 time;
* start a transaction, delete the <delvol> */
static afs_int32
CheckAndDeleteVolume(struct rx_connection *aconn, afs_int32 apart,
- afs_int32 okvol, afs_int32 delvol)
+ afs_uint32 okvol, afs_uint32 delvol)
{
afs_int32 error, code, tid, rcode;
/* forcibly remove a volume. Very dangerous call */
int
UV_NukeVolume(afs_cell_handle_p cellHandle, struct rx_connection *server,
- unsigned int partition, unsigned int volumeId, afs_status_p st)
+ unsigned int partition, afs_uint32 volumeId, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
* back new vol id in <anewid>*/
int
UV_CreateVolume(afs_cell_handle_p cellHandle, struct rx_connection *server,
- unsigned int partition, const char *volumeName,
- unsigned int quota, unsigned int *volumeId, afs_status_p st)
+ unsigned int partition, char *volumeName,
+ unsigned int quota, afs_uint32 *volumeId, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
*/
int
UV_DeleteVolume(afs_cell_handle_p cellHandle, struct rx_connection *server,
- unsigned int partition, unsigned int volumeId,
+ unsigned int partition, afs_uint32 volumeId,
afs_status_p st)
{
int rc = 0;
*/
int
-UV_MoveVolume(afs_cell_handle_p cellHandle, afs_int32 afromvol,
+UV_MoveVolume(afs_cell_handle_p cellHandle, afs_uint32 afromvol,
afs_int32 afromserver, afs_int32 afrompart, afs_int32 atoserver,
afs_int32 atopart, afs_status_p st)
{
afs_int32 rcode;
afs_int32 fromDate;
struct restoreCookie cookie;
- afs_int32 newVol, volid, backupId;
+ afs_uint32 newVol, volid, backupId;
struct volser_status tstatus;
struct destServer destination;
struct nvldbentry entry;
- int islocked, pntg;
+ int islocked;
afs_int32 error;
int same;
afs_int32 store_flags;
clonetid = 0;
error = 0;
volid = 0;
- pntg = 0;
backupId = 0;
newVol = 0;
*/
fromconn = UV_Bind(cellHandle, afromserver, AFSCONF_VOLUMEPORT);
fromtid = 0;
- pntg = 1;
tst =
AFSVolTransCreate(fromconn, afromvol, afrompart, ITOffline,
}
}
- pntg = 1;
toconn = UV_Bind(cellHandle, atoserver, AFSCONF_VOLUMEPORT); /* get connections to the servers */
fromconn = UV_Bind(cellHandle, afromserver, AFSCONF_VOLUMEPORT);
fromtid = totid = 0; /* initialize to uncreated */
int
UV_BackupVolume(afs_cell_handle_p cellHandle, afs_int32 aserver,
- afs_int32 apart, afs_int32 avolid, afs_status_p st)
+ afs_int32 apart, afs_uint32 avolid, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0, temp = 0;
afs_int32 ttid = 0, btid = 0;
- afs_int32 backupID;
+ afs_uint32 backupID;
afs_int32 rcode = 0;
char vname[VOLSER_MAXVOLNAME + 1];
struct nvldbentry entry;
}
static int
-DelVol(struct rx_connection *conn, afs_int32 vid, afs_int32 part,
+DelVol(struct rx_connection *conn, afs_uint32 vid, afs_int32 part,
afs_int32 flags)
{
afs_int32 acode, ccode, rcode, tid;
#if 0 /* doesn't appear to be used, why compile it */
static int
CloneVol(afs_cell_handle_p cellHandle, struct rx_connection *conn,
- afs_int32 rwvid, afs_int32 part, afs_int32 * rovidp, int nottemp,
+ afs_uint32 rwvid, afs_int32 part, afs_uint32 * rovidp, int nottemp,
struct nvldbentry *entry, afs_int32 * vidCreateDate, afs_status_p st)
{
int rc = 0;
{
int rc = 0;
afs_status_t tst = 0, etst = 0;
- afs_int32 volid;
+ afs_uint32 volid;
struct volser_status tstatus;
int rcode;
* sites if forceflag is 1.If its 0 complete the release if the previous
* release aborted else start a new release */
int
-UV_ReleaseVolume(afs_cell_handle_p cellHandle, afs_int32 afromvol,
+UV_ReleaseVolume(afs_cell_handle_p cellHandle, afs_uint32 afromvol,
afs_int32 afromserver, afs_int32 afrompart, int forceflag,
afs_status_p st)
{
char vname[64];
afs_int32 rcode;
- afs_int32 cloneVolId, roVolId;
+ afs_uint32 cloneVolId, roVolId;
struct replica *replicas = 0;
struct nvldbentry entry;
int i, volcount, m, fullrelease, vldbindex;
int releasecount = 0;
struct volser_status volstatus;
- memset((char *)remembertime, 0, sizeof(remembertime));
- memset((char *)&results, 0, sizeof(results));
+ memset(remembertime, 0, sizeof(remembertime));
+ memset(&results, 0, sizeof(results));
tst =
ubik_VL_SetLock(cellHandle->vos, 0, afromvol, RWVOL,
}
static int
-ReceiveFile(register int fd, register struct rx_call *call,
- register struct stat *status)
+ReceiveFile(int fd, struct rx_call *call,
+ struct stat *status)
{
- register char *buffer = (char *)0;
- register int blockSize;
+ char *buffer = (char *)0;
+ int blockSize;
afs_int32 bytesread, nbytes, bytesleft, w;
fd_set out;
afs_int32 error = 0;
* DumpFunction does the real work behind the scenes after
* extracting parameters from the rock */
int
-UV_DumpVolume(afs_cell_handle_p cellHandle, afs_int32 afromvol,
+UV_DumpVolume(afs_cell_handle_p cellHandle, afs_uint32 afromvol,
afs_int32 afromserver, afs_int32 afrompart, afs_int32 fromdate,
const char *filename, afs_status_p st)
{
}
int
-SendFile(register int fd, register struct rx_call *call,
- register struct stat *status)
+SendFile(int fd, struct rx_call *call,
+ struct stat *status)
{
char *buffer = (char *)0;
int blockSize;
*/
int
UV_RestoreVolume(afs_cell_handle_p cellHandle, afs_int32 toserver,
- afs_int32 topart, afs_int32 tovolid, const char *tovolname,
+ afs_int32 topart, afs_uint32 tovolid, char *tovolname,
int flags, const char *dumpFile, afs_status_p st)
{
int rc = 0;
afs_int32 rxError = 0;
struct volser_status tstatus;
char partName[10];
- afs_int32 pvolid;
+ afs_uint32 pvolid;
afs_int32 temptid;
int success;
struct nvldbentry entry;
*in vldb */
int
UV_AddSite(afs_cell_handle_p cellHandle, afs_int32 server, afs_int32 part,
- afs_int32 volid, afs_status_p st)
+ afs_uint32 volid, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
/*removes <server> <part> as read only site for <volid> from the vldb */
int
UV_RemoveSite(afs_cell_handle_p cellHandle, afs_int32 server, afs_int32 part,
- afs_int32 volid, afs_status_p st)
+ afs_uint32 volid, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
afs_status_t tst = 0;
struct pIDs partIds;
struct partEntries partEnts;
- register int i, j = 0;
+ int i, j = 0;
*cntp = 0;
int
UV_XListOneVolume(struct rx_connection *server, afs_int32 a_partID,
- afs_int32 a_volID, struct volintXInfo **a_resultPP,
+ afs_uint32 a_volID, struct volintXInfo **a_resultPP,
afs_status_p st)
{
int rc = 0;
*------------------------------------------------------------------------*/
int UV_ListOneVolume(struct rx_connection *server, afs_int32 a_partID,
- afs_int32 a_volID, struct volintInfo **a_resultPP,
+ afs_uint32 a_volID, struct volintInfo **a_resultPP,
afs_status_p st)
{
- int rc = 0;
+ int rc = 0;
afs_status_t tst = 0;
volEntries volumeInfo; /*Area for returned info */
struct rx_connection *server, afs_int32 apart, afs_int32 force)
{
struct aqueue elem;
- int success, temp, temp1, temp2;
- afs_int32 vcode, maxVolid = 0;
+ int success, temp;
+ afs_uint32 temp1, temp2;
+ afs_int32 vcode;
+ afs_uint32 maxVolid = 0;
struct nvldbentry entry;
int noError = 1, error, same;
int totalC, totalU, totalCE, totalUE, totalG;
ubik_VL_GetNewVolumeId(cellHandle->vos, 0, temp2,
&maxVolid);
maxVolid += temp2;
-
-
}
if (maxVolid <= elem.ids[ROVOL]) {
-
temp1 = maxVolid;
temp2 = elem.ids[ROVOL] - maxVolid + 1;
maxVolid = 0;
ubik_VL_GetNewVolumeId(cellHandle->vos, 0, temp2,
&maxVolid);
maxVolid += temp2;
-
}
if (maxVolid <= elem.ids[BACKVOL]) {
temp1 = maxVolid;
ubik_VL_GetNewVolumeId(cellHandle->vos, 0, temp2,
&maxVolid);
maxVolid += temp2;
-
}
aVLDB_GetEntryByID(cellHandle, elem.ids[RWVOL], RWVOL, &entry, &tst);
if (tst && (tst != VL_NOENT)) {
int islocked = 0;
int pass = 0;
afs_int32 modentry = 0;
- afs_int32 delentry = 0;
if (modified) {
*modified = 0;
if (tst) {
goto fail_CheckVldb;
}
- delentry = 1;
} else {
/* Replace old entry with our new one */
if (!VLDB_ReplaceEntry
struct VldbListByAttributes attributes;
nbulkentries arrayEntries;
int totalF;
- register struct nvldbentry *vllist;
- register int j;
+ struct nvldbentry *vllist;
+ int j;
afs_int32 si, nsi;
afs_int32 modified = 0;
return rc;
}
-/*rename volume <oldname> to <newname>, changing the names of the related
- *readonly and backup volumes. This operation is also idempotent.
- *salvager is capable of recovering from rename operation stopping halfway.
- *to recover run syncserver on the affected machines,it will force renaming to completion. name clashes should have been detected before calling this proc */
+/* rename volume <oldname> to <newname>, changing the names of the related
+ * readonly and backup volumes. This operation is also idempotent.
+ * salvager is capable of recovering from rename operation stopping halfway.
+ * to recover run syncserver on the affected machines,it will force
+ * renaming to completion. name clashes should have been detected before
+ * calling this proc
+ */
int
UV_RenameVolume(afs_cell_handle_p cellHandle, struct nvldbentry *entry,
- const char *newname, afs_status_p st)
+ char *newname, afs_status_p st)
{
int rc = 0;
afs_status_t tst = 0;
/*delete the volume without interacting with the vldb */
int
UV_VolumeZap(afs_cell_handle_p cellHandle, struct rx_connection *server,
- unsigned int partition, unsigned int volumeId, afs_status_p st)
+ unsigned int partition, afs_uint32 volumeId, afs_status_p st)
{
afs_int32 rcode, ttid, error, code;
int rc = 0;
int
UV_SetVolume(struct rx_connection *server, afs_int32 partition,
- afs_int32 volid, afs_int32 transflag, afs_int32 setflag,
+ afs_uint32 volid, afs_int32 transflag, afs_int32 setflag,
unsigned int sleepTime, afs_status_p st)
{
int rc = 0;