continue;
}
while ((vid = VInitNextVolumeId(dirp))) {
- Volume *vp = (Volume*)malloc(sizeof(Volume));
+ Volume *vp = calloc(1, sizeof(Volume));
osi_Assert(vp);
- memset(vp, 0, sizeof(Volume));
vp->device = partition->device;
vp->partition = partition;
vp->hashid = vid;
VOL_UNLOCK;
/* allocate the volume structure */
- vp = nvp = (Volume *) malloc(sizeof(Volume));
+ vp = nvp = calloc(1, sizeof(Volume));
osi_Assert(vp != NULL);
- memset(vp, 0, sizeof(Volume));
queue_Init(&vp->vnode_list);
queue_Init(&vp->rx_call_list);
CV_INIT(&V_attachCV(vp), "vp attach", CV_DEFAULT, 0);
vip->bitmap = BitMap;
vip->bitmapOffset = 0;
} else
- free((byte *) BitMap);
+ free(BitMap);
#endif /* BITMAP_LATER */
#ifdef AFS_DEMAND_ATTACH_FS
VChangeState_r(vp, state_save);
Log("warning: there is likely a bug in the volume update scanner\n");
return;
}
- UpdateList =
- (VolumeId *) realloc(UpdateList,
- sizeof(VolumeId) * updateSize);
+ UpdateList = realloc(UpdateList,
+ sizeof(VolumeId) * updateSize);
}
}
osi_Assert(UpdateList != NULL);
if (programType != fileServer) {
/* for volume utilities, we allocate volHeaders as needed */
if (!vp->header) {
- hd = (struct volHeader *)calloc(1, sizeof(*vp->header));
+ hd = calloc(1, sizeof(*vp->header));
osi_Assert(hd != NULL);
vp->header = hd;
hd->back = vp;
if (!hd) {
/* LRU is empty, so allocate a new volHeader
* this is probably indicative of a leak, so let the user know */
- hd = (struct volHeader *)calloc(1, sizeof(struct volHeader));
+ hd = calloc(1, sizeof(struct volHeader));
osi_Assert(hd != NULL);
if (!everLogged) {
Log("****Allocated more volume headers, probably leak****\n");