]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-volinfo-fixes-20050508
authorChaskiel M Grundman <cg2v@andrew.cmu.edu>
Sun, 8 May 2005 07:10:26 +0000 (07:10 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sun, 8 May 2005 07:10:26 +0000 (07:10 +0000)
FIXES 18391

large (>31bit) volume id handling and fixed handling of cloned volumes

(cherry picked from commit f519e0457caaff9be2926518efffac586202e266)

src/util/afsutil_prototypes.h
src/util/flipbase64.c
src/vol/vol-info.c

index 89f5b71c0298bb62c122fd28ba731cb2601a18dd..ee6873f492b45304843bc3266ee7f0d50a0b23a7 100644 (file)
@@ -62,8 +62,8 @@ extern int base32_to_int(char *s);
  * early in name.
  */
 #ifdef AFS_64BIT_ENV
-#define int32_to_flipbase64(S, A) int64_to_flipbase64(S, (afs_int64)(A))
-extern char *int64_to_flipbase64(lb64_string_t s, afs_int64 a);
+#define int32_to_flipbase64(S, A) int64_to_flipbase64(S, (afs_uint64)(A))
+extern char *int64_to_flipbase64(lb64_string_t s, afs_uint64 a);
 extern afs_int64 flipbase64_to_int64(char *s);
 #else
 #define int32_to_flipbase64(S, A) int64_to_flipbase64(S, (u_int64_t)(A))
index a3294102128ddc73fad351a3b8198a6c23943ba8..1b6d0985a91fd25a604058d1129a8e7b290f8ab5 100644 (file)
@@ -80,7 +80,7 @@ static char c_reverse[] = {
  */
 #ifdef AFS_64BIT_ENV
 char *
-int64_to_flipbase64(lb64_string_t s, afs_int64 a)
+int64_to_flipbase64(lb64_string_t s, afs_uint64 a)
 #else
 char *
 int64_to_flipbase64(lb64_string_t s, u_int64_t a)
@@ -88,7 +88,7 @@ int64_to_flipbase64(lb64_string_t s, u_int64_t a)
 {
     int i;
 #ifdef AFS_64BIT_ENV
-    afs_int64 n;
+    afs_uint64 n;
 #else
     u_int64_t n;
 #endif
index 03d34bba8deed31eafc6cb0f09ef839925a32cb5..836f50becc10e41a62e220331b2c9b571d7ed00e 100644 (file)
@@ -256,7 +256,7 @@ handleit(struct cmd_syndesc *as)
     if ((ti = as->parms[5].items))
        partName = ti->data;
     if ((ti = as->parms[6].items))
-       volumeId = atoi(ti->data);
+       volumeId = strtoul(ti->data, NULL, 10);
     if (as->parms[7].items)
        dheader = 1;
     else
@@ -499,7 +499,7 @@ HandleVolume(struct DiskPartition *dp, char *name)
                printf("\tVolId\t= %u\n", header.id);
            }
 
-           IH_INIT(ih, dp->device, header.id, header.volumeInfo);
+           IH_INIT(ih, dp->device, header.parent, header.volumeInfo);
            fdP = IH_OPEN(ih);
            if (fdP == NULL) {
                perror("opening volume info");
@@ -519,7 +519,7 @@ HandleVolume(struct DiskPartition *dp, char *name)
                       PrintInode(NULL, header.volumeInfo), code);
            }
 
-           IH_INIT(ih, dp->device, header.id, header.smallVnodeIndex);
+           IH_INIT(ih, dp->device, header.parent, header.smallVnodeIndex);
            fdP = IH_OPEN(ih);
            if (fdP == NULL) {
                perror("opening small vnode index");
@@ -538,7 +538,7 @@ HandleVolume(struct DiskPartition *dp, char *name)
                       PrintInode(NULL, header.smallVnodeIndex), code);
            }
 
-           IH_INIT(ih, dp->device, header.id, header.largeVnodeIndex);
+           IH_INIT(ih, dp->device, header.parent, header.largeVnodeIndex);
            fdP = IH_OPEN(ih);
            if (fdP == NULL) {
                perror("opening large vnode index");
@@ -560,7 +560,7 @@ HandleVolume(struct DiskPartition *dp, char *name)
 #endif
            }
 #ifdef AFS_NAMEI_ENV
-           IH_INIT(ih, dp->device, header.id, header.linkTable);
+           IH_INIT(ih, dp->device, header.parent, header.linkTable);
            fdP = IH_OPEN(ih);
            if (fdP == NULL) {
                perror("opening link table index");
@@ -612,6 +612,8 @@ HandleVolume(struct DiskPartition *dp, char *name)
               Vauxsize_k, Vvnodesize_k, totvolsize, totvolsize - Vdiskused,
               V_name(vp));
     }
+    free(vp->header);
+    free(vp);
 }
 
 int