volid-unsigned-int32-20090323
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 23 Mar 2009 18:18:44 +0000 (18:18 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 23 Mar 2009 18:18:44 +0000 (18:18 +0000)
LICENSE IPL10
FIXES 124510

assume volume ids are always unsigned 32 bit values

32 files changed:
src/config/stds.h
src/libadmin/vos/afs_vosAdmin.c
src/libadmin/vos/vosutils.c
src/libadmin/vos/vosutils.h
src/libadmin/vos/vsprocs.c
src/libadmin/vos/vsprocs.h
src/vlserver/cnvldb.h
src/vlserver/vlclient.c
src/vlserver/vldb_check.c
src/vlserver/vldbint.xg
src/vlserver/vlprocs.c
src/vlserver/vlserver.p.h
src/vlserver/vlutils.c
src/vol/ihandle.h
src/vol/listinodes.c
src/vol/namei_ops.c
src/vol/namei_ops.h
src/vol/ntops.c
src/vol/ntops.h
src/vol/vol-info.c
src/vol/vol-salvage.c
src/vol/volume.c
src/vol/vutil.c
src/volser/vol-dump.c
src/volser/volint.xg
src/volser/volprocs.c
src/volser/volser.p.h
src/volser/volser_prototypes.h
src/volser/vos.c
src/volser/vsprocs.c
src/volser/vsutils.c
src/volser/vsutils_prototypes.h

index 3d5dfa6..bdee573 100644 (file)
@@ -308,11 +308,11 @@ typedef struct afsUUID afsUUID;
 #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 */
index 492c461..135b7b1 100644 (file)
@@ -41,6 +41,16 @@ RCSID
 #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;
index 878920d..e9593b4 100644 (file)
@@ -127,7 +127,7 @@ VLDB_CreateEntry(afs_cell_handle_p cellHandle, struct nvldbentry *entryp,
 }
 
 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)
 {
@@ -202,7 +202,7 @@ aVLDB_GetEntryByName(afs_cell_handle_p cellHandle, const char *namep,
 }
 
 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)
 {
@@ -398,7 +398,7 @@ VLDB_IsSameAddrs(afs_cell_handle_p cellHandle, afs_int32 serv1,
  */
 
 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)
 {
index d886e12..a6d14f4 100644 (file)
@@ -15,7 +15,7 @@
 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);
 
@@ -24,7 +24,7 @@ extern int aVLDB_GetEntryByName(afs_cell_handle_p cellHandle,
                               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);
 
index 490ae8e..7818f87 100644 (file)
@@ -60,7 +60,7 @@ UV_Bind(afs_cell_handle_p cellHandle, afs_int32 aserver, afs_int32 port)
  * 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;
 
@@ -108,7 +108,7 @@ CheckAndDeleteVolume(struct rx_connection *aconn, afs_int32 apart,
 /* 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;
@@ -130,7 +130,7 @@ UV_NukeVolume(afs_cell_handle_p cellHandle, struct rx_connection *server,
 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;
@@ -206,7 +206,7 @@ UV_CreateVolume(afs_cell_handle_p cellHandle, struct rx_connection *server,
  */
 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;
@@ -379,7 +379,7 @@ UV_DeleteVolume(afs_cell_handle_p cellHandle, struct rx_connection *server,
  */
 
 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)
 {
@@ -394,7 +394,7 @@ UV_MoveVolume(afs_cell_handle_p cellHandle, afs_int32 afromvol,
     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;
 
@@ -983,7 +983,7 @@ UV_MoveVolume(afs_cell_handle_p cellHandle, afs_int32 afromvol,
 
 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;
@@ -1176,7 +1176,7 @@ UV_BackupVolume(afs_cell_handle_p cellHandle, afs_int32 aserver,
 }
 
 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;
@@ -1199,7 +1199,7 @@ DelVol(struct rx_connection *conn, afs_int32 vid, afs_int32 part,
 #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;
@@ -1310,7 +1310,7 @@ GetTrans(afs_cell_handle_p cellHandle, struct nvldbentry *vldbEntryPtr,
 {
     int rc = 0;
     afs_status_t tst = 0, etst = 0;
-    afs_int32 volid;
+    afs_uint32 volid;
     struct volser_status tstatus;
     int rcode;
 
@@ -1450,7 +1450,7 @@ VolumeExists(afs_cell_handle_p cellHandle, afs_int32 server,
  * 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)
 {
@@ -1459,7 +1459,7 @@ UV_ReleaseVolume(afs_cell_handle_p cellHandle, afs_int32 afromvol,
 
     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;
@@ -2086,7 +2086,7 @@ DumpFunction(struct rx_call *call, const char *filename)
 * 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)
 {
@@ -2285,7 +2285,7 @@ WriteData(struct rx_call *call, const char *filename)
  */
 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;
@@ -2297,7 +2297,7 @@ UV_RestoreVolume(afs_cell_handle_p cellHandle, afs_int32 toserver,
     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;
@@ -2592,7 +2592,7 @@ UV_RestoreVolume(afs_cell_handle_p cellHandle, afs_int32 toserver,
 *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;
@@ -2672,7 +2672,7 @@ UV_AddSite(afs_cell_handle_p cellHandle, afs_int32 server, afs_int32 part,
 /*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;
@@ -2895,7 +2895,7 @@ UV_XListVolumes(struct rx_connection *server, afs_int32 a_partID, int a_all,
 
 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;
@@ -2956,10 +2956,10 @@ UV_XListOneVolume(struct rx_connection *server, afs_int32 a_partID,
  *------------------------------------------------------------------------*/
 
 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 */
 
@@ -2998,8 +2998,10 @@ ProcessEntries(afs_cell_handle_p cellHandle, struct qHead *myQueue,
               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;
@@ -3036,11 +3038,8 @@ ProcessEntries(afs_cell_handle_p cellHandle, struct qHead *myQueue,
                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;
@@ -3048,7 +3047,6 @@ ProcessEntries(afs_cell_handle_p cellHandle, struct qHead *myQueue,
                ubik_VL_GetNewVolumeId(cellHandle->vos, 0, temp2,
                          &maxVolid);
            maxVolid += temp2;
-
        }
        if (maxVolid <= elem.ids[BACKVOL]) {
            temp1 = maxVolid;
@@ -3058,7 +3056,6 @@ ProcessEntries(afs_cell_handle_p cellHandle, struct qHead *myQueue,
                ubik_VL_GetNewVolumeId(cellHandle->vos, 0, temp2,
                          &maxVolid);
            maxVolid += temp2;
-
        }
        aVLDB_GetEntryByID(cellHandle, elem.ids[RWVOL], RWVOL, &entry, &tst);
        if (tst && (tst != VL_NOENT)) {
@@ -4064,7 +4061,7 @@ UV_VolserStatus(struct rx_connection *server, transDebugInfo ** rpntr,
 /*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;
@@ -4102,7 +4099,7 @@ UV_VolumeZap(afs_cell_handle_p cellHandle, struct rx_connection *server,
 
 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;
index ab30e9e..5fd04f9 100644 (file)
@@ -50,47 +50,47 @@ extern int ubik_Call_New();
 
 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,
@@ -101,13 +101,13 @@ extern int UV_XListVolumes(struct rx_connection *server, afs_int32 a_partID,
                           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,
@@ -127,11 +127,11 @@ extern int UV_VolserStatus(struct rx_connection *server,
 
 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);
 
index 21ff909..02541e3 100644 (file)
@@ -28,11 +28,11 @@ struct vlheader_1 {
     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;
@@ -58,11 +58,11 @@ struct vlheader_2 {
 };
 
 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;
@@ -88,11 +88,11 @@ struct vlheader_3 {
 
 
 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];
index 447deb5..cafe404 100644 (file)
@@ -1077,12 +1077,12 @@ fill_entry(entry, argp, nargs)
     }
     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
@@ -1105,15 +1105,15 @@ fill_update_entry(entry, argp, nargs)
     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;
index 8f095ea..ca39352 100644 (file)
@@ -222,7 +222,7 @@ NameHash(char *volname)
 }
 
 afs_int32
-IdHash(afs_int32 volid)
+IdHash(afs_uint32 volid)
 {
     return ((abs(volid)) % HASHSIZE);
 }
index 9b3420d..54530d7 100644 (file)
@@ -35,7 +35,7 @@ struct VldbUpdateEntry {
        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];
@@ -76,7 +76,7 @@ struct VldbListByAttributes {
        afs_int32       server;
        afs_int32       partition;
        afs_int32       spares3;
-       afs_int32       volumeid;
+       afs_uint32      volumeid;
        afs_int32       flag;
 };
 
@@ -96,7 +96,7 @@ struct vldbentry   {
        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 */
 };
 
@@ -107,7 +107,7 @@ struct nvldbentry   {
        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;
@@ -140,7 +140,7 @@ struct uvldbentry   {
        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;
@@ -162,7 +162,7 @@ struct vital_vlheader {
     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 */
 };
 
@@ -287,43 +287,43 @@ CreateEntry(
 ) = 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;
@@ -361,8 +361,8 @@ GetAddrs(
 ) = VLGETADDRS;
 
 ChangeAddr(
-  IN afs_int32 ip1,
-  afs_int32 ip2
+  IN afs_uint32 ip1,
+  afs_uint32 ip2
 ) = VLCHANGEADDR;
 
 
@@ -371,13 +371,13 @@ CreateEntryN(
 ) = 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
index 4bf14f5..57df004 100644 (file)
@@ -310,7 +310,7 @@ SVL_CreateEntryN(rxcall, newentry)
 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;
@@ -324,7 +324,7 @@ SVL_ChangeAddr(rxcall, ip1, ip2)
     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 {
@@ -346,7 +346,7 @@ SVL_ChangeAddr(rxcall, ip1, ip2)
 afs_int32
 SVL_DeleteEntry(rxcall, volid, voltype)
      struct rx_call *rxcall;
-     afs_int32 volid;
+     afs_uint32 volid;
      afs_int32 voltype;
 {
     struct ubik_trans *trans;
@@ -363,7 +363,7 @@ SVL_DeleteEntry(rxcall, volid, voltype)
     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)
@@ -394,7 +394,7 @@ SVL_DeleteEntry(rxcall, volid, voltype)
 /* 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 */
 {
@@ -407,7 +407,7 @@ GetEntryByID(rxcall, volid, voltype, aentry, new, this_op)
     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)
@@ -434,7 +434,8 @@ GetEntryByID(rxcall, volid, voltype, aentry, new, this_op)
 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);
@@ -444,7 +445,8 @@ SVL_GetEntryByID(rxcall, volid, voltype, aentry)
 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);
@@ -454,7 +456,8 @@ SVL_GetEntryByIDN(rxcall, volid, voltype, aentry)
 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);
@@ -556,10 +559,11 @@ SVL_GetEntryByNameU(rxcall, volname, aentry)
 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);
@@ -574,7 +578,7 @@ SVL_GetNewVolumeId(rxcall, Maxvolidbump, newvolumeid)
 
     *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);
@@ -599,7 +603,7 @@ SVL_GetNewVolumeId(rxcall, Maxvolidbump, newvolumeid)
 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;
@@ -628,7 +632,7 @@ SVL_ReplaceEntry(rxcall, volid, voltype, newentry, 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 */
@@ -703,7 +707,7 @@ SVL_ReplaceEntry(rxcall, volid, voltype, newentry, releasetype)
 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;
@@ -732,7 +736,7 @@ SVL_ReplaceEntryN(rxcall, volid, voltype, newentry, 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 */
@@ -810,7 +814,7 @@ SVL_ReplaceEntryN(rxcall, volid, voltype, newentry, releasetype)
 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 */
@@ -829,7 +833,7 @@ SVL_UpdateEntry(rxcall, volid, voltype, updateentry, releasetype)
     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)
@@ -912,7 +916,7 @@ SVL_UpdateEntryByName(rxcall, volname, updateentry, releasetype)
 afs_int32
 SVL_SetLock(rxcall, volid, voltype, voloper)
      struct rx_call *rxcall;
-     afs_int32 volid;
+     afs_uint32 volid;
      afs_int32 voltype;
      afs_int32 voloper;
 {
@@ -930,7 +934,7 @@ SVL_SetLock(rxcall, volid, voltype, 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)
@@ -981,7 +985,7 @@ SVL_SetLock(rxcall, volid, voltype, voloper)
 afs_int32
 SVL_ReleaseLock(rxcall, volid, voltype, releasetype)
      struct rx_call *rxcall;
-     afs_int32 volid;
+     afs_uint32 volid;
      afs_int32 voltype;
      afs_int32 releasetype;
 {
@@ -999,7 +1003,7 @@ SVL_ReleaseLock(rxcall, volid, voltype, 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)
index 94dba96..d892bac 100644 (file)
@@ -39,7 +39,7 @@ struct vlheader {
     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 */
 };
 
@@ -63,7 +63,7 @@ struct vlentry {
     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 */
@@ -82,7 +82,7 @@ struct nvlentry {
     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 */
index ce6a9a4..2b6a3e1 100644 (file)
@@ -600,7 +600,7 @@ FreeBlock(trans, blockindex)
 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;
index b0bb3b2..922430f 100644 (file)
@@ -144,7 +144,7 @@ typedef __int64 Inode;
 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;
@@ -208,7 +208,7 @@ typedef struct StreamHandle_s {
 
 /* 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 */
index 526bd00..407a26f 100644 (file)
@@ -36,7 +36,7 @@ RCSID
  */
 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");
@@ -193,7 +193,7 @@ struct dinode *ginode();
 
 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;
@@ -660,7 +660,7 @@ xfs_RenameFiles(char *dir, xfs_Rename_t * renames, int n_renames)
 
 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;
@@ -882,7 +882,7 @@ xfs_ListViceInodes(char *devname, char *mountedOn, char *resultFile,
 
 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;
@@ -948,7 +948,7 @@ BUFAREA sblk;
 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 {
@@ -1435,7 +1435,7 @@ getDevName(char *pbuffer, char *wpath)
 
 #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];
@@ -1456,7 +1456,7 @@ inode_ConvertROtoRWvolume(char *pname, afs_int32 volumeId)
 
     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) {
@@ -1559,7 +1559,7 @@ inode_ConvertROtoRWvolume(char *pname, afs_int32 volumeId)
     }
 #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) {
index b7145cc..8e1e140 100644 (file)
@@ -1090,8 +1090,8 @@ static int namei_ListAFSSubDirs(IHandle_t * dirIH,
                                                  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
@@ -1142,8 +1142,8 @@ VerifyDirPerms(char *path)
  */
 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;
@@ -1219,8 +1219,8 @@ int
 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;
@@ -1291,8 +1291,8 @@ static int
 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;
@@ -1544,7 +1544,7 @@ convertVolumeInfo(int fdr, int fdw, afs_uint32 vid)
  */
 
 int
-namei_ConvertROtoRWvolume(char *pname, afs_int32 volumeId)
+namei_ConvertROtoRWvolume(char *pname, afs_uint32 volumeId)
 {
 #ifdef FSSYNC_BUILD_CLIENT
     namei_t n;
@@ -1569,7 +1569,7 @@ namei_ConvertROtoRWvolume(char *pname, afs_int32 volumeId)
     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) {
@@ -1719,7 +1719,7 @@ namei_ConvertROtoRWvolume(char *pname, afs_int32 volumeId)
     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) {
index d32f820..39b03fc 100644 (file)
@@ -51,12 +51,12 @@ int namei_ListAFSFiles(char *dev,
                                         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);
 
 
index 1daa3fb..9ee43e2 100644 (file)
@@ -522,7 +522,7 @@ nt_MakeSpecIno(int type)
 }
 
 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;
@@ -961,13 +961,13 @@ nt_SetLinkCount(FdHandle_t * h, Inode ino, int count, int locked)
 
 /* 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
@@ -1003,8 +1003,8 @@ WriteInodeInfo(FILE * fp, struct ViceInodeInfo *info, char *dir, char *name)
  */
 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;
@@ -1073,8 +1073,8 @@ int
 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];
@@ -1126,8 +1126,8 @@ static int
 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;
@@ -1239,7 +1239,7 @@ nt_ListAFSSubDirs(IHandle_t * 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;
index 572e5ee..9db6f8a 100644 (file)
@@ -37,8 +37,8 @@ extern int nt_unlink(char *name);
 
 /* 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);
@@ -49,11 +49,11 @@ extern int nt_GetLinkCount(FdHandle_t * h, Inode ino, int lockit);
 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);
 
 
index 28374a6..77d6162 100644 (file)
@@ -222,7 +222,7 @@ handleit(struct cmd_syndesc *as, void *arock)
 {
     register struct cmd_item *ti;
     int err = 0;
-    int volumeId = 0;
+    afs_uint32 volumeId = 0;
     char *partName = 0;
     struct DiskPartition64 *partP = NULL;
 
@@ -323,7 +323,7 @@ handleit(struct cmd_syndesc *as, void *arock)
            }
        }
        (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");
index 31af56f..37a4057 100644 (file)
@@ -981,8 +981,8 @@ void
 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;
@@ -1008,7 +1008,7 @@ CountVolumeInodes(register struct ViceInodeInfo *ip, int maxInodes,
 }
 
 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);
@@ -1293,7 +1293,7 @@ GetVolumeSummary(VolumeId 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);
@@ -1744,7 +1744,7 @@ SalvageVolumeHeaderFile(register struct InodeSummary *isp,
     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);
@@ -1773,7 +1773,7 @@ SalvageVolumeHeaderFile(register struct InodeSummary *isp,
            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);
index da4c20a..b21171b 100644 (file)
@@ -4876,7 +4876,7 @@ VGetVolumePath(Error * ec, VolId volumeId, char **partitionp, char **namep)
 
     *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));
@@ -4939,7 +4939,7 @@ char *
 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;
 }
 
@@ -4963,7 +4963,7 @@ VolumeExternalName(VolumeId volumeId)
 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
 
index 1ad0bb8..6d2f21f 100644 (file)
@@ -171,7 +171,7 @@ VCreateVolume_r(Error * ec, char *partname, VolId volumeId, VolId parentId)
     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);
index 6bae9ac..a690650 100644 (file)
@@ -170,7 +170,7 @@ handleit(struct cmd_syndesc *as, void *arock)
 {
     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;
@@ -192,7 +192,7 @@ handleit(struct cmd_syndesc *as, void *arock)
     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))
index 292536f..5125f3a 100644 (file)
@@ -58,13 +58,13 @@ statindex 16
 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!!! */
@@ -92,11 +92,11 @@ struct destServer {
 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;
@@ -151,11 +151,11 @@ const VOLINT_STATS_TIME_IDX_5 = 5;        /*Greater than 1 week*/
  */
 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?*/
@@ -183,7 +183,7 @@ struct transDebugInfo {
        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*) */
@@ -223,8 +223,8 @@ struct diskPartition64 {
 struct restoreCookie {
        char name[32];
        afs_int32 type;
-       afs_int32 clone;
-       afs_int32 parent;
+       afs_uint32 clone;
+       afs_uint32 parent;
 };
 
 struct replica {
@@ -248,8 +248,8 @@ proc CreateVolume(
   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;
 
@@ -278,10 +278,10 @@ proc EndTrans(
 
 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(
@@ -295,7 +295,7 @@ proc GetFlags(
 ) = VOLGETFLAGS;
 
 proc TransCreate(
-  IN afs_int32 volume,
+  IN afs_uint32 volume,
   IN afs_int32 partition,
   IN afs_int32 flags,
   OUT afs_int32 *trans
@@ -308,7 +308,7 @@ proc Dump(
 
 proc GetNthVolume(
   IN afs_int32 index,
-  OUT afs_int32 *volume,
+  OUT afs_uint32 *volume,
   OUT afs_int32 *partition
 ) = VOLGETNTHVOLUME;
 
@@ -330,8 +330,8 @@ proc GetStatus(
 proc SignalRestore(
   IN string name<>,
   int type,
-  afs_int32 pid,
-  afs_int32 cloneid
+  afs_uint32 pid,
+  afs_uint32 cloneid
 ) = VOLSIGRESTORE;
 
 proc ListPartitions(
@@ -348,9 +348,9 @@ proc SetIdsTypes(
   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(
@@ -364,18 +364,18 @@ proc PartitionInfo(
 
 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(
@@ -391,7 +391,7 @@ proc XListVolumes(
 
 proc XListOneVolume(
   IN afs_int32 partID,
-  afs_int32 volid,
+  afs_uint32 volid,
   OUT volXEntries *resultXEntries
 ) = VOLXLISTONEVOL;
 
@@ -415,7 +415,7 @@ proc ForwardMultiple(
 
 proc ConvertROtoRWvolume(
   IN afs_int32 partid,
-  IN afs_int32 volid
+  IN afs_uint32 volid
 ) = VOLCONVERTRO;
 
 proc GetSize(
index cafcff9..9d0024c 100644 (file)
@@ -20,6 +20,7 @@ RCSID
 #include <string.h>
 #include <errno.h>
 #ifdef AFS_NT40_ENV
+#include <stdlib.h>
 #include <fcntl.h>
 #include <winsock2.h>
 #else
@@ -103,9 +104,9 @@ VPFullUnlock()
 {
     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;
@@ -150,7 +151,7 @@ PartitionID(char *aname)
 }
 
 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;
@@ -181,7 +182,7 @@ ConvertPartition(int apartno, char *aname, int asize)
 
 /* 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;
@@ -330,7 +331,7 @@ VolPartitionInfo(struct rx_call *acid, char *pname, struct diskPartition64
     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;
@@ -340,7 +341,7 @@ VolPartitionInfo(struct rx_call *acid, char *pname, struct diskPartition64
 
 /* 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;
 
@@ -350,7 +351,7 @@ SAFSVolNukeVolume(struct rx_call *acid, afs_int32 apartID, afs_int32 avolID)
 }
 
 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;
@@ -385,7 +386,7 @@ VolNukeVolume(struct rx_call *acid, afs_int32 apartID, afs_int32 avolID)
  */
 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;
@@ -400,13 +401,14 @@ SAFSVolCreateVolume(struct rx_call *acid, afs_int32 apart, char *aname,
 
 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];
@@ -528,8 +530,8 @@ VolDeleteVolume(struct rx_call *acid, afs_int32 atrans)
  */
 /* 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;
 
@@ -541,10 +543,10 @@ SAFSVolClone(struct rx_call *acid, afs_int32 atrans, afs_int32 purgeId,
 }
 
 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;
@@ -714,7 +716,7 @@ VolClone(struct rx_call *acid, afs_int32 atrans, afs_int32 purgeId,
 
 /* 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;
 
@@ -888,7 +890,7 @@ VolReClone(struct rx_call *acid, afs_int32 atrans, afs_int32 cloneId)
  * 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;
@@ -900,7 +902,7 @@ SAFSVolTransCreate(struct rx_call *acid, afs_int32 volume, afs_int32 partition,
 }
 
 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;
@@ -954,7 +956,7 @@ VolTransCreate(struct rx_call *acid, afs_int32 volume, afs_int32 partition,
  * 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;
@@ -1660,7 +1662,7 @@ VolGetName(struct rx_call *acid, afs_int32 atrans, char **aname)
  * - 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;
 }
@@ -1711,7 +1713,6 @@ SAFSVolXListPartitions(struct rx_call *acid, struct partEntries *pEntries)
 afs_int32
 XVolListPartitions(struct rx_call *acid, struct partEntries *pEntries)
 {
-    struct stat rbuf, pbuf;
     char namehead[9];
     struct partList partList;
     struct DiskPartition64 *dp;
@@ -1767,7 +1768,7 @@ ExtractVolId(char vname[])
 /*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;
 
@@ -2050,7 +2051,6 @@ GetVolInfo(afs_uint32 partId,
           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;
@@ -2164,8 +2164,8 @@ GetVolInfo(afs_uint32 partId,
 
 /*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;
 
@@ -2175,17 +2175,16 @@ SAFSVolListOneVolume(struct rx_call *acid, afs_int32 partid, afs_int32
 }
 
 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;
 
@@ -2266,7 +2265,7 @@ VolListOneVolume(struct rx_call *acid, afs_int32 partid, afs_int32
 
 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;
 
@@ -2277,17 +2276,15 @@ SAFSVolXListOneVolume(struct rx_call *a_rxCidP, afs_int32 a_partID,
 
 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;
 
@@ -2399,8 +2396,7 @@ VolListVolumes(struct rx_call *acid, afs_int32 partid, afs_int32 flags,
     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;
 
@@ -2528,8 +2524,7 @@ VolXListVolumes(struct rx_call *a_rxCidP, afs_int32 a_partID,
     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;
 
@@ -2722,7 +2717,7 @@ VolMonitor(struct rx_call *acid, transDebugEntries *transInfo)
 }
 
 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;
 
@@ -2734,7 +2729,7 @@ SAFSVolSetIdsTypes(struct rx_call *acid, afs_int32 atid, char name[], afs_int32
 }
 
 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;
@@ -2836,7 +2831,7 @@ VolSetDate(struct rx_call *acid, afs_int32 atid, afs_int32 cdate)
 
 afs_int32
 SAFSVolConvertROtoRWvolume(struct rx_call *acid, afs_int32 partId,
-                          afs_int32 volumeId)
+                          afs_uint32 volumeId)
 {
 #ifdef AFS_NT40_ENV
     return EXDEV;
@@ -2847,7 +2842,7 @@ SAFSVolConvertROtoRWvolume(struct rx_call *acid, afs_int32 partId,
     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 */
index 8053ef7..d9787f0 100644 (file)
@@ -116,10 +116,10 @@ extern struct volser_trans *QI_GlobalWriteTrans;
 /*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 */
index 50fbe0f..b2ce876 100644 (file)
@@ -23,45 +23,45 @@ extern int UV_SetSecurity(register struct rx_securityClass *as,
 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,
@@ -76,9 +76,9 @@ extern int UV_XListVolumes(afs_int32 a_serverID, afs_int32 a_partID,
                           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,
@@ -86,7 +86,7 @@ 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);
@@ -97,25 +97,25 @@ extern int UV_RenameVolume(struct nvldbentry *entry, char oldname[],
                           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);
 
index 73fd5b6..8e9643c 100644 (file)
@@ -67,11 +67,11 @@ RCSID
 
 /* 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;
 };
 
@@ -107,7 +107,7 @@ qInit(struct tqHead *ahead)
 
 
 static void
-qPut(struct tqHead *ahead, afs_int32 volid)
+qPut(struct tqHead *ahead, afs_uint32 volid)
 {
     struct tqElem *elem;
 
@@ -1155,7 +1155,7 @@ DisplayVolumes(server, part, pntr, count, longlist, fast, quiet)
      int quiet;
 {
     int totalOK, totalNotOK, totalBusy, i;
-    afs_int32 volid = 0;
+    afs_uint32 volid = 0;
 
     totalOK = 0;
     totalNotOK = 0;
@@ -1232,7 +1232,7 @@ XDisplayVolumes(a_servID, a_partID, a_xInfoP, a_count, a_int32, a_fast,
     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.
@@ -1323,7 +1323,7 @@ XDisplayVolumes2(a_servID, a_partID, a_xInfoP, a_count, a_int32, a_fast,
     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.
@@ -1488,7 +1488,8 @@ static int
 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;
@@ -1556,7 +1557,7 @@ ExamineVolume(register struct cmd_syndesc *as, void *arock)
     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;
@@ -1707,7 +1708,7 @@ SetFields(register struct cmd_syndesc *as, void *arock)
     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;
@@ -1788,7 +1789,8 @@ SetFields(register struct cmd_syndesc *as, void *arock)
 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);
@@ -1847,7 +1849,8 @@ volOnline(register struct cmd_syndesc *as, void *arock)
 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;
 
@@ -1899,7 +1902,8 @@ CreateVolume(register struct cmd_syndesc *as, void *arock)
 {
     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;
@@ -1984,7 +1988,8 @@ DeleteAll(entry)
      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;
@@ -2007,7 +2012,8 @@ static int
 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;
 
@@ -2127,7 +2133,8 @@ static
 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];
 
@@ -2253,7 +2260,8 @@ MoveVolume(register struct cmd_syndesc *as, void *arock)
 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 */
@@ -2399,7 +2407,8 @@ CopyVolume(register struct cmd_syndesc *as, void *arock)
 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 */
@@ -2594,7 +2603,8 @@ ShadowVolume(register struct cmd_syndesc *as, void *arock)
 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;
@@ -2707,10 +2717,12 @@ CloneVolume(register struct cmd_syndesc *as, void *arock)
 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);
@@ -2777,7 +2789,8 @@ ReleaseVolume(register struct cmd_syndesc *as, void *arock)
 {
 
     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)
@@ -2820,7 +2833,8 @@ ReleaseVolume(register struct cmd_syndesc *as, void *arock)
 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;
 
@@ -2920,7 +2934,8 @@ retry_dump:
 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;
@@ -3215,7 +3230,8 @@ RestoreVolume(register struct cmd_syndesc *as, void *arock)
 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) {
@@ -3240,7 +3256,8 @@ LockReleaseCmd(register struct cmd_syndesc *as, void *arock)
 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);;
@@ -3292,7 +3309,8 @@ static int
 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);
@@ -3342,7 +3360,8 @@ RemoveSite(register struct cmd_syndesc *as, void *arock)
 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);
@@ -3876,7 +3895,8 @@ static int
 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 */
@@ -4109,7 +4129,7 @@ RenameVolume(register struct cmd_syndesc *as, void *arock)
 }
 
 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;
@@ -4172,7 +4192,7 @@ static int
 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;
@@ -4566,7 +4586,8 @@ ListVLDB(struct cmd_syndesc *as, void *arock)
 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;
@@ -4904,7 +4925,7 @@ UnlockVLDB(register struct cmd_syndesc *as, void *arock)
     register struct nvldbentry *vllist;
     afs_int32 nentries;
     int j;
-    afs_int32 volid;
+    afs_uint32 volid;
     afs_int32 totalE;
     char pname[10];
 
@@ -5359,7 +5380,8 @@ ListAddrs(register struct cmd_syndesc *as, void *arock)
 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) {
@@ -5386,7 +5408,8 @@ static int
 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;
@@ -5549,7 +5572,8 @@ ConvertRO(register struct cmd_syndesc *as, void *arock)
 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;
 
index 572db9d..54cd748 100644 (file)
@@ -63,8 +63,8 @@ struct ubik_client *cstruct;
 int verbose = 0, noresolve = 0;
 
 struct release {
-    afs_int32 crtime;
-    afs_int32 uptime;
+    afs_uint32 crtime;
+    afs_uint32 uptime;
     afs_int32 vldbEntryIndex;
 };
 
@@ -162,9 +162,9 @@ do { \
 
 /* 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,
@@ -452,7 +452,7 @@ UV_Bind(afs_int32 aserver, afs_int32 port)
  * 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;
 
@@ -580,7 +580,7 @@ EnumerateEntry(struct nvldbentry *entry)
 
 /* 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;
@@ -630,7 +630,7 @@ UV_PartitionInfo64(afs_int32 server, char *pname,
 /* 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);
@@ -642,7 +642,7 @@ UV_CreateVolume(afs_int32 aserver, afs_int32 apart, char *aname,
 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;
@@ -740,7 +740,7 @@ UV_CreateVolume2(afs_int32 aserver, afs_int32 apart, char *aname,
 * 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;
@@ -794,7 +794,7 @@ UV_AddVLDBEntry(afs_int32 aserver, afs_int32 apart, char *aname,
  * 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;
@@ -1055,7 +1055,7 @@ sigint_handler(int x)
  */
 
 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;
@@ -1067,7 +1067,7 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
     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;
 
@@ -2025,7 +2025,7 @@ UV_MoveVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
 
 
 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,
@@ -2045,9 +2045,9 @@ UV_MoveVolume(afs_int32 afromvol, afs_int32 afromserver, afs_int32 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;
@@ -2056,7 +2056,8 @@ UV_CopyVolume2(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
     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;
 
@@ -2539,7 +2540,7 @@ cpincr:
 
 
 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,
@@ -2553,11 +2554,11 @@ UV_CopyVolume(afs_int32 afromvol, afs_int32 afromserver, afs_int32 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;
@@ -2814,8 +2815,8 @@ UV_BackupVolume(afs_int32 aserver, afs_int32 apart, afs_int32 avolid)
  */
 
 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;
@@ -2994,7 +2995,7 @@ UV_CloneVolume(afs_int32 aserver, afs_int32 apart, afs_int32 avolid,
 }
 
 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;
@@ -3033,7 +3034,7 @@ GetTrans(struct nvldbentry *vldbEntryPtr, afs_int32 index,
         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;
@@ -3143,7 +3144,7 @@ SimulateForwardMultiple(struct rx_connection *fromconn, afs_int32 fromtid,
                        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] =
@@ -3170,13 +3171,13 @@ SimulateForwardMultiple(struct rx_connection *fromconn, afs_int32 fromtid,
  */
 
 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;
@@ -3197,8 +3198,8 @@ UV_ReleaseVolume(afs_int32 afromvol, afs_int32 afromserver,
     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;
@@ -3875,7 +3876,7 @@ dump_sig_handler(int x)
  * 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)
 {
@@ -3963,7 +3964,7 @@ UV_DumpVolume(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
  * 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)
 {
@@ -3972,7 +3973,7 @@ UV_DumpClonedVolume(afs_int32 afromvol, afs_int32 afromserver,
     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;
 
@@ -4106,7 +4107,7 @@ UV_DumpClonedVolume(afs_int32 afromvol, afs_int32 afromserver,
  * 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)
 {
@@ -4118,8 +4119,8 @@ UV_RestoreVolume2(afs_int32 toserver, afs_int32 topart, afs_int32 tovolid,
     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;
@@ -4588,7 +4589,7 @@ UV_RestoreVolume2(afs_int32 toserver, afs_int32 topart, afs_int32 tovolid,
 }
 
 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)
 {
@@ -4599,10 +4600,8 @@ UV_RestoreVolume(afs_int32 toserver, afs_int32 topart, afs_int32 tovolid,
 
 /*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");
@@ -4624,7 +4623,7 @@ UV_LockRelease(afs_int32 volid)
 /*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;
@@ -4735,7 +4734,7 @@ UV_AddSite(afs_int32 server, afs_int32 part, afs_int32 volid, afs_int32 valid)
 
 /*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;
@@ -4815,7 +4814,7 @@ UV_RemoveSite(afs_int32 server, afs_int32 part, afs_int32 volid)
 
 /*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;
@@ -4995,7 +4994,7 @@ UV_GenerateVolumeClones(afs_int32 aserver, afs_int32 apart,
     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;
@@ -5185,7 +5184,7 @@ UV_XListVolumes(afs_int32 a_serverID, afs_int32 a_partID, int a_all,
 
 /* 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;
@@ -5244,7 +5243,7 @@ UV_ListOneVolume(afs_int32 aserver, afs_int32 apart, afs_int32 volid,
  *------------------------------------------------------------------------*/
 
 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 */
@@ -5315,7 +5314,7 @@ CheckVolume(volintInfo * volumeinfo, afs_int32 aserver, afs_int32 apart,
     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) {
@@ -5751,7 +5750,7 @@ sortVolumes(const void *a, const void *b)
 {
     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);
@@ -5792,11 +5791,11 @@ UV_SyncVolume(afs_int32 aserver, afs_int32 apart, char *avolname, int flags)
     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;
@@ -5986,7 +5985,7 @@ UV_SyncVolume(afs_int32 aserver, afs_int32 apart, char *avolname, int flags)
   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,
@@ -5994,7 +5993,7 @@ UV_SyncVolume(afs_int32 aserver, afs_int32 apart, char *avolname, int flags)
            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) {
@@ -6031,7 +6030,8 @@ UV_SyncVldb(afs_int32 aserver, afs_int32 apart, int flags, int force)
 {
     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;
@@ -6145,7 +6145,7 @@ UV_SyncVldb(afs_int32 aserver, afs_int32 apart, int flags, int force)
   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,
@@ -6153,7 +6153,7 @@ UV_SyncVldb(afs_int32 aserver, afs_int32 apart, int flags, int force)
            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) {
@@ -6181,7 +6181,7 @@ UV_SyncVldb(afs_int32 aserver, afs_int32 apart, int flags, int force)
  *      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;
@@ -6890,7 +6890,7 @@ UV_VolserStatus(afs_int32 server, transDebugInfo ** rpntr, afs_int32 * rcount)
 
 /*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;
@@ -6939,7 +6939,7 @@ UV_VolumeZap(afs_int32 server, afs_int32 part, afs_int32 volid)
 }
 
 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;
@@ -6989,7 +6989,7 @@ UV_SetVolume(afs_int32 server, afs_int32 partition, afs_int32 volid,
 }
 
 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;
@@ -7031,7 +7031,7 @@ UV_SetVolumeInfo(afs_int32 server, afs_int32 partition, afs_int32 volid,
 }
 
 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;
index 2679d78..6463e96 100644 (file)
@@ -128,7 +128,7 @@ VLDB_CreateEntry(struct nvldbentry *entryp)
 }
 
 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;
@@ -179,7 +179,7 @@ VLDB_GetEntryByName(char *namep, struct nvldbentry *entryp)
 }
 
 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;
index 6594a3e..a4b16bf 100644 (file)
@@ -1,10 +1,11 @@
 #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);