#endif
#ifdef AFS_64BIT_ENV
-hdr_static_inline(afs_int64) afs_cast_int32(afs_int32 d) { return (afs_int64) d; }
-hdr_static_inline(afs_uint64) afs_cast_uint32(afs_uint32 d) { return (afs_uint64) d; }
+hdr_static_inline(afs_int32) afs_cast_int32(afs_int32 d) { return (afs_int32) d; }
+hdr_static_inline(afs_uint32) afs_cast_uint32(afs_uint32 d) { return (afs_uint32) d; }
#else
-hdr_static_inline(long long) afs_cast_int32(afs_int32 d) { return (long long) d; }
-hdr_static_inline(unsigned long long) afs_cast_uint32(afs_uint32 d) { return (unsigned long long) d; }
+hdr_static_inline(long) afs_cast_int32(afs_int32 d) { return (long) d; }
+hdr_static_inline(unsigned long) afs_cast_uint32(afs_uint32 d) { return (unsigned long) d; }
#endif
#endif /* OPENAFS_CONFIG_AFS_STDS_H */
#include "vsprocs.h"
#include "lockprocs.h"
+/* File descriptors are HANDLE's on NT. The following typedef helps catch
+ * type errors. Duplicated from vol/ihandle.h
+ */
+#ifdef AFS_NT40_ENV
+typedef HANDLE FD_t;
+#else
+typedef int FD_t;
+#endif
+#define INVALID_FD ((FD_t)-1)
+
typedef struct file_server {
int begin_magic;
int is_valid;
}
int
-aVLDB_GetEntryByID(afs_cell_handle_p cellHandle, afs_int32 volid,
+aVLDB_GetEntryByID(afs_cell_handle_p cellHandle, afs_uint32 volid,
afs_int32 voltype, struct nvldbentry *entryp,
afs_status_p st)
{
}
int
-VLDB_ReplaceEntry(afs_cell_handle_p cellHandle, afs_int32 volid,
+VLDB_ReplaceEntry(afs_cell_handle_p cellHandle, afs_uint32 volid,
afs_int32 voltype, struct nvldbentry *entryp,
afs_int32 releasetype, afs_status_p st)
{
*/
int
-GetVolumeInfo(afs_cell_handle_p cellHandle, unsigned int volid,
+GetVolumeInfo(afs_cell_handle_p cellHandle, afs_uint32 volid,
struct nvldbentry *rentry, afs_int32 * server,
afs_int32 * partition, afs_int32 * voltype, afs_status_p st)
{
extern int VLDB_CreateEntry(afs_cell_handle_p cellHandle,
struct nvldbentry *entryp, afs_status_p st);
-extern int aVLDB_GetEntryByID(afs_cell_handle_p cellHandle, afs_int32 volid,
+extern int aVLDB_GetEntryByID(afs_cell_handle_p cellHandle, afs_uint32 volid,
afs_int32 voltype, struct nvldbentry *entryp,
afs_status_p st);
const char *namep, struct nvldbentry *entryp,
afs_status_p st);
-extern int VLDB_ReplaceEntry(afs_cell_handle_p cellHandle, afs_int32 volid,
+extern int VLDB_ReplaceEntry(afs_cell_handle_p cellHandle, afs_uint32 volid,
afs_int32 voltype, struct nvldbentry *entryp,
afs_int32 releasetype, afs_status_p st);
* 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;
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 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;
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;
}
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;
* 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
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, const 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;
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)) {
/*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;
extern int UV_NukeVolume(afs_cell_handle_p cellHandle,
struct rx_connection *server, unsigned int partition,
- unsigned int volumeId, afs_status_p st);
+ afs_uint32 volumeId, afs_status_p st);
extern int UV_CreateVolume(afs_cell_handle_p cellHandle,
struct rx_connection *server,
unsigned int partition, const char *volumeName,
- unsigned int quota, unsigned int *volumeId,
+ unsigned int quota, afs_uint32 *volumeId,
afs_status_p st);
extern 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);
-extern int UV_MoveVolume(afs_cell_handle_p cellHandle, afs_int32 afromvol,
+extern int 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);
extern int UV_BackupVolume(afs_cell_handle_p cellHandle, afs_int32 aserver,
- afs_int32 apart, afs_int32 avolid,
+ afs_int32 apart, afs_uint32 avolid,
afs_status_p st);
-extern int UV_ReleaseVolume(afs_cell_handle_p cellHandle, afs_int32 afromvol,
+extern int UV_ReleaseVolume(afs_cell_handle_p cellHandle, afs_uint32 afromvol,
afs_int32 afromserver, afs_int32 afrompart,
int forceflag, afs_status_p st);
-extern int UV_DumpVolume(afs_cell_handle_p cellHandle, afs_int32 afromvol,
+extern int 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);
extern int UV_RestoreVolume(afs_cell_handle_p cellHandle, afs_int32 toserver,
- afs_int32 topart, afs_int32 tovolid,
+ afs_int32 topart, afs_uint32 tovolid,
const char *tovolname, int flags,
const char *dumpFile, afs_status_p st);
extern int UV_AddSite(afs_cell_handle_p cellHandle, afs_int32 server,
- afs_int32 part, afs_int32 volid, afs_status_p st);
+ afs_int32 part, afs_uint32 volid, afs_status_p st);
extern int UV_RemoveSite(afs_cell_handle_p cellHandle, afs_int32 server,
- afs_int32 part, afs_int32 volid, afs_status_p st);
+ afs_int32 part, afs_uint32 volid, afs_status_p st);
extern int UV_ListPartitions(struct rx_connection *server,
struct partList *ptrPartList, afs_int32 * cntp,
afs_int32 * a_numEntsInResultP, afs_status_p st);
extern int UV_XListOneVolume(struct rx_connection *server, afs_int32 a_partID,
- afs_int32 a_volID,
+ afs_uint32 a_volID,
struct volintXInfo **a_resultPP,
afs_status_p st);
extern int UV_ListOneVolume(struct rx_connection *server, afs_int32 a_partID,
- afs_int32 a_volID, struct volintInfo **a_resultPP,
- afs_status_p st);
+ afs_uint32 a_volID, struct volintInfo **a_resultPP,
+ afs_status_p st);
extern int UV_SyncVldb(afs_cell_handle_p cellHandle,
struct rx_connection *server, afs_int32 apart,
extern int UV_VolumeZap(afs_cell_handle_p cellHandle,
struct rx_connection *serverHandle,
- unsigned int partition, unsigned int volumeId,
+ unsigned int partition, afs_uint32 volumeId,
afs_status_p st);
extern int UV_SetVolume(struct rx_connection *server, afs_int32 partition,
- afs_int32 volid, afs_int32 transflag,
+ afs_uint32 volid, afs_int32 transflag,
afs_int32 setflag, unsigned int sleep,
afs_status_p st);
afs_int32 VolidHash[3][8191];
};
struct vlentry_1 {
- afs_int32 volumeId[3];
+ afs_uint32 volumeId[3];
afs_int32 flags;
afs_int32 LockAfsId;
afs_int32 LockTimestamp;
- afs_int32 cloneId;
+ afs_uint32 cloneId;
afs_int32 spares0;
afs_int32 nextIdHash[3];
afs_int32 nextNameHash;
};
struct vlentry_2 {
- afs_int32 volumeId[3];
+ afs_uint32 volumeId[3];
afs_int32 flags;
afs_int32 LockAfsId;
afs_int32 LockTimestamp;
- afs_int32 cloneId;
+ afs_uint32 cloneId;
afs_int32 spares0;
afs_int32 nextIdHash[3];
afs_int32 nextNameHash;
struct vlentry_3 {
- afs_int32 volumeId[3];
+ afs_uint32 volumeId[3];
afs_int32 flags;
afs_int32 LockAfsId;
afs_int32 LockTimestamp;
- afs_int32 cloneId;
+ afs_uint32 cloneId;
afs_int32 nextIdHash[3];
afs_int32 nextNameHash;
char name[65];
}
for (i = 0; i < MAXTYPES; i++) {
++argp, --nargs;
- sscanf(&(*argp)[0], "%d", &entry->volumeId[i]);
+ sscanf(&(*argp)[0], "%u", &entry->volumeId[i]);
}
++argp, --nargs;
sscanf(&(*argp)[0], "%d", &entry->flags);
++argp, --nargs;
- sscanf(&(*argp)[0], "%d", &entry->cloneId);
+ sscanf(&(*argp)[0], "%u", &entry->cloneId);
}
void
if (entry->flags != -1)
entry->Mask |= VLUPDATE_FLAGS;
++argp, --nargs;
- sscanf(&(*argp)[0], "%d", &entry->cloneId);
+ sscanf(&(*argp)[0], "%u", &entry->cloneId);
if (entry->flags != -1)
entry->Mask |= VLUPDATE_CLONEID;
++argp, --nargs;
- sscanf(&(*argp)[0], "%d", &entry->ReadOnlyId);
+ sscanf(&(*argp)[0], "%u", &entry->ReadOnlyId);
if (entry->ReadOnlyId != -1)
entry->Mask |= VLUPDATE_READONLYID;
++argp, --nargs;
- sscanf(&(*argp)[0], "%d", &entry->BackupId);
+ sscanf(&(*argp)[0], "%u", &entry->BackupId);
if (entry->BackupId != -1)
entry->Mask |= VLUPDATE_BACKUPID;
++argp, --nargs;
}
afs_int32
-IdHash(afs_int32 volid)
+IdHash(afs_uint32 volid)
{
return ((abs(volid)) % HASHSIZE);
}
afs_int32 flags;
afs_uint32 ReadOnlyId;
afs_uint32 BackupId;
- afs_int32 cloneId;
+ afs_uint32 cloneId;
afs_int32 nModifiedRepsites;
afs_uint32 RepsitesMask[OMAXNSERVERS];
afs_int32 RepsitesTargetServer[OMAXNSERVERS];
afs_int32 server;
afs_int32 partition;
afs_int32 spares3;
- afs_int32 volumeid;
+ afs_uint32 volumeid;
afs_int32 flag;
};
afs_int32 serverPartition[OMAXNSERVERS]; /* Server Partition number */
afs_int32 serverFlags[OMAXNSERVERS]; /* Server flags */
afs_uint32 volumeId[MAXTYPES]; /* Corresponding volume of each type */
- afs_int32 cloneId; /* Used during cloning */
+ afs_uint32 cloneId; /* Used during cloning */
afs_int32 flags; /* General flags */
};
afs_int32 serverPartition[NMAXNSERVERS]; /* Server Partition number */
afs_int32 serverFlags[NMAXNSERVERS]; /* Server flags */
afs_uint32 volumeId[MAXTYPES]; /* Corresponding volume of each type */
- afs_int32 cloneId; /* Used during cloning */
+ afs_uint32 cloneId; /* Used during cloning */
afs_int32 flags; /* General flags */
afs_int32 matchindex;
afs_int32 spares2;
afs_int32 serverPartition[NMAXNSERVERS]; /* Server Partition number */
afs_int32 serverFlags[NMAXNSERVERS]; /* Server flags */
afs_uint32 volumeId[MAXTYPES]; /* Corresponding volume of each type */
- afs_int32 cloneId; /* Used during cloning */
+ afs_uint32 cloneId; /* Used during cloning */
afs_int32 flags; /* General flags */
afs_int32 spares1; /* The server index we matched */
afs_int32 spares2;
afs_int32 eofPtr; /* first free byte in file */
afs_int32 allocs; /* total calls to AllocBlock */
afs_int32 frees; /* total calls to FreeBlock */
- afs_int32 MaxVolumeId; /* Global volume id holder */
+ afs_uint32 MaxVolumeId; /* Global volume id holder */
afs_int32 totalEntries[MAXTYPES]; /* Total entries by voltype in vldb */
};
) = VLCREATEENTRY;
DeleteEntry(
- IN afs_int32 Volid,
+ IN afs_uint32 Volid,
afs_int32 voltype
) = VLDELETEENTRY;
GetEntryByID(
- IN afs_int32 Volid,
+ IN afs_uint32 Volid,
afs_int32 voltype,
OUT vldbentry *entry
) = VLGETENTRYBYID;
GetNewVolumeId(
- IN afs_int32 bumpcount,
- OUT afs_int32 *newvolumid
+ IN afs_uint32 bumpcount,
+ OUT afs_uint32 *newvolumid
) = VLGETNEWVOLUMEID;
ReplaceEntry(
- IN afs_int32 Volid,
+ IN afs_uint32 Volid,
afs_int32 voltype,
vldbentry *newentry,
afs_int32 ReleaseType
) = VLREPLACEENTRY;
UpdateEntry(
- IN afs_int32 Volid,
+ IN afs_uint32 Volid,
afs_int32 voltype,
VldbUpdateEntry *UpdateEntry,
afs_int32 ReleaseType
) = VLUPDATEENTRY;
SetLock(
- IN afs_int32 Volid,
+ IN afs_uint32 Volid,
afs_int32 voltype,
afs_int32 voloper
) = VLSETLOCK;
ReleaseLock(
- IN afs_int32 Volid,
+ IN afs_uint32 Volid,
afs_int32 voltype,
afs_int32 ReleaseType
) = VLRELEASELOCK;
) = VLGETADDRS;
ChangeAddr(
- IN afs_int32 ip1,
- afs_int32 ip2
+ IN afs_uint32 ip1,
+ afs_uint32 ip2
) = VLCHANGEADDR;
) = VLCREATEENTRYN;
GetEntryByIDN(
- IN afs_int32 Volid,
+ IN afs_uint32 Volid,
afs_int32 voltype,
OUT nvldbentry *entry
) = VLGETENTRYBYIDN;
ReplaceEntryN(
- IN afs_int32 Volid,
+ IN afs_uint32 Volid,
afs_int32 voltype,
nvldbentry *newentry,
afs_int32 ReleaseType
afs_int32
SVL_ChangeAddr(rxcall, ip1, ip2)
struct rx_call *rxcall;
- afs_int32 ip1, ip2;
+ afs_uint32 ip1, ip2;
{
struct ubik_trans *trans;
afs_int32 errorcode;
if (errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op))
goto end;
- VLog(1, ("Change Addr %d -> %d %s\n", ip1, ip2, rxinfo(rxcall)));
+ VLog(1, ("Change Addr %u -> %u %s\n", ip1, ip2, rxinfo(rxcall)));
if (errorcode = ChangeIPAddr(ip1, ip2, trans))
goto abort;
else {
afs_int32
SVL_DeleteEntry(rxcall, volid, voltype)
struct rx_call *rxcall;
- afs_int32 volid;
+ afs_uint32 volid;
afs_int32 voltype;
{
struct ubik_trans *trans;
if (errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op))
goto end;
- VLog(1, ("Delete Volume %d %s\n", volid, rxinfo(rxcall)));
+ VLog(1, ("Delete Volume %u %s\n", volid, rxinfo(rxcall)));
blockindex = FindByID(trans, volid, voltype, &tentry, &errorcode);
if (blockindex == 0) { /* volid not found */
if (!errorcode)
/* Get a vldb entry given its volume id; make sure it's not a deleted entry. */
GetEntryByID(rxcall, volid, voltype, aentry, new, this_op)
struct rx_call *rxcall;
- afs_int32 volid;
+ afs_uint32 volid;
afs_int32 voltype, new, this_op;
char *aentry; /* entry data copied here */
{
if (errorcode = Init_VLdbase(&trans, LOCKREAD, this_op))
return errorcode;
- VLog(5, ("GetVolumeByID %d (%d) %s\n", volid, new, rxinfo(rxcall)));
+ VLog(5, ("GetVolumeByID %u (%d) %s\n", volid, new, rxinfo(rxcall)));
blockindex = FindByID(trans, volid, voltype, &tentry, &errorcode);
if (blockindex == 0) { /* entry not found */
if (!errorcode)
afs_int32
SVL_GetEntryByID(rxcall, volid, voltype, aentry)
struct rx_call *rxcall;
- afs_int32 volid, voltype;
+ afs_uint32 volid;
+ afs_int32 voltype;
vldbentry *aentry; /* entry data copied here */
{
COUNT_REQ(VLGETENTRYBYID);
afs_int32
SVL_GetEntryByIDN(rxcall, volid, voltype, aentry)
struct rx_call *rxcall;
- afs_int32 volid, voltype;
+ afs_uint32 volid;
+ afs_int32 voltype;
nvldbentry *aentry; /* entry data copied here */
{
COUNT_REQ(VLGETENTRYBYIDN);
afs_int32
SVL_GetEntryByIDU(rxcall, volid, voltype, aentry)
struct rx_call *rxcall;
- afs_int32 volid, voltype;
+ afs_uint32 volid;
+ afs_int32 voltype;
uvldbentry *aentry; /* entry data copied here */
{
COUNT_REQ(VLGETENTRYBYIDU);
afs_int32
SVL_GetNewVolumeId(rxcall, Maxvolidbump, newvolumeid)
struct rx_call *rxcall;
- afs_int32 Maxvolidbump;
- afs_int32 *newvolumeid;
+ afs_uint32 Maxvolidbump;
+ afs_uint32 *newvolumeid;
{
- register afs_int32 errorcode, maxvolumeid;
+ register afs_int32 errorcode;
+ afs_uint32 maxvolumeid;
struct ubik_trans *trans;
COUNT_REQ(VLGETNEWVOLUMEID);
*newvolumeid = maxvolumeid = ntohl(cheader.vital_header.MaxVolumeId);
maxvolumeid += Maxvolidbump;
- VLog(1, ("GetNewVolid newmax=%d %s\n", maxvolumeid, rxinfo(rxcall)));
+ VLog(1, ("GetNewVolid newmax=%u %s\n", maxvolumeid, rxinfo(rxcall)));
cheader.vital_header.MaxVolumeId = htonl(maxvolumeid);
if (write_vital_vlheader(trans)) {
ABORT(VL_IO);
afs_int32
SVL_ReplaceEntry(rxcall, volid, voltype, newentry, releasetype)
struct rx_call *rxcall;
- afs_int32 volid;
+ afs_uint32 volid;
afs_int32 voltype;
struct vldbentry *newentry;
afs_int32 releasetype;
if (errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op))
goto end;
- VLog(1, ("OReplace Volume %d %s\n", volid, rxinfo(rxcall)));
+ VLog(1, ("OReplace Volume %u %s\n", volid, rxinfo(rxcall)));
/* find vlentry we're changing */
blockindex = FindByID(trans, volid, voltype, &tentry, &errorcode);
if (blockindex == 0) { /* entry not found */
afs_int32
SVL_ReplaceEntryN(rxcall, volid, voltype, newentry, releasetype)
struct rx_call *rxcall;
- afs_int32 volid;
+ afs_uint32 volid;
afs_int32 voltype;
struct nvldbentry *newentry;
afs_int32 releasetype;
if (errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op))
goto end;
- VLog(1, ("Replace Volume %d %s\n", volid, rxinfo(rxcall)));
+ VLog(1, ("Replace Volume %u %s\n", volid, rxinfo(rxcall)));
/* find vlentry we're changing */
blockindex = FindByID(trans, volid, voltype, &tentry, &errorcode);
if (blockindex == 0) { /* entry not found */
afs_int32
SVL_UpdateEntry(rxcall, volid, voltype, updateentry, releasetype)
struct rx_call *rxcall;
- afs_int32 volid;
+ afs_uint32 volid;
afs_int32 voltype;
afs_int32 releasetype;
struct VldbUpdateEntry *updateentry; /* Update entry copied here */
if (errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op))
goto end;
- VLog(1, ("Update Volume %d %s\n", volid, rxinfo(rxcall)));
+ VLog(1, ("Update Volume %u %s\n", volid, rxinfo(rxcall)));
blockindex = FindByID(trans, volid, voltype, &tentry, &errorcode);
if (blockindex == 0) { /* entry not found */
if (!errorcode)
afs_int32
SVL_SetLock(rxcall, volid, voltype, voloper)
struct rx_call *rxcall;
- afs_int32 volid;
+ afs_uint32 volid;
afs_int32 voltype;
afs_int32 voloper;
{
if (errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op))
goto end;
- VLog(1, ("SetLock Volume %d %s\n", volid, rxinfo(rxcall)));
+ VLog(1, ("SetLock Volume %u %s\n", volid, rxinfo(rxcall)));
blockindex = FindByID(trans, volid, voltype, &tentry, &errorcode);
if (blockindex == NULLO) {
if (!errorcode)
afs_int32
SVL_ReleaseLock(rxcall, volid, voltype, releasetype)
struct rx_call *rxcall;
- afs_int32 volid;
+ afs_uint32 volid;
afs_int32 voltype;
afs_int32 releasetype;
{
if (errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op))
goto end;
- VLog(1, ("ReleaseLock Volume %d %s\n", volid, rxinfo(rxcall)));
+ VLog(1, ("ReleaseLock Volume %u %s\n", volid, rxinfo(rxcall)));
blockindex = FindByID(trans, volid, voltype, &tentry, &errorcode);
if (blockindex == NULLO) {
if (!errorcode)
struct vital_vlheader vital_header; /* all small critical stuff are in here */
afs_uint32 IpMappedAddr[MAXSERVERID + 1]; /* Mapping of ip addresses to relative ones */
afs_int32 VolnameHash[HASHSIZE]; /* hash table for vol names */
- afs_int32 VolidHash[MAXTYPES][HASHSIZE]; /* hash table for vol ids */
+ afs_uint32 VolidHash[MAXTYPES][HASHSIZE]; /* hash table for vol ids */
afs_int32 SIT; /* spare for poss future use */
};
afs_int32 flags; /* General flags */
afs_int32 LockAfsId; /* Person who locked entry */
afs_int32 LockTimestamp; /* lock time stamp */
- afs_int32 cloneId; /* used during cloning */
+ afs_uint32 cloneId; /* used during cloning */
afs_int32 spares0; /* XXXX was AssociatedChain XXXX */
afs_int32 nextIdHash[MAXTYPES]; /* Next id hash table pointer (or freelist ->[0]) */
afs_int32 nextNameHash; /* Next name hash table pointer */
afs_int32 flags; /* General flags */
afs_int32 LockAfsId; /* Person who locked entry */
afs_int32 LockTimestamp; /* lock time stamp */
- afs_int32 cloneId; /* used during cloning */
+ afs_uint32 cloneId; /* used during cloning */
afs_int32 nextIdHash[MAXTYPES]; /* Next id hash table pointer (or freelist ->[0]) */
afs_int32 nextNameHash; /* Next name hash table pointer */
char name[VL_MAXNAMELEN]; /* Volume name */
afs_int32
FindByID(trans, volid, voltype, tentry, error)
struct ubik_trans *trans;
- afs_int32 volid;
+ afs_uint32 volid;
afs_int32 voltype;
struct nvlentry *tentry;
afs_int32 *error;
struct IHandle_s;
/* File descriptors are HANDLE's on NT. The following typedef helps catch
- * type errors.
+ * type errors. duplicated in libadmin/vos/afs_vosAdmin.c
*/
#ifdef AFS_NT40_ENV
typedef HANDLE FD_t;
/* Inode handle */
typedef struct IHandle_s {
- int ih_vid; /* Parent volume id. */
+ afs_uint32 ih_vid; /* Parent volume id. */
int ih_dev; /* device id. */
int ih_flags; /* Flags */
int ih_synced; /* should be synced next time */
*/
int
ListViceInodes(char *devname, char *mountedOn, char *resultFile,
- int (*judgeInode) (), int judgeParam, int *forcep, int forceR,
+ afs_uint32 (*judgeInode) (), afs_uint32 judgeParam, int *forcep, int forceR,
char *wpath, void *rock)
{
Log("ListViceInodes not implemented for this platform!\n");
int
ListViceInodes(char *devname, char *mountedOn, char *resultFile,
- int (*judgeInode) (), int judgeParam, int *forcep, int forceR,
+ int (*judgeInode) (), afs_uint32 judgeParam, int *forcep, int forceR,
char *wpath, void *rock)
{
FILE *inodeFile = NULL;
int
xfs_ListViceInodes(char *devname, char *mountedOn, char *resultFile,
- int (*judgeInode) (), int judgeParam, int *forcep,
+ int (*judgeInode) (), afs_uint32 judgeParam, int *forcep,
int forceR, char *wpath, void *rock)
{
FILE *inodeFile = NULL;
int
ListViceInodes(char *devname, char *mountedOn, char *resultFile,
- int (*judgeInode) (), int judgeParam, int *forcep, int forceR,
+ int (*judgeInode) (), afs_uint32 judgeParam, int *forcep, int forceR,
char *wpath, void *rock)
{
FILE *inodeFile = NULL;
extern char *afs_rawname();
int
ListViceInodes(char *devname, char *mountedOn, char *resultFile,
- int (*judgeInode) (), int judgeParam, int *forcep, int forceR,
+ int (*judgeInode) (), afs_uint32 judgeParam, int *forcep, int forceR,
char *wpath, void *rock)
{
union {
#ifdef FSSYNC_BUILD_CLIENT
int
-inode_ConvertROtoRWvolume(char *pname, afs_int32 volumeId)
+inode_ConvertROtoRWvolume(char *pname, afs_uint32 volumeId)
{
char dir_name[512], oldpath[512], newpath[512];
char volname[20];
memset(&specinos, 0, sizeof(specinos));
- (void)afs_snprintf(headername, sizeof headername, VFORMAT, volumeId);
+ (void)afs_snprintf(headername, sizeof headername, VFORMAT, afs_cast_uint32(volumeId));
(void)afs_snprintf(oldpath, sizeof oldpath, "%s/%s", pname, headername);
fd = open(oldpath, O_RDONLY);
if (fd < 0) {
}
#endif
- (void)afs_snprintf(headername, sizeof headername, VFORMAT, h.id);
+ (void)afs_snprintf(headername, sizeof headername, VFORMAT, afs_cast_uint32(h.id));
(void)afs_snprintf(newpath, sizeof newpath, "%s/%s", pname, headername);
fd = open(newpath, O_CREAT | O_EXCL | O_RDWR, 0644);
if (fd < 0) {
struct ViceInodeInfo *,
char *, char *), FILE * fp,
int (*judgeFun) (struct ViceInodeInfo *,
- int vid, void *),
- int singleVolumeNumber, void *rock);
+ afs_uint32 vid, void *),
+ afs_uint32 singleVolumeNumber, void *rock);
/* WriteInodeInfo
*/
int
ListViceInodes(char *devname, char *mountedOn, char *resultFile,
- int (*judgeInode) (struct ViceInodeInfo * info, int vid, void *rock),
- int singleVolumeNumber, int *forcep, int forceR, char *wpath,
+ int (*judgeInode) (struct ViceInodeInfo * info, afs_uint32 vid, void *rock),
+ afs_uint32 singleVolumeNumber, int *forcep, int forceR, char *wpath,
void *rock)
{
FILE *fp = (FILE *) - 1;
namei_ListAFSFiles(char *dev,
int (*writeFun) (FILE *, struct ViceInodeInfo *, char *,
char *), FILE * fp,
- int (*judgeFun) (struct ViceInodeInfo *, int, void *),
- int singleVolumeNumber, void *rock)
+ int (*judgeFun) (struct ViceInodeInfo *, afs_uint32, void *),
+ afs_uint32 singleVolumeNumber, void *rock)
{
IHandle_t ih;
namei_t name;
namei_ListAFSSubDirs(IHandle_t * dirIH,
int (*writeFun) (FILE *, struct ViceInodeInfo *, char *,
char *), FILE * fp,
- int (*judgeFun) (struct ViceInodeInfo *, int, void *),
- int singleVolumeNumber, void *rock)
+ int (*judgeFun) (struct ViceInodeInfo *, afs_uint32, void *),
+ afs_uint32 singleVolumeNumber, void *rock)
{
IHandle_t myIH = *dirIH;
namei_t name;
*/
int
-namei_ConvertROtoRWvolume(char *pname, afs_int32 volumeId)
+namei_ConvertROtoRWvolume(char *pname, afs_uint32 volumeId)
{
#ifdef FSSYNC_BUILD_CLIENT
namei_t n;
char headername[16];
afs_int32 error = 0;
- (void)afs_snprintf(headername, sizeof headername, VFORMAT, volumeId);
+ (void)afs_snprintf(headername, sizeof headername, VFORMAT, afs_cast_uint32(volumeId));
(void)afs_snprintf(oldpath, sizeof oldpath, "%s/%s", pname, headername);
fd = open(oldpath, O_RDONLY);
if (fd < 0) {
h.smallVnodeIndex_hi = h.id;
h.largeVnodeIndex_hi = h.id;
h.linkTable_hi = h.id;
- (void)afs_snprintf(headername, sizeof headername, VFORMAT, h.id);
+ (void)afs_snprintf(headername, sizeof headername, VFORMAT, afs_cast_uint32(h.id));
(void)afs_snprintf(newpath, sizeof newpath, "%s/%s", pname, headername);
fd = open(newpath, O_CREAT | O_EXCL | O_RDWR, 0644);
if (fd < 0) {
struct ViceInodeInfo * info,
char *dir, char *file), FILE * fp,
int (*judge_fun) (struct ViceInodeInfo * info,
- int vid, void *rock),
- int singleVolumeNumber, void *rock);
+ afs_uint32 vid, void *rock),
+ afs_uint32 singleVolumeNumber, void *rock);
int ListViceInodes(char *devname, char *mountedOn, char *resultFile,
- int (*judgeInode) (struct ViceInodeInfo * info, int vid,
+ int (*judgeInode) (struct ViceInodeInfo * info, afs_uint32 vid,
void *rock),
- int singleVolumeNumber, int *forcep, int forceR,
+ afs_uint32 singleVolumeNumber, int *forcep, int forceR,
char *wpath, void *rock);
}
Inode
-nt_icreate(IHandle_t * h, char *part, int p1, int p2, int p3, int p4)
+nt_icreate(IHandle_t * h, char *part, afs_uint32 p1, afs_uint32 p2, afs_uint32 p3, afs_uint32 p4)
{
char filename[128];
b32_string_t str1;
/* ListViceInodes - write inode data to a results file. */
static int DecodeInodeName(char *name, int *p1, int *p2);
-static int DecodeVolumeName(char *name, int *vid);
+static int DecodeVolumeName(char *name, afs_uint32 *vid);
static int nt_ListAFSSubDirs(IHandle_t * dirIH,
int (*write_fun) (FILE *, struct ViceInodeInfo *,
char *, char *), FILE * fp,
int (*judgeFun) (struct ViceInodeInfo *,
- int vid, void *rock),
- int singleVolumeNumber, void *rock);
+ afs_uint32 vid, void *rock),
+ afs_uint32 singleVolumeNumber, void *rock);
/* WriteInodeInfo
*/
int
ListViceInodes(char *devname, char *mountedOn, char *resultFile,
- int (*judgeInode) (struct ViceInodeInfo * info, int vid, void *rock),
- int singleVolumeNumber, int *forcep, int forceR, char *wpath,
+ int (*judgeInode) (struct ViceInodeInfo * info, afs_uint32 vid, void *rock),
+ afs_uint32 singleVolumeNumber, int *forcep, int forceR, char *wpath,
void *rock)
{
FILE *fp = (FILE *) - 1;
nt_ListAFSFiles(char *dev,
int (*writeFun) (FILE *, struct ViceInodeInfo *, char *,
char *), FILE * fp,
- int (*judgeFun) (struct ViceInodeInfo *, int, void *),
- int singleVolumeNumber, void *rock)
+ int (*judgeFun) (struct ViceInodeInfo *, afs_uint32, void *),
+ afs_uint32 singleVolumeNumber, void *rock)
{
IHandle_t h;
char name[MAX_PATH];
nt_ListAFSSubDirs(IHandle_t * dirIH,
int (*writeFun) (FILE *, struct ViceInodeInfo *, char *,
char *), FILE * fp,
- int (*judgeFun) (struct ViceInodeInfo *, int, void *),
- int singleVolumeNumber, void *rock)
+ int (*judgeFun) (struct ViceInodeInfo *, afs_uint32, void *),
+ afs_uint32 singleVolumeNumber, void *rock)
{
int i;
IHandle_t myIH = *dirIH;
/* The name begins with "Vol_" and ends with .data. See nt_HandleToVolDir() */
static int
-DecodeVolumeName(char *name, int *vid)
+DecodeVolumeName(char *name, afs_uint32 *vid)
{
char stmp[32];
int len;
/* Inode operations */
extern Inode nt_MakeSpecIno(int type);
-extern Inode nt_icreate(IHandle_t * h, char *p, int p1, int p2, int p3,
- int p4);
+extern Inode nt_icreate(IHandle_t * h, char *p, afs_uint32 p1, afs_uint32 p2,
+ afs_uint32 p3, afs_uint32 p4);
extern FD_t nt_iopen(IHandle_t * h);
extern int nt_irelease(IHandle_t * h);
int nt_iread(IHandle_t * h, int offset, char *buf, int size);
int nt_ListAFSFiles(char *dev,
int (*write_fun) (FILE * fp, struct ViceInodeInfo *,
char *dir, char *file), FILE * fp,
- int (*judge_fun) (struct ViceInodeInfo *, int vid, void *rock),
- int singleVolumeNumber, void *rock);
+ int (*judge_fun) (struct ViceInodeInfo *, afs_uint32 vid, void *rock),
+ afs_uint32 singleVolumeNumber, void *rock);
int ListViceInodes(char *devname, char *mountedOn, char *resultFile,
- int (*judgeInode) (struct ViceInodeInfo * info, int vid, void *rock),
- int singleVolumeNumber, int *forcep, int forceR,
+ int (*judgeInode) (struct ViceInodeInfo * info, afs_uint32 vid, void *rock),
+ afs_uint32 singleVolumeNumber, int *forcep, int forceR,
char *wpath, void *rock);
{
register struct cmd_item *ti;
int err = 0;
- int volumeId = 0;
+ afs_uint32 volumeId = 0;
char *partName = 0;
struct DiskPartition64 *partP = NULL;
}
}
(void)afs_snprintf(name1, sizeof name1, VFORMAT,
- (unsigned long)volumeId);
+ afs_cast_uint32(volumeId));
if (dsizeOnly && !saveinodes)
printf
("Volume-Id\t Volsize Auxsize Inodesize AVolsize SizeDiff (VolName)\n");
CountVolumeInodes(register struct ViceInodeInfo *ip, int maxInodes,
register struct InodeSummary *summary)
{
- int volume = ip->u.vnode.volumeId;
- int rwvolume = volume;
+ VolumeId volume = ip->u.vnode.volumeId;
+ VolumeId rwvolume = volume;
register int n, nSpecial;
register Unique maxunique;
n = nSpecial = 0;
}
int
-OnlyOneVolume(struct ViceInodeInfo *inodeinfo, int singleVolumeNumber, void *rock)
+OnlyOneVolume(struct ViceInodeInfo *inodeinfo, afs_uint32 singleVolumeNumber, void *rock)
{
if (inodeinfo->u.vnode.vnodeNumber == INODESPECIAL)
return (inodeinfo->u.special.parentId == singleVolumeNumber);
|| (vsp->header.id == singleVolumeNumber
|| vsp->header.parent == singleVolumeNumber)) {
(void)afs_snprintf(nameShouldBe, sizeof nameShouldBe,
- VFORMAT, vsp->header.id);
+ VFORMAT, afs_cast_uint32(vsp->header.id));
if (singleVolumeNumber
&& vsp->header.id != singleVolumeNumber)
AskOffline(vsp->header.id, fileSysPartition->name);
if (isp->volSummary == NULL) {
char path[64];
char headerName[64];
- (void)afs_snprintf(headerName, sizeof headerName, VFORMAT, isp->volumeId);
+ (void)afs_snprintf(headerName, sizeof headerName, VFORMAT, afs_cast_uint32(isp->volumeId));
(void)afs_snprintf(path, sizeof path, "%s/%s", fileSysPath, headerName);
if (check) {
Log("No header file for volume %u\n", isp->volumeId);
if (isp->volSummary->fileName) {
strcpy(headerName, isp->volSummary->fileName);
} else {
- (void)afs_snprintf(headerName, sizeof headerName, VFORMAT, isp->volumeId);
+ (void)afs_snprintf(headerName, sizeof headerName, VFORMAT, afs_cast_uint32(isp->volumeId));
isp->volSummary->fileName = ToString(headerName);
}
(void)afs_snprintf(path, sizeof path, "%s/%s", fileSysPath, headerName);
*ec = 0;
name[0] = '/';
- (void)afs_snprintf(&name[1], (sizeof name) - 1, VFORMAT, volumeId);
+ (void)afs_snprintf(&name[1], (sizeof name) - 1, VFORMAT, afs_cast_uint32(volumeId));
for (dp = DiskPartitionList; dp; dp = dp->next) {
struct afs_stat status;
strcpy(path, VPartitionPath(dp));
VolumeExternalName(VolumeId volumeId)
{
static char name[VMAXPATHLEN];
- (void)afs_snprintf(name, sizeof name, VFORMAT, volumeId);
+ (void)afs_snprintf(name, sizeof name, VFORMAT, afs_cast_uint32(volumeId));
return name;
}
static int
VolumeExternalName_r(VolumeId volumeId, char * name, size_t len)
{
- return afs_snprintf(name, len, VFORMAT, volumeId);
+ return afs_snprintf(name, len, VFORMAT, afs_cast_uint32(volumeId));
}
#endif
vol.stamp.magic = VOLUMEINFOMAGIC;
vol.stamp.version = VOLUMEINFOVERSION;
vol.destroyMe = DESTROY_ME;
- (void)afs_snprintf(headerName, sizeof headerName, VFORMAT, vol.id);
+ (void)afs_snprintf(headerName, sizeof headerName, VFORMAT, afs_cast_uint32(vol.id));
(void)afs_snprintf(volumePath, sizeof volumePath, "%s/%s",
VPartitionPath(partition), headerName);
fd = afs_open(volumePath, O_CREAT | O_EXCL | O_WRONLY, 0600);
{
register struct cmd_item *ti;
int err = 0;
- int volumeId = 0;
+ afs_uint32 volumeId = 0;
char *partName = 0;
char *fileName = NULL;
struct DiskPartition64 *partP = NULL;
if ((ti = as->parms[0].items))
partName = ti->data;
if ((ti = as->parms[1].items))
- volumeId = atoi(ti->data);
+ volumeId = (afs_uint32)atoi(ti->data);
if ((ti = as->parms[2].items))
fileName = ti->data;
if ((ti = as->parms[3].items))
const SIZE = 1024;
struct volser_status {
- afs_int32 volID; /* Volume id--unique over all systems */
+ afs_uint32 volID; /* Volume id--unique over all systems */
afs_int32 nextUnique; /* Next vnode uniquifier for this volume */
int type; /* readwrite, etc. */
- afs_int32 parentID; /* Id of parent, if type==readonly or backup */
- afs_int32 cloneID; /* Latest read-only clone, if type==readwrite */
- afs_int32 backupID; /* Latest backup copy of this read write volume */
- afs_int32 restoredFromID; /* The id in a dump this volume was restored from--used simply
+ afs_uint32 parentID; /* Id of parent, if type==readonly or backup */
+ afs_uint32 cloneID; /* Latest read-only clone, if type==readwrite */
+ afs_uint32 backupID; /* Latest backup copy of this read write volume */
+ afs_uint32 restoredFromID; /* The id in a dump this volume was restored from--used simply
to make sure that an incremental dump is not restored on top
of something inappropriate: Note: this field itself is NEVER
dumped!!! */
struct volintInfo {
#define VNAMESIZE 32
char name[VNAMESIZE];
- afs_int32 volid; /* volume's id */
+ afs_uint32 volid; /* volume's id */
afs_int32 type; /* read-only, read-write, backup */
- afs_int32 backupID;
- afs_int32 parentID;
- afs_int32 cloneID;
+ afs_uint32 backupID;
+ afs_uint32 parentID;
+ afs_uint32 cloneID;
afs_int32 status;
afs_int32 copyDate;
unsigned char inUse;
*/
struct volintXInfo {
char name[VNAMESIZE];
- afs_int32 volid; /*Volume's ID*/
+ afs_uint32 volid; /*Volume's ID*/
afs_int32 type; /*RWVOL, ROVOL, BACKVOL*/
- afs_int32 backupID; /*Backup volume ID*/
- afs_int32 parentID; /*Parent volume ID*/
- afs_int32 cloneID; /*Clone volume ID*/
+ afs_uint32 backupID; /*Backup volume ID*/
+ afs_uint32 parentID; /*Parent volume ID*/
+ afs_uint32 cloneID; /*Clone volume ID*/
afs_int32 status; /*Volume status*/
afs_int32 copyDate; /*Date when this volume INSTANCE created*/
unsigned char inUse; /*In use at time of last crash?*/
afs_int32 time; /* time transaction was last active (for timeouts) */
afs_int32 creationTime; /* time the transaction started */
afs_int32 returnCode; /* transaction error code */
- afs_int32 volid; /*sequence number of the next packet to be read*/ /* open volume's id */
+ afs_uint32 volid; /*sequence number of the next packet to be read*/ /* open volume's id */
afs_int32 partition; /* open volume's partition */
short iflags; /* initial attach mode flags (IT*) */
char vflags; /* current volume status flags (VT*) */
struct restoreCookie {
char name[32];
afs_int32 type;
- afs_int32 clone;
- afs_int32 parent;
+ afs_uint32 clone;
+ afs_uint32 parent;
};
struct replica {
IN afs_int32 partition,
string name<>,
IN afs_int32 type,
- IN afs_int32 parent,
- INOUT afs_int32 *volid,
+ IN afs_uint32 parent,
+ INOUT afs_uint32 *volid,
OUT afs_int32 *trans
) = VOLCREATEVOLUME;
proc Clone(
IN afs_int32 trans,
- IN afs_int32 purgeVol,
+ IN afs_uint32 purgeVol,
IN afs_int32 newType,
IN string newName<>,
- INOUT afs_int32 *newVol
+ INOUT afs_uint32 *newVol
) = VOLCLONE;
proc SetFlags(
) = VOLGETFLAGS;
proc TransCreate(
- IN afs_int32 volume,
+ IN afs_uint32 volume,
IN afs_int32 partition,
IN afs_int32 flags,
OUT afs_int32 *trans
proc GetNthVolume(
IN afs_int32 index,
- OUT afs_int32 *volume,
+ OUT afs_uint32 *volume,
OUT afs_int32 *partition
) = VOLGETNTHVOLUME;
proc SignalRestore(
IN string name<>,
int type,
- afs_int32 pid,
- afs_int32 cloneid
+ afs_uint32 pid,
+ afs_uint32 cloneid
) = VOLSIGRESTORE;
proc ListPartitions(
IN afs_int32 tId,
string name<>,
afs_int32 type,
- afs_int32 pId,
- afs_int32 cloneId,
- afs_int32 backupId
+ afs_uint32 pId,
+ afs_uint32 cloneId,
+ afs_uint32 backupId
) = VOLSETIDSTYPES;
proc Monitor(
proc ReClone(
IN afs_int32 tid,
- afs_int32 cloneID
+ afs_uint32 cloneID
) = VOLRECLONE;
proc ListOneVolume(
IN afs_int32 partID,
- afs_int32 volid,
+ afs_uint32 volid,
OUT volEntries *resultEntries
) = VOLLISTONEVOL;
proc NukeVolume(
IN afs_int32 partID,
- afs_int32 volID
+ afs_uint32 volID
) = VOLNUKE;
proc SetDate(
proc XListOneVolume(
IN afs_int32 partID,
- afs_int32 volid,
+ afs_uint32 volid,
OUT volXEntries *resultXEntries
) = VOLXLISTONEVOL;
proc ConvertROtoRWvolume(
IN afs_int32 partid,
- IN afs_int32 volid
+ IN afs_uint32 volid
) = VOLCONVERTRO;
proc GetSize(
#include <string.h>
#include <errno.h>
#ifdef AFS_NT40_ENV
+#include <stdlib.h>
#include <fcntl.h>
#include <winsock2.h>
#else
{
register struct DiskPartition64 *tp;
for (tp = DiskPartitionList; tp; tp = tp->next) {
- if (tp->lock_fd != -1) {
+ if (tp->lock_fd != INVALID_FD) {
close(tp->lock_fd); /* releases flock held on this partition */
- tp->lock_fd = -1;
+ tp->lock_fd = INVALID_FD;
}
}
return 0;
}
static int
-ConvertVolume(afs_int32 avol, char *aname, afs_int32 asize)
+ConvertVolume(afs_uint32 avol, char *aname, afs_int32 asize)
{
if (asize < 18)
return -1;
/* the only attach function that takes a partition is "...ByName", so we use it */
struct Volume *
-XAttachVolume(afs_int32 *error, afs_int32 avolid, afs_int32 apartid, int amode)
+XAttachVolume(afs_int32 *error, afs_uint32 avolid, afs_int32 apartid, int amode)
{
char pbuf[30], vbuf[20];
register struct Volume *tv;
if (dp) {
strncpy(partition->name, dp->name, 32);
strncpy(partition->devName, dp->devName, 32);
- partition->lock_fd = dp->lock_fd;
+ partition->lock_fd = (int)dp->lock_fd;
partition->free = dp->free;
partition->minFree = dp->totalUsable;
return 0;
/* obliterate a volume completely, and slowly. */
afs_int32
-SAFSVolNukeVolume(struct rx_call *acid, afs_int32 apartID, afs_int32 avolID)
+SAFSVolNukeVolume(struct rx_call *acid, afs_int32 apartID, afs_uint32 avolID)
{
afs_int32 code;
}
afs_int32
-VolNukeVolume(struct rx_call *acid, afs_int32 apartID, afs_int32 avolID)
+VolNukeVolume(struct rx_call *acid, afs_int32 apartID, afs_uint32 avolID)
{
char partName[50];
afs_int32 error;
*/
afs_int32
SAFSVolCreateVolume(struct rx_call *acid, afs_int32 apart, char *aname,
- afs_int32 atype, afs_int32 aparent, afs_int32 *avolid,
+ afs_int32 atype, afs_uint32 aparent, afs_uint32 *avolid,
afs_int32 *atrans)
{
afs_int32 code;
afs_int32
VolCreateVolume(struct rx_call *acid, afs_int32 apart, char *aname,
- afs_int32 atype, afs_int32 aparent, afs_int32 *avolid,
+ afs_int32 atype, afs_uint32 aparent, afs_uint32 *avolid,
afs_int32 *atrans)
{
afs_int32 error;
register Volume *vp;
afs_int32 junk; /* discardable error code */
- register afs_int32 volumeID, doCreateRoot = 1;
+ afs_uint32 volumeID;
+ afs_int32 doCreateRoot = 1;
register struct volser_trans *tt;
char ppath[30];
char caller[MAXKTCNAMELEN];
*/
/* for efficiency reasons, sometimes faster to piggyback a purge here */
afs_int32
-SAFSVolClone(struct rx_call *acid, afs_int32 atrans, afs_int32 purgeId,
- afs_int32 newType, char *newName, afs_int32 *newNumber)
+SAFSVolClone(struct rx_call *acid, afs_int32 atrans, afs_uint32 purgeId,
+ afs_int32 newType, char *newName, afs_uint32 *newNumber)
{
afs_int32 code;
}
afs_int32
-VolClone(struct rx_call *acid, afs_int32 atrans, afs_int32 purgeId,
- afs_int32 newType, char *newName, afs_int32 *newNumber)
+VolClone(struct rx_call *acid, afs_int32 atrans, afs_uint32 purgeId,
+ afs_int32 newType, char *newName, afs_uint32 *newNumber)
{
- VolumeId newId;
+ afs_uint32 newId;
register struct Volume *originalvp, *purgevp, *newvp;
Error error, code;
register struct volser_trans *tt, *ttc;
/* reclone this volume into the specified id */
afs_int32
-SAFSVolReClone(struct rx_call *acid, afs_int32 atrans, afs_int32 cloneId)
+SAFSVolReClone(struct rx_call *acid, afs_int32 atrans, afs_uint32 cloneId)
{
afs_int32 code;
* See volser.h for definition of iflags (the constants are named IT*).
*/
afs_int32
-SAFSVolTransCreate(struct rx_call *acid, afs_int32 volume, afs_int32 partition,
+SAFSVolTransCreate(struct rx_call *acid, afs_uint32 volume, afs_int32 partition,
afs_int32 iflags, afs_int32 *ttid)
{
afs_int32 code;
}
afs_int32
-VolTransCreate(struct rx_call *acid, afs_int32 volume, afs_int32 partition,
+VolTransCreate(struct rx_call *acid, afs_uint32 volume, afs_int32 partition,
afs_int32 iflags, afs_int32 *ttid)
{
register struct volser_trans *tt;
* Both the volume number and partition number (one-based) are returned.
*/
afs_int32
-SAFSVolGetNthVolume(struct rx_call *acid, afs_int32 aindex, afs_int32 *avolume,
+SAFSVolGetNthVolume(struct rx_call *acid, afs_int32 aindex, afs_uint32 *avolume,
afs_int32 *apart)
{
afs_int32 code;
* - a noop now !*/
afs_int32
SAFSVolSignalRestore(struct rx_call *acid, char volname[], int volType,
- afs_int32 parentId, afs_int32 cloneId)
+ afs_uint32 parentId, afs_uint32 cloneId)
{
return 0;
}
afs_int32
XVolListPartitions(struct rx_call *acid, struct partEntries *pEntries)
{
- struct stat rbuf, pbuf;
char namehead[9];
struct partList partList;
struct DiskPartition64 *dp;
/*return the name of the next volume header in the directory associated with dirp and dp.
*the volume id is returned in volid, and volume header name is returned in volname*/
int
-GetNextVol(DIR * dirp, char *volname, afs_int32 * volid)
+GetNextVol(DIR * dirp, char *volname, afs_uint32 * volid)
{
struct dirent *dp;
vol_info_list_mode_t mode)
{
int code = -1;
- int reason;
afs_int32 error;
struct volser_trans *ttc = NULL;
struct Volume *fill_tv, *tv = NULL;
/*return the header information about the <volid> */
afs_int32
-SAFSVolListOneVolume(struct rx_call *acid, afs_int32 partid, afs_int32
- volumeId, volEntries *volumeInfo)
+SAFSVolListOneVolume(struct rx_call *acid, afs_int32 partid,
+ afs_uint32 volumeId, volEntries *volumeInfo)
{
afs_int32 code;
}
afs_int32
-VolListOneVolume(struct rx_call *acid, afs_int32 partid, afs_int32
- volumeId, volEntries *volumeInfo)
+VolListOneVolume(struct rx_call *acid, afs_int32 partid,
+ afs_uint32 volumeId, volEntries *volumeInfo)
{
volintInfo *pntr;
struct DiskPartition64 *partP;
char pname[9], volname[20];
afs_int32 error = 0;
DIR *dirp;
- afs_int32 volid;
+ afs_uint32 volid;
int found = 0;
- unsigned int now;
int code;
volint_info_handle_t handle;
afs_int32
SAFSVolXListOneVolume(struct rx_call *a_rxCidP, afs_int32 a_partID,
- afs_int32 a_volID, volXEntries *a_volumeXInfoP)
+ afs_uint32 a_volID, volXEntries *a_volumeXInfoP)
{
afs_int32 code;
afs_int32
VolXListOneVolume(struct rx_call *a_rxCidP, afs_int32 a_partID,
- afs_int32 a_volID, volXEntries *a_volumeXInfoP)
+ afs_uint32 a_volID, volXEntries *a_volumeXInfoP)
{ /*SAFSVolXListOneVolume */
volintXInfo *xInfoP; /*Ptr to the extended vol info */
struct DiskPartition64 *partP; /*Ptr to partition */
char pname[9], volname[20]; /*Partition, volume names */
- afs_int32 error; /*Error code */
DIR *dirp; /*Partition directory ptr */
- afs_int32 currVolID; /*Current volume ID */
+ afs_uint32 currVolID; /*Current volume ID */
int found = 0; /*Did we find the volume we need? */
- unsigned int now;
int code;
volint_info_handle_t handle;
char pname[9], volname[20];
afs_int32 error = 0;
DIR *dirp;
- afs_int32 volid;
- unsigned int now;
+ afs_uint32 volid;
int code;
volint_info_handle_t handle;
char pname[9], volname[20]; /*Partition, volume names */
afs_int32 error = 0; /*Return code */
DIR *dirp; /*Partition directory ptr */
- afs_int32 volid; /*Current volume ID */
- unsigned int now;
+ afs_uint32 volid; /*Current volume ID */
int code;
volint_info_handle_t handle;
}
afs_int32
-SAFSVolSetIdsTypes(struct rx_call *acid, afs_int32 atid, char name[], afs_int32 type, afs_int32 pId, afs_int32 cloneId, afs_int32 backupId)
+SAFSVolSetIdsTypes(struct rx_call *acid, afs_int32 atid, char name[], afs_int32 type, afs_uint32 pId, afs_uint32 cloneId, afs_uint32 backupId)
{
afs_int32 code;
}
afs_int32
-VolSetIdsTypes(struct rx_call *acid, afs_int32 atid, char name[], afs_int32 type, afs_int32 pId, afs_int32 cloneId, afs_int32 backupId)
+VolSetIdsTypes(struct rx_call *acid, afs_int32 atid, char name[], afs_int32 type, afs_uint32 pId, afs_uint32 cloneId, afs_uint32 backupId)
{
struct Volume *tv;
afs_int32 error = 0;
afs_int32
SAFSVolConvertROtoRWvolume(struct rx_call *acid, afs_int32 partId,
- afs_int32 volumeId)
+ afs_uint32 volumeId)
{
#ifdef AFS_NT40_ENV
return EXDEV;
char pname[16], volname[20];
struct DiskPartition64 *partP;
afs_int32 ret = ENODEV;
- afs_int32 volid;
+ afs_uint32 volid;
if (!afsconf_SuperUser(tdir, acid, caller))
return VOLSERBAD_ACCESS; /*not a super user */
/*flags used for interfacing with the backup system */
struct volDescription { /*used for interfacing with the backup system */
char volName[VOLSER_MAXVOLNAME]; /* should be VNAMESIZE as defined in volume.h */
- afs_int32 volId;
+ afs_uint32 volId;
int volSize;
afs_int32 volFlags;
- afs_int32 volCloneId;
+ afs_uint32 volCloneId;
};
struct partList { /*used by the backup system */
extern struct rx_connection *UV_Bind(afs_int32 aserver, afs_int32 port);
extern void SubEnumerateEntry(struct nvldbentry *entry);
extern void EnumerateEntry(struct nvldbentry *entry);
-extern int UV_NukeVolume(afs_int32 server, afs_int32 partid, afs_int32 volid);
+extern int UV_NukeVolume(afs_int32 server, afs_int32 partid, afs_uint32 volid);
extern int UV_PartitionInfo64(afs_int32 server, char *pname,
struct diskPartition64 *partition);
extern int UV_CreateVolume(afs_int32 aserver, afs_int32 apart, char *aname,
- afs_int32 * anewid);
+ afs_uint32 * anewid);
extern int UV_CreateVolume2(afs_int32 aserver, afs_int32 apart, char *aname,
afs_int32 aquota, afs_int32 aspare1,
afs_int32 aspare2, afs_int32 aspare3,
- afs_int32 aspare4, afs_int32 * anewid);
+ afs_int32 aspare4, afs_uint32 * anewid);
extern int UV_AddVLDBEntry(afs_int32 aserver, afs_int32 apart, char *aname,
- afs_int32 aid);
+ afs_uint32 aid);
extern int UV_DeleteVolume(afs_int32 aserver, afs_int32 apart,
- afs_int32 avolid);
+ afs_uint32 avolid);
extern void sigint_handler(int x);
-extern int UV_MoveVolume(afs_int32 afromvol, afs_int32 afromserver,
+extern int UV_MoveVolume(afs_uint32 afromvol, afs_int32 afromserver,
afs_int32 afrompart, afs_int32 atoserver,
afs_int32 atopart);
-extern int UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver,
+extern int UV_MoveVolume2(afs_uint32 afromvol, afs_int32 afromserver,
afs_int32 afrompart, afs_int32 atoserver,
afs_int32 atopart, int flags);
extern int UV_BackupVolume(afs_int32 aserver, afs_int32 apart,
- afs_int32 avolid);
-extern int UV_ReleaseVolume(afs_int32 afromvol, afs_int32 afromserver,
+ afs_uint32 avolid);
+extern int UV_ReleaseVolume(afs_uint32 afromvol, afs_int32 afromserver,
afs_int32 afrompart, int forceflag);
extern void dump_sig_handler(int x);
-extern int UV_DumpVolume(afs_int32 afromvol, afs_int32 afromserver,
+extern int UV_DumpVolume(afs_uint32 afromvol, afs_int32 afromserver,
afs_int32 afrompart, afs_int32 fromdate,
afs_int32(*DumpFunction) (), char *rock, afs_int32 flags);
extern int UV_RestoreVolume(afs_int32 toserver, afs_int32 topart,
- afs_int32 tovolid, char tovolname[], int restoreflags,
+ afs_uint32 tovolid, char tovolname[], int restoreflags,
afs_int32(*WriteData) (), char *rock);
-extern int UV_RestoreVolume2(afs_int32 toserver, afs_int32 topart, afs_int32 tovolid,
+extern int UV_RestoreVolume2(afs_int32 toserver, afs_int32 topart, afs_uint32 tovolid,
afs_int32 toparentid, char tovolname[], int flags,
afs_int32(*WriteData) (), char *rock);
-extern int UV_LockRelease(afs_int32 volid);
-extern int UV_AddSite(afs_int32 server, afs_int32 part, afs_int32 volid, afs_int32 valid);
-extern int UV_RemoveSite(afs_int32 server, afs_int32 part, afs_int32 volid);
+extern int UV_LockRelease(afs_uint32 volid);
+extern int UV_AddSite(afs_int32 server, afs_int32 part, afs_uint32 volid, afs_int32 valid);
+extern int UV_RemoveSite(afs_int32 server, afs_int32 part, afs_uint32 volid);
extern int UV_ChangeLocation(afs_int32 server, afs_int32 part,
- afs_int32 volid);
+ afs_uint32 volid);
extern int UV_ListPartitions(afs_int32 aserver, struct partList *ptrPartList,
afs_int32 * cntp);
extern int UV_ZapVolumeClones(afs_int32 aserver, afs_int32 apart,
int a_all, struct volintXInfo **a_resultPP,
afs_int32 * a_numEntsInResultP);
extern int UV_ListOneVolume(afs_int32 aserver, afs_int32 apart,
- afs_int32 volid, struct volintInfo **resultPtr);
+ afs_uint32 volid, struct volintInfo **resultPtr);
extern int UV_XListOneVolume(afs_int32 a_serverID, afs_int32 a_partID,
- afs_int32 a_volID,
+ afs_uint32 a_volID,
struct volintXInfo **a_resultPP);
extern int sortVolumes(const void *a, const void *b);
extern int UV_SyncVolume(afs_int32 aserver, afs_int32 apart, char *avolname,
extern int UV_SyncVldb(afs_int32 aserver, afs_int32 apart, int flags,
int force);
extern afs_int32 VolumeExists(afs_int32 server, afs_int32 partition,
- afs_int32 volumeid);
+ afs_uint32 volumeid);
extern afs_int32 CheckVldbRWBK(struct nvldbentry *entry,
afs_int32 * modified);
extern int CheckVldbRO(struct nvldbentry *entry, afs_int32 * modified);
char newname[]);
extern int UV_VolserStatus(afs_int32 server, transDebugInfo ** rpntr,
afs_int32 * rcount);
-extern int UV_VolumeZap(afs_int32 server, afs_int32 part, afs_int32 volid);
+extern int UV_VolumeZap(afs_int32 server, afs_int32 part, afs_uint32 volid);
extern int UV_SetVolume(afs_int32 server, afs_int32 partition,
- afs_int32 volid, afs_int32 transflag,
+ afs_uint32 volid, afs_int32 transflag,
afs_int32 setflag, int sleeptime);
extern int UV_SetVolumeInfo(afs_int32 server, afs_int32 partition,
- afs_int32 volid, volintInfo * infop);
+ afs_uint32 volid, volintInfo * infop);
extern void MapNetworkToHost(struct nvldbentry *old, struct nvldbentry *new);
extern void MapHostToNetwork(struct nvldbentry *entry);
-extern int UV_CopyVolume2(afs_int32 afromvol, afs_int32 afromserver,
+extern int UV_CopyVolume2(afs_uint32 afromvol, afs_int32 afromserver,
afs_int32 afrompart, char *atovolname,
afs_int32 atoserver, afs_int32 atopart,
- afs_int32 atovolid, int flags);
-extern int UV_CloneVolume(afs_int32 aserver, afs_int32 apart, afs_int32 avolid,
- afs_int32 acloneid, char *aname, int flags);
-extern int UV_DumpClonedVolume(afs_int32 afromvol, afs_int32 afromserver,
+ afs_uint32 atovolid, int flags);
+extern int UV_CloneVolume(afs_int32 aserver, afs_int32 apart, afs_uint32 avolid,
+ afs_uint32 acloneid, char *aname, int flags);
+extern int UV_DumpClonedVolume(afs_uint32 afromvol, afs_int32 afromserver,
afs_int32 afrompart, afs_int32 fromdate,
afs_int32(*DumpFunction) (), char *rock,
afs_int32 flags);
-extern int UV_GetSize(afs_int32 afromvol, afs_int32 afromserver,
+extern int UV_GetSize(afs_uint32 afromvol, afs_int32 afromserver,
afs_int32 afrompart, afs_int32 fromdate,
struct volintSize *vol_size);
/* Local Prototypes */
int PrintDiagnostics(char *astring, afs_int32 acode);
-int GetVolumeInfo(afs_int32 volid, afs_int32 *server, afs_int32 *part,
+int GetVolumeInfo(afs_uint32 volid, afs_int32 *server, afs_int32 *part,
afs_int32 *voltype, struct nvldbentry *rentry);
struct tqElem {
- afs_int32 volid;
+ afs_uint32 volid;
struct tqElem *next;
};
static void
-qPut(struct tqHead *ahead, afs_int32 volid)
+qPut(struct tqHead *ahead, afs_uint32 volid)
{
struct tqElem *elem;
int quiet;
{
int totalOK, totalNotOK, totalBusy, i;
- afs_int32 volid = 0;
+ afs_uint32 volid = 0;
totalOK = 0;
totalNotOK = 0;
int totalNotOK; /*Total screwed volumes */
int totalBusy; /*Total busy volumes */
int i; /*Loop variable */
- afs_int32 volid = 0; /*Current volume ID */
+ afs_uint32 volid = 0; /*Current volume ID */
/*
* Initialize counters and (global!!) queues.
int totalNotOK; /*Total screwed volumes */
int totalBusy; /*Total busy volumes */
int i; /*Loop variable */
- afs_int32 volid = 0; /*Current volume ID */
+ afs_uint32 volid = 0; /*Current volume ID */
/*
* Initialize counters and (global!!) queues.
NukeVolume(register struct cmd_syndesc *as)
{
register afs_int32 code;
- afs_int32 volID, err;
+ afs_uint32 volID;
+ afs_int32 err;
afs_int32 partID;
afs_int32 server;
register char *tp;
afs_int32 vcode = 0;
volintInfo *pntr = (volintInfo *) 0;
volintXInfo *xInfoP = (volintXInfo *) 0;
- afs_int32 volid;
+ afs_uint32 volid;
afs_int32 code, err, error = 0;
int voltype, foundserv = 0, foundentry = 0;
afs_int32 aserver, apart;
struct nvldbentry entry;
afs_int32 vcode = 0;
volintInfo info;
- afs_int32 volid;
+ afs_uint32 volid;
afs_int32 code, err;
afs_int32 aserver, apart;
int previdx = -1;
static int
volOnline(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 server, partition, volid;
+ afs_int32 server, partition;
+ afs_uint32 volid;
afs_int32 code, err = 0;
server = GetServer(as->parms[0].items->data);
static int
volOffline(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 server, partition, volid;
+ afs_int32 server, partition;
+ afs_uint32 volid;
afs_int32 code, err = 0;
afs_int32 transflag, sleeptime, transdone;
{
afs_int32 pnum;
char part[10];
- afs_int32 volid, code;
+ afs_uint32 volid;
+ afs_int32 code;
struct nvldbentry entry;
afs_int32 vcode;
afs_int32 quota;
struct nvldbentry *entry;
{
int i;
- afs_int32 error, code, curserver, curpart, volid;
+ afs_int32 error, code, curserver, curpart;
+ afs_uint32 volid;
MapHostToNetwork(entry);
error = 0;
DeleteVolume(struct cmd_syndesc *as, void *arock)
{
afs_int32 err, code = 0;
- afs_int32 server = 0, partition = -1, volid;
+ afs_int32 server = 0, partition = -1;
+ afs_uint32 volid;
char pname[10];
afs_int32 idx, j;
MoveVolume(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 volid, fromserver, toserver, frompart, topart;
+ afs_uint32 volid;
+ afs_int32 fromserver, toserver, frompart, topart;
afs_int32 flags, code, err;
char fromPartName[10], toPartName[10];
static int
CopyVolume(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 volid, fromserver, toserver, frompart, topart, code, err, flags;
+ afs_uint32 volid;
+ afs_int32 fromserver, toserver, frompart, topart, code, err, flags;
char fromPartName[10], toPartName[10], *tovolume;
struct nvldbentry entry;
struct diskPartition64 partition; /* for space check */
static int
ShadowVolume(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 volid, fromserver, toserver, frompart, topart, tovolid;
+ afs_uint32 volid, tovolid;
+ afs_int32 fromserver, toserver, frompart, topart;
afs_int32 code, err, flags;
char fromPartName[10], toPartName[10], toVolName[32], *tovolume;
struct diskPartition64 partition; /* for space check */
static int
CloneVolume(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 server, part, volid, cloneid, voltype;
+ afs_uint32 volid, cloneid;
+ afs_int32 server, part, voltype;
char partName[10], *volname;
afs_int32 code, err, flags;
struct nvldbentry entry;
static int
BackupVolume(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 avolid, aserver, apart, vtype, code, err;
+ afs_uint32 avolid;
+ afs_int32 aserver, apart, vtype, code, err;
struct nvldbentry entry;
- afs_int32 buvolid, buserver, bupart, butype;
+ afs_uint32 buvolid;
+ afs_int32 buserver, bupart, butype;
struct nvldbentry buentry;
avolid = vsu_GetVolumeID(as->parms[0].items->data, cstruct, &err);
{
struct nvldbentry entry;
- afs_int32 avolid, aserver, apart, vtype, code, err;
+ afs_uint32 avolid;
+ afs_int32 aserver, apart, vtype, code, err;
int force = 0;
if (as->parms[1].items)
static
DumpVolume(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 avolid, aserver, apart, voltype, fromdate = 0, code, err, i, flags;
+ afs_uint32 avolid;
+ afs_int32 aserver, apart, voltype, fromdate = 0, code, err, i, flags;
char filename[MAXPATHLEN];
struct nvldbentry entry;
static int
RestoreVolume(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 avolid, aparentid, aserver, apart, code, vcode, err;
+ afs_uint32 avolid, aparentid;
+ afs_int32 aserver, apart, code, vcode, err;
afs_int32 aoverwrite = ASK;
afs_int32 acreation = 0, alastupdate = 0;
int restoreflags = 0;
static int
LockReleaseCmd(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 avolid, code, err;
+ afs_uint32 avolid;
+ afs_int32 code, err;
avolid = vsu_GetVolumeID(as->parms[0].items->data, cstruct, &err);
if (avolid == 0) {
static int
AddSite(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 avolid, aserver, apart, code, err, valid = 0;
+ afs_uint32 avolid;
+ afs_int32 aserver, apart, code, err, valid = 0;
char apartName[10], avolname[VOLSER_MAXVOLNAME + 1];
vsu_ExtractName(avolname, as->parms[2].items->data);;
RemoveSite(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 avolid, aserver, apart, code, err;
+ afs_uint32 avolid;
+ afs_int32 aserver, apart, code, err;
char apartName[10], avolname[VOLSER_MAXVOLNAME + 1];
vsu_ExtractName(avolname, as->parms[2].items->data);
static int
ChangeLocation(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 avolid, aserver, apart, code, err;
+ afs_uint32 avolid;
+ afs_int32 aserver, apart, code, err;
char apartName[10];
avolid = vsu_GetVolumeID(as->parms[2].items->data, cstruct, &err);
VolumeZap(register struct cmd_syndesc *as, void *arock)
{
struct nvldbentry entry;
- afs_int32 volid, code, server, part, zapbackupid = 0, backupid = 0, err;
+ afs_uint32 volid, zapbackupid = 0, backupid = 0;
+ afs_int32 code, server, part, err;
if (as->parms[3].items) {
/* force flag is on, use the other version */
}
int
-GetVolumeInfo(afs_int32 volid, afs_int32 *server, afs_int32 *part, afs_int32 *voltype,
+GetVolumeInfo(afs_uint32 volid, afs_int32 *server, afs_int32 *part, afs_int32 *voltype,
struct nvldbentry *rentry)
{
afs_int32 vcode;
DeleteEntry(register struct cmd_syndesc *as, void *arock)
{
afs_int32 apart = 0;
- afs_int32 avolid;
+ afs_uint32 avolid;
afs_int32 vcode;
struct VldbListByAttributes attributes;
nbulkentries arrayEntries;
static int
BackSys(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 apart = 0, avolid;
+ afs_uint32 avolid;
+ afs_int32 apart = 0;
afs_int32 aserver = 0, code, aserver1, apart1;
afs_int32 vcode;
struct VldbListByAttributes attributes;
register struct nvldbentry *vllist;
afs_int32 nentries;
int j;
- afs_int32 volid;
+ afs_uint32 volid;
afs_int32 totalE;
char pname[10];
static int
LockEntry(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 avolid, vcode, err;
+ afs_uint32 avolid;
+ afs_int32 vcode, err;
avolid = vsu_GetVolumeID(as->parms[0].items->data, cstruct, &err);
if (avolid == 0) {
ConvertRO(register struct cmd_syndesc *as, void *arock)
{
afs_int32 partition = -1;
- afs_int32 server, volid, code, i, same;
+ afs_uint32 volid;
+ afs_int32 server, code, i, same;
struct nvldbentry entry, storeEntry;
afs_int32 vcode;
afs_int32 rwindex = 0;
static int
Sizes(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 avolid, aserver, apart, voltype, fromdate = 0, code, err, i;
+ afs_uint32 avolid;
+ afs_int32 aserver, apart, voltype, fromdate = 0, code, err, i;
struct nvldbentry entry;
volintSize vol_size;
int verbose = 0, noresolve = 0;
struct release {
- afs_int32 crtime;
- afs_int32 uptime;
+ afs_uint32 crtime;
+ afs_uint32 uptime;
afs_int32 vldbEntryIndex;
};
/* Protos for static routines */
static afs_int32 CheckAndDeleteVolume(struct rx_connection *aconn,
- afs_int32 apart, afs_int32 okvol,
- afs_int32 delvol);
-static int DelVol(struct rx_connection *conn, afs_int32 vid, afs_int32 part,
+ afs_int32 apart, afs_uint32 okvol,
+ afs_uint32 delvol);
+static int DelVol(struct rx_connection *conn, afs_uint32 vid, afs_int32 part,
afs_int32 flags);
static int GetTrans(struct nvldbentry *vldbEntryPtr, afs_int32 index,
struct rx_connection **connPtr, afs_int32 * transPtr,
* 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_int32 server, afs_int32 partid, afs_int32 volid)
+UV_NukeVolume(afs_int32 server, afs_int32 partid, afs_uint32 volid)
{
register struct rx_connection *tconn;
register afs_int32 code;
/* old interface to create volume */
int
UV_CreateVolume(afs_int32 aserver, afs_int32 apart, char *aname,
- afs_int32 * anewid)
+ afs_uint32 * anewid)
{
afs_int32 code;
code = UV_CreateVolume2(aserver, apart, aname, 5000, 0, 0, 0, 0, anewid);
int
UV_CreateVolume2(afs_int32 aserver, afs_int32 apart, char *aname,
afs_int32 aquota, afs_int32 aspare1, afs_int32 aspare2,
- afs_int32 aspare3, afs_int32 aspare4, afs_int32 * anewid)
+ afs_int32 aspare3, afs_int32 aspare4, afs_uint32 * anewid)
{
register struct rx_connection *aconn;
* back new vol id in <anewid>*/
int
UV_AddVLDBEntry(afs_int32 aserver, afs_int32 apart, char *aname,
- afs_int32 aid)
+ afs_uint32 aid)
{
register struct rx_connection *aconn;
afs_int32 error;
* becomes zero
*/
int
-UV_DeleteVolume(afs_int32 aserver, afs_int32 apart, afs_int32 avolid)
+UV_DeleteVolume(afs_int32 aserver, afs_int32 apart, afs_uint32 avolid)
{
struct rx_connection *aconn = (struct rx_connection *)0;
afs_int32 ttid = 0;
*/
int
-UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
+UV_MoveVolume2(afs_uint32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
afs_int32 atoserver, afs_int32 atopart, int flags)
{
struct rx_connection *toconn, *fromconn;
afs_int32 fromDate;
struct restoreCookie cookie;
register afs_int32 vcode, code;
- afs_int32 newVol, volid, backupId;
+ afs_uint32 newVol, volid, backupId;
struct volser_status tstatus;
struct destServer destination;
int
-UV_MoveVolume(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
+UV_MoveVolume(afs_uint32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
afs_int32 atoserver, afs_int32 atopart)
{
return UV_MoveVolume2(afromvol, afromserver, afrompart,
* RV_NOCLONE - don't use a copy clone
*/
int
-UV_CopyVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
+UV_CopyVolume2(afs_uint32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
char *atovolname, afs_int32 atoserver, afs_int32 atopart,
- afs_int32 atovolid, int flags)
+ afs_uint32 atovolid, int flags)
{
struct rx_connection *toconn, *fromconn;
afs_int32 fromtid, totid, clonetid;
afs_int32 fromDate, cloneFromDate;
struct restoreCookie cookie;
register afs_int32 vcode, code;
- afs_int32 cloneVol, newVol, volflag;
+ afs_uint32 cloneVol, newVol;
+ afs_int32 volflag;
struct volser_status tstatus;
struct destServer destination;
int
-UV_CopyVolume(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
+UV_CopyVolume(afs_uint32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
char *atovolname, afs_int32 atoserver, afs_int32 atopart)
{
return UV_CopyVolume2(afromvol, afromserver, afrompart,
*/
int
-UV_BackupVolume(afs_int32 aserver, afs_int32 apart, afs_int32 avolid)
+UV_BackupVolume(afs_int32 aserver, afs_int32 apart, afs_uint32 avolid)
{
struct rx_connection *aconn = (struct rx_connection *)0;
afs_int32 ttid = 0, btid = 0;
- afs_int32 backupID;
+ afs_uint32 backupID;
afs_int32 code = 0, rcode = 0;
char vname[VOLSER_MAXVOLNAME + 1];
struct nvldbentry entry, storeEntry;
*/
int
-UV_CloneVolume(afs_int32 aserver, afs_int32 apart, afs_int32 avolid,
- afs_int32 acloneid, char *aname, int flags)
+UV_CloneVolume(afs_int32 aserver, afs_int32 apart, afs_uint32 avolid,
+ afs_uint32 acloneid, char *aname, int flags)
{
struct rx_connection *aconn = (struct rx_connection *)0;
afs_int32 ttid = 0, btid = 0;
}
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;
struct rx_connection **connPtr, afs_int32 * transPtr,
afs_int32 * crtimePtr, afs_int32 * uptimePtr)
{
- afs_int32 volid;
+ afs_uint32 volid;
struct volser_status tstatus;
int code = 0;
int rcode, tcode;
afs_int32 fromdate, manyDests * tr, afs_int32 flags,
void *cookie, manyResults * results)
{
- int i;
+ unsigned int i;
for (i = 0; i < tr->manyDests_len; i++) {
results->manyResults_val[i] =
*/
int
-UV_ReleaseVolume(afs_int32 afromvol, afs_int32 afromserver,
+UV_ReleaseVolume(afs_uint32 afromvol, afs_int32 afromserver,
afs_int32 afrompart, int forceflag)
{
char vname[64];
afs_int32 code = 0;
afs_int32 vcode, rcode, tcode;
- afs_int32 cloneVolId, roVolId;
+ afs_uint32 cloneVolId, roVolId;
struct replica *replicas = 0;
struct nvldbentry entry, storeEntry;
int i, volcount, m, fullrelease, vldbindex;
manyDests tr;
manyResults results;
int rwindex, roindex, roclone, roexists;
- afs_int32 rwcrdate = 0;
- afs_int32 rwupdate, clcrdate;
+ afs_uint32 rwcrdate = 0;
+ afs_uint32 rwupdate, clcrdate;
struct rtime {
int validtime;
afs_uint32 uptime;
* extracting parameters from the rock
*/
int
-UV_DumpVolume(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
+UV_DumpVolume(afs_uint32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
afs_int32 fromdate, afs_int32(*DumpFunction) (), char *rock,
afs_int32 flags)
{
* extracting parameters from the rock
*/
int
-UV_DumpClonedVolume(afs_int32 afromvol, afs_int32 afromserver,
+UV_DumpClonedVolume(afs_uint32 afromvol, afs_int32 afromserver,
afs_int32 afrompart, afs_int32 fromdate,
afs_int32(*DumpFunction) (), char *rock, afs_int32 flags)
{
afs_int32 fromtid = 0, rxError = 0, rcode = 0;
afs_int32 clonetid = 0;
afs_int32 code = 0, vcode = 0, error = 0;
- afs_int32 clonevol = 0;
+ afs_uint32 clonevol = 0;
char vname[64];
time_t tmv = fromdate;
* after extracting params from the rock
*/
int
-UV_RestoreVolume2(afs_int32 toserver, afs_int32 topart, afs_int32 tovolid,
+UV_RestoreVolume2(afs_int32 toserver, afs_int32 topart, afs_uint32 tovolid,
afs_int32 toparentid, char tovolname[], int flags,
afs_int32(*WriteData) (), char *rock)
{
struct volintInfo vinfo;
char partName[10];
char tovolreal[VOLSER_OLDMAXVOLNAME];
- afs_int32 pvolid, pparentid;
- afs_int32 temptid;
+ afs_uint32 pvolid;
+ afs_int32 temptid, pparentid;
int success;
struct nvldbentry entry, storeEntry;
afs_int32 error;
}
int
-UV_RestoreVolume(afs_int32 toserver, afs_int32 topart, afs_int32 tovolid,
+UV_RestoreVolume(afs_int32 toserver, afs_int32 topart, afs_uint32 tovolid,
char tovolname[], int flags, afs_int32(*WriteData) (),
char *rock)
{
/*unlocks the vldb entry associated with <volid> */
int
-UV_LockRelease(afs_int32 volid)
+UV_LockRelease(afs_uint32 volid)
{
-
-
afs_int32 vcode;
VPRINT("Binding to the VLDB server\n");
/*adds <server> and <part> as a readonly replication site for <volid>
*in vldb */
int
-UV_AddSite(afs_int32 server, afs_int32 part, afs_int32 volid, afs_int32 valid)
+UV_AddSite(afs_int32 server, afs_int32 part, afs_uint32 volid, afs_int32 valid)
{
int j, nro = 0, islocked = 0;
struct nvldbentry entry, storeEntry;
/*removes <server> <part> as read only site for <volid> from the vldb */
int
-UV_RemoveSite(afs_int32 server, afs_int32 part, afs_int32 volid)
+UV_RemoveSite(afs_int32 server, afs_int32 part, afs_uint32 volid)
{
afs_int32 vcode;
struct nvldbentry entry, storeEntry;
/*sets <server> <part> as read/write site for <volid> in the vldb */
int
-UV_ChangeLocation(afs_int32 server, afs_int32 part, afs_int32 volid)
+UV_ChangeLocation(afs_int32 server, afs_int32 part, afs_uint32 volid)
{
afs_int32 vcode;
struct nvldbentry entry, storeEntry;
afs_int32 rcode = 0;
afs_int32 tid;
int reuseCloneId = 0;
- afs_int32 curCloneId = 0;
+ afs_uint32 curCloneId = 0;
char cloneName[256]; /*max vol name */
aconn = (struct rx_connection *)0;
/* get all the information about volume <volid> on <aserver> and <apart> */
int
-UV_ListOneVolume(afs_int32 aserver, afs_int32 apart, afs_int32 volid,
+UV_ListOneVolume(afs_int32 aserver, afs_int32 apart, afs_uint32 volid,
struct volintInfo **resultPtr)
{
struct rx_connection *aconn;
*------------------------------------------------------------------------*/
int
-UV_XListOneVolume(afs_int32 a_serverID, afs_int32 a_partID, afs_int32 a_volID,
+UV_XListOneVolume(afs_int32 a_serverID, afs_int32 a_partID, afs_uint32 a_volID,
struct volintXInfo **a_resultPP)
{
struct rx_connection *rxConnP; /*Rx connection to Volume Server */
struct nvldbentry entry, storeEntry;
char pname[10];
int pass = 0, islocked = 0, createentry, addvolume, modified, mod, doit = 1;
- afs_int32 rwvolid;
+ afs_uint32 rwvolid;
char hoststr[16];
if (modentry) {
{
volintInfo *v1 = (volintInfo *) a;
volintInfo *v2 = (volintInfo *) b;
- afs_int32 rwvolid1, rwvolid2;
+ afs_uint32 rwvolid1, rwvolid2;
rwvolid1 = ((v1->type == RWVOL) ? v1->volid : v1->parentID);
rwvolid2 = ((v2->type == RWVOL) ? v2->volid : v2->parentID);
afs_int32 tverbose;
afs_int32 mod, modified = 0;
struct nvldbentry vldbentry;
- afs_int32 volumeid = 0;
+ afs_uint32 volumeid = 0;
volEntries volumeInfo;
struct partList PartList;
afs_int32 pcnt, rv;
- afs_int32 maxvolid = 0;
+ afs_uint32 maxvolid = 0;
volumeInfo.volEntries_val = (volintInfo *) 0;
volumeInfo.volEntries_len = 0;
error_exit:
/* Now check if the maxvolid is larger than that stored in the VLDB */
if (maxvolid) {
- afs_int32 maxvldbid = 0;
+ afs_uint32 maxvldbid = 0;
code = ubik_VL_GetNewVolumeId(cstruct, 0, 0, &maxvldbid);
if (code) {
fprintf(STDERR,
if (!error)
error = code;
} else if (maxvolid > maxvldbid) {
- afs_int32 id, nid;
+ afs_uint32 id, nid;
id = maxvolid - maxvldbid + 1;
code = ubik_VL_GetNewVolumeId(cstruct, 0, id, &nid);
if (code) {
{
struct rx_connection *aconn;
afs_int32 code, error = 0;
- int i, j, pfail;
+ int i, pfail;
+ unsigned int j;
volEntries volumeInfo;
struct partList PartList;
afs_int32 pcnt;
error_exit:
/* Now check if the maxvolid is larger than that stored in the VLDB */
if (maxvolid) {
- afs_int32 maxvldbid = 0;
+ afs_uint32 maxvldbid = 0;
code = ubik_VL_GetNewVolumeId(cstruct, 0, 0, &maxvldbid);
if (code) {
fprintf(STDERR,
if (!error)
error = code;
} else if (maxvolid > maxvldbid) {
- afs_int32 id, nid;
+ afs_uint32 id, nid;
id = maxvolid - maxvldbid + 1;
code = ubik_VL_GetNewVolumeId(cstruct, 0, id, &nid);
if (code) {
* still exists - so we catch these error codes.
*/
afs_int32
-VolumeExists(afs_int32 server, afs_int32 partition, afs_int32 volumeid)
+VolumeExists(afs_int32 server, afs_int32 partition, afs_uint32 volumeid)
{
struct rx_connection *conn = (struct rx_connection *)0;
afs_int32 code = -1;
/*delete the volume without interacting with the vldb */
int
-UV_VolumeZap(afs_int32 server, afs_int32 part, afs_int32 volid)
+UV_VolumeZap(afs_int32 server, afs_int32 part, afs_uint32 volid)
{
afs_int32 rcode, ttid, error, code;
struct rx_connection *aconn;
}
int
-UV_SetVolume(afs_int32 server, afs_int32 partition, afs_int32 volid,
+UV_SetVolume(afs_int32 server, afs_int32 partition, afs_uint32 volid,
afs_int32 transflag, afs_int32 setflag, int sleeptime)
{
struct rx_connection *conn = 0;
}
int
-UV_SetVolumeInfo(afs_int32 server, afs_int32 partition, afs_int32 volid,
+UV_SetVolumeInfo(afs_int32 server, afs_int32 partition, afs_uint32 volid,
volintInfo * infop)
{
struct rx_connection *conn = 0;
}
int
-UV_GetSize(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
+UV_GetSize(afs_uint32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
afs_int32 fromdate, struct volintSize *vol_size)
{
struct rx_connection *aconn = (struct rx_connection *)0;
}
int
-VLDB_GetEntryByID(afs_int32 volid, afs_int32 voltype, struct nvldbentry *entryp)
+VLDB_GetEntryByID(afs_uint32 volid, afs_int32 voltype, struct nvldbentry *entryp)
{
struct vldbentry oentry;
register int code;
}
int
-VLDB_ReplaceEntry(afs_int32 volid, afs_int32 voltype, struct nvldbentry *entryp, afs_int32 releasetype)
+VLDB_ReplaceEntry(afs_uint32 volid, afs_int32 voltype, struct nvldbentry *entryp, afs_int32 releasetype)
{
struct vldbentry oentry;
register int code;
#ifndef _VSUTILS_PROTOTYPES_H
#define _VSUTILS_PROTOTYPES_H
/* vsutils.c */
+
extern int VLDB_CreateEntry(struct nvldbentry *entryp);
-extern int VLDB_GetEntryByID(afs_int32 volid, afs_int32 voltype, struct nvldbentry *entryp);
+extern int VLDB_GetEntryByID(afs_uint32 volid, afs_int32 voltype, struct nvldbentry *entryp);
extern int VLDB_GetEntryByName(char *namep, struct nvldbentry *entryp);
-extern int VLDB_ReplaceEntry(afs_int32 volid, afs_int32 voltype, struct nvldbentry *entryp, afs_int32 releasetype);
+extern int VLDB_ReplaceEntry(afs_uint32 volid, afs_int32 voltype, struct nvldbentry *entryp, afs_int32 releasetype);
extern int VLDB_ListAttributes(VldbListByAttributes *attrp, afs_int32 *entriesp, nbulkentries *blkentriesp);
extern int VLDB_ListAttributesN2(VldbListByAttributes *attrp, char *name, afs_int32 thisindex,
afs_int32 *nentriesp, nbulkentries *blkentriesp, afs_int32 *nextindexp);