From f519e0457caaff9be2926518efffac586202e266 Mon Sep 17 00:00:00 2001 From: Chaskiel M Grundman Date: Sun, 8 May 2005 07:09:19 +0000 Subject: [PATCH] volinfo-fixes-20050508 FIXES 18391 large (>31bit) volume id handling and fixed handling of cloned volumes --- src/util/afsutil_prototypes.h | 4 ++-- src/util/flipbase64.c | 4 ++-- src/vol/vol-info.c | 12 +++++++----- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/util/afsutil_prototypes.h b/src/util/afsutil_prototypes.h index 89f5b71c0..ee6873f49 100644 --- a/src/util/afsutil_prototypes.h +++ b/src/util/afsutil_prototypes.h @@ -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)) diff --git a/src/util/flipbase64.c b/src/util/flipbase64.c index a32941021..1b6d0985a 100644 --- a/src/util/flipbase64.c +++ b/src/util/flipbase64.c @@ -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 diff --git a/src/vol/vol-info.c b/src/vol/vol-info.c index 03d34bba8..836f50bec 100644 --- a/src/vol/vol-info.c +++ b/src/vol/vol-info.c @@ -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 -- 2.39.5