* If there is one here that is not in the inode volume list,
* delete it now. */
for (; vsp < esp && (vsp->header.parent < rwvid); vsp++) {
- if (vsp->fileName)
+ if (vsp->unused)
DeleteExtraVolumeHeaderFile(salvinfo, vsp);
}
/* Now match up the volume summary info from the root directory with the
for (tsp = vsp; tsp < esp && (tsp->header.parent == rwvid); tsp++) {
if (tsp->header.id == vid) {
salvinfo->inodeSummary[j].volSummary = tsp;
- tsp->fileName = 0;
+ tsp->unused = 0;
break;
}
}
/* Delete any additional volumes that were listed in the partition but which didn't have any corresponding inodes */
for (; vsp < esp; vsp++) {
- if (vsp->fileName)
+ if (vsp->unused)
DeleteExtraVolumeHeaderFile(salvinfo, vsp);
}
DeleteExtraVolumeHeaderFile(struct SalvInfo *salvinfo, struct VolumeSummary *vsp)
{
char path[64];
- sprintf(path, "%s" OS_DIRSEP "%s", salvinfo->fileSysPath, vsp->fileName);
+ char filename[VMAXPATHLEN];
+
+ if (vsp->deleted) {
+ return;
+ }
+
+ VolumeExternalName_r(vsp->header.id, filename, sizeof(filename));
+ sprintf(path, "%s" OS_DIRSEP "%s", salvinfo->fileSysPath, filename);
if (!Showmode)
Log("The volume header file %s is not associated with any actual data (%sdeleted)\n", path, (Testing ? "would have been " : ""));
afs_printable_uint32_lu(vsp->header.id));
}
- /* make sure we actually delete the fileName file; ENOENT
+ /* make sure we actually delete the header file; ENOENT
* is fine, since VDestroyVolumeDiskHeader probably already
* unlinked it */
if (unlink(path) && errno != ENOENT) {
}
vsp->deleted = 1;
}
- vsp->fileName = 0;
}
int
GetVolumeSummary(salvinfo, singleVolumeNumber);
for (i = 0, vsp = salvinfo->volumeSummaryp; i < salvinfo->nVolumes; i++) {
- if (vsp->fileName) {
+ if (vsp->unused) {
if (vsp->header.id == singleVolumeNumber) {
foundSVN = 1;
}
DiskToVolumeHeader(&vsp->header, &diskHdr);
VolumeExternalName_r(q_res.children[i], name, sizeof(name));
- vsp->fileName = ToString(name);
+ vsp->unused = 1;
salvinfo->nVolumes++;
vsp++;
}
return 1;
}
- summary.fileName = ToString(base);
+ summary.unused = 1;
params->nVolumes++;
if (params->nVolumes > params->totalVolumes) {
if (memcmp
(&isp->volSummary->header, &tempHeader,
sizeof(struct VolumeHeader))) {
- /* We often remove the name before calling us, so we make a fake one up */
- if (isp->volSummary->fileName) {
- strcpy(headerName, isp->volSummary->fileName);
- } else {
- snprintf(headerName, sizeof headerName, VFORMAT,
- afs_printable_uint32_lu(isp->volumeId));
- }
+ VolumeExternalName_r(isp->volumeId, headerName, sizeof(headerName));
snprintf(path, sizeof path, "%s" OS_DIRSEP "%s",
salvinfo->fileSysPath, headerName);
if (!Testing) {
afs_int32 code;
char path[64];
- sprintf(path, "%s" OS_DIRSEP "%s", salvinfo->fileSysPath, isp->volSummary->fileName);
+ char filename[VMAXPATHLEN];
+ VolumeExternalName_r(isp->volumeId, filename, sizeof(filename));
+ sprintf(path, "%s" OS_DIRSEP "%s", salvinfo->fileSysPath, filename);
code = VDestroyVolumeDiskHeader(salvinfo->fileSysPartition, isp->volumeId, isp->RWvolumeId);
if (code) {
afs_printable_uint32_lu(isp->volumeId));
}
- /* make sure we actually delete the fileName file; ENOENT
+ /* make sure we actually delete the header file; ENOENT
* is fine, since VDestroyVolumeDiskHeader probably already
* unlinked it */
if (unlink(path) && errno != ENOENT) {