#include <roken.h>
-#include <rx/xdr.h>
+#include <afs/opr.h>
+#ifdef AFS_PTHREAD_ENV
+# include <opr/lock.h>
+#endif
+
#include <rx/rx.h>
#include <rx/rxkad.h>
+#include <rx/rx_queue.h>
#include <afs/afsint.h>
-#include <afs/afs_assert.h>
#include <afs/prs_fs.h>
#include <afs/nfs.h>
#include <lwp.h>
extern int DoLogging;
extern struct afsconf_dir *tdir;
+extern int DoPreserveVolumeStats;
extern void LogError(afs_int32 errcode);
afs_uint32);
static afs_int32 VolSetDate(struct rx_call *, afs_int32, afs_int32);
+/**
+ * Return the host address of the caller as a string.
+ *
+ * @param[in] acid incoming rx call
+ * @param[out] buffer buffer to be filled with the addess string
+ *
+ * @return address as formatted by inet_ntoa
+ */
+static_inline char *
+callerAddress(struct rx_call *acid, char *buffer)
+{
+ afs_uint32 ip = rx_HostOf(rx_PeerOf(rx_ConnectionOf(acid)));
+ return afs_inet_ntoa_r(ip, buffer);
+}
+
/* this call unlocks all of the partition locks we've set */
int
VPFullUnlock_r(void)
DirHandle dir;
struct acl_accessList *ACL;
AFSFid did;
- Inode inodeNumber, nearInode;
+ Inode inodeNumber, AFS_UNUSED nearInode;
struct VnodeDiskObject *vnode;
struct VnodeClassInfo *vcp = &VnodeClassInfo[vLarge];
IHandle_t *h;
afs_fsize_t length;
ssize_t nBytes;
- vnode = (struct VnodeDiskObject *)malloc(SIZEOF_LARGEDISKVNODE);
+ vnode = calloc(1, SIZEOF_LARGEDISKVNODE);
if (!vnode)
return ENOMEM;
- memset(vnode, 0, SIZEOF_LARGEDISKVNODE);
V_pref(vp, nearInode);
inodeNumber =
did.Vnode = (VnodeId) 1;
did.Unique = 1;
- osi_Assert(!(afs_dir_MakeDir(&dir, (afs_int32 *)&did, (afs_int32 *)&did)));
+ opr_Verify(!(afs_dir_MakeDir(&dir, (afs_int32 *)&did, (afs_int32 *)&did)));
DFlush(); /* flush all modified dir buffers out */
DZap(&dir); /* Remove all buffers for this dir */
length = afs_dir_Length(&dir); /* Remember size of this directory */
IH_INIT(h, vp->device, V_parentId(vp),
vp->vnodeIndex[vLarge].handle->ih_ino);
fdP = IH_OPEN(h);
- osi_Assert(fdP != NULL);
+ opr_Assert(fdP != NULL);
nBytes = FDH_PWRITE(fdP, vnode, SIZEOF_LARGEDISKVNODE, vnodeIndexOffset(vcp, 1));
- osi_Assert(nBytes == SIZEOF_LARGEDISKVNODE);
+ opr_Assert(nBytes == SIZEOF_LARGEDISKVNODE);
FDH_REALLYCLOSE(fdP);
IH_RELEASE(h);
VNDISK_GET_LEN(length, vnode);
*partition)
{
afs_int32 code;
- struct diskPartition64 *dp = (struct diskPartition64 *)
- malloc(sizeof(struct diskPartition64));
+ struct diskPartition64 *dp = malloc(sizeof(struct diskPartition64));
code = VolPartitionInfo(acid, pname, dp);
if (!code) {
/* check for access */
if (!afsconf_SuperUser(tdir, acid, caller))
return VOLSERBAD_ACCESS;
- if (DoLogging)
- Log("%s is executing VolNukeVolume %u\n", caller, avolID);
+ if (DoLogging) {
+ char buffer[16];
+ Log("%s on %s is executing VolNukeVolume %u\n", caller,
+ callerAddress(acid, buffer), avolID);
+ }
if (volutil_PartitionName2_r(apartID, partName, sizeof(partName)) != 0)
return VOLSERNOVOL;
return VOLSERBADNAME;
if (!afsconf_SuperUser(tdir, acid, caller))
return VOLSERBAD_ACCESS;
- if (DoLogging)
- Log("%s is executing CreateVolume '%s'\n", caller, aname);
+ if (DoLogging) {
+ char buffer[16];
+ Log("%s on %s is executing CreateVolume '%s'\n", caller,
+ callerAddress(acid, buffer), aname);
+ }
if ((error = ConvertPartition(apart, ppath, sizeof(ppath))))
return error; /*a standard unix error */
if (atype != readwriteVolume && atype != readonlyVolume
TRELE(tt);
return ENOENT;
}
- if (DoLogging)
- Log("%s is executing Delete Volume %u\n", caller, tt->volid);
+ if (DoLogging) {
+ char buffer[16];
+ Log("%s on %s is executing Delete Volume %u\n", caller,
+ callerAddress(acid, buffer), tt->volid);
+ }
TSetRxCall(tt, acid, "DeleteVolume");
VPurgeVolume(&error, tt->volume); /* don't check error code, it is not set! */
V_destroyMe(tt->volume) = DESTROY_ME;
return VOLSERBADNAME;
if (!afsconf_SuperUser(tdir, acid, caller))
return VOLSERBAD_ACCESS; /*not a super user */
- if (DoLogging)
- Log("%s is executing Clone Volume new name=%s\n", caller, newName);
+ if (DoLogging) {
+ char buffer[16];
+ Log("%s on %s is executing Clone Volume new name=%s\n", caller,
+ callerAddress(acid, buffer), newName);
+ }
error = 0;
originalvp = (Volume *) 0;
purgevp = (Volume *) 0;
}
newId = *newNumber;
- if (newType != readonlyVolume && newType != backupVolume)
- return EINVAL;
tt = FindTrans(atrans);
if (!tt)
return ENOENT;
purgevp = NULL;
}
originalvp = tt->volume;
- if ((V_type(originalvp) == backupVolume)
- || (V_type(originalvp) == readonlyVolume)) {
- Log("1 Volser: Clone: The volume to be cloned must be a read/write; aborted\n");
- error = EROFS;
- goto fail;
- }
if ((V_destroyMe(originalvp) == DESTROY_ME) || !V_inService(originalvp)) {
Log("1 Volser: Clone: Volume %d is offline and cannot be cloned\n",
V_id(originalvp));
error = EINVAL;
goto fail;
}
- if (V_type(originalvp) == readonlyVolume
- && V_parentId(originalvp) != V_parentId(purgevp)) {
- Log("1 Volser: Clone: Volume %u and volume %u were not cloned from the same parent volume; aborted\n", tt->volid, purgeId);
- error = EXDEV;
- goto fail;
- }
- if (V_type(originalvp) == readwriteVolume
- && tt->volid != V_parentId(purgevp)) {
- Log("1 Volser: Clone: Volume %u was not originally cloned from volume %u; aborted\n", purgeId, tt->volid);
+ if (V_parentId(originalvp) != V_parentId(purgevp)) {
+ Log("1 Volser: Clone: Volume %u and volume %u were not originally cloned from the same parent; aborted\n", purgeId, tt->volid);
error = EXDEV;
goto fail;
}
salv_vp = originalvp;
#endif
- newvp =
- VCreateVolume(&error, originalvp->partition->name, newId,
- V_parentId(originalvp));
- if (error) {
- Log("1 Volser: Clone: Couldn't create new volume; clone aborted\n");
- newvp = (Volume *) 0;
- goto fail;
+ if (purgeId == newId) {
+ newvp = purgevp;
+ } else {
+ newvp =
+ VCreateVolume(&error, originalvp->partition->name, newId,
+ V_parentId(originalvp));
+ if (error) {
+ Log("1 Volser: Clone: Couldn't create new volume; clone aborted\n");
+ newvp = (Volume *) 0;
+ goto fail;
+ }
}
if (newType == readonlyVolume)
V_cloneId(originalvp) = newId;
V_type(newvp) = backupVolume;
V_backupId(originalvp) = newId;
}
- strcpy(newvp->header->diskstuff.name, newName);
+ strcpy(V_name(newvp), newName);
V_creationDate(newvp) = V_copyDate(newvp);
ClearVolumeStats(&V_disk(newvp));
V_destroyMe(newvp) = DESTROY_ME;
afs_int32 newType;
struct volser_trans *tt, *ttc;
char caller[MAXKTCNAMELEN];
+ VolumeDiskData saved_header;
/*not a super user */
if (!afsconf_SuperUser(tdir, acid, caller))
return VOLSERBAD_ACCESS;
- if (DoLogging)
- Log("%s is executing Reclone Volume %u\n", caller, cloneId);
+ if (DoLogging) {
+ char buffer[16];
+ Log("%s on %s is executing Reclone Volume %u\n", caller,
+ callerAddress(acid, buffer), cloneId);
+ }
error = 0;
clonevp = originalvp = (Volume *) 0;
tt = (struct volser_trans *)0;
TSetRxCall(tt, acid, "ReClone");
originalvp = tt->volume;
- if ((V_type(originalvp) == backupVolume)
- || (V_type(originalvp) == readonlyVolume)) {
- Log("1 Volser: Clone: The volume to be cloned must be a read/write; aborted\n");
- error = EROFS;
- goto fail;
- }
if ((V_destroyMe(originalvp) == DESTROY_ME) || !V_inService(originalvp)) {
Log("1 Volser: Clone: Volume %d is offline and cannot be cloned\n",
V_id(originalvp));
error = EXDEV;
goto fail;
}
- if (V_type(clonevp) != readonlyVolume && V_type(clonevp) != backupVolume) {
- Log("1 Volser: Clone: The \"recloned\" volume must be a read only volume; aborted\n");
- error = EINVAL;
- goto fail;
- }
- if (V_type(originalvp) == readonlyVolume
- && V_parentId(originalvp) != V_parentId(clonevp)) {
- Log("1 Volser: Clone: Volume %u and volume %u were not cloned from the same parent volume; aborted\n", tt->volid, cloneId);
- error = EXDEV;
- goto fail;
- }
- if (V_type(originalvp) == readwriteVolume
- && tt->volid != V_parentId(clonevp)) {
+ if (V_parentId(originalvp) != V_parentId(clonevp)) {
Log("1 Volser: Clone: Volume %u was not originally cloned from volume %u; aborted\n", cloneId, tt->volid);
error = EXDEV;
goto fail;
}
+ if (DoPreserveVolumeStats) {
+ CopyVolumeStats(&V_disk(clonevp), &saved_header);
+ }
+
error = 0;
Log("1 Volser: Clone: Recloning volume %u to volume %u\n", tt->volid,
cloneId);
}
/* don't do strcpy onto diskstuff.name, it's still OK from 1st clone */
- /* pretend recloned volume is a totally new instance */
- V_copyDate(clonevp) = time(0);
- V_creationDate(clonevp) = V_copyDate(clonevp);
- ClearVolumeStats(&V_disk(clonevp));
+ /* update the creationDate, since this represents the last cloning date
+ * for ROs. But do not update copyDate; let it stay so we can identify
+ * when the clone was first created. */
+ V_creationDate(clonevp) = time(0);
+ if (DoPreserveVolumeStats) {
+ CopyVolumeStats(&saved_header, &V_disk(clonevp));
+ } else {
+ ClearVolumeStats(&V_disk(clonevp));
+ }
V_destroyMe(clonevp) = 0;
V_inService(clonevp) = 0;
if (newType == backupVolume) {
- V_backupDate(originalvp) = V_copyDate(clonevp);
- V_backupDate(clonevp) = V_copyDate(clonevp);
+ V_backupDate(originalvp) = V_creationDate(clonevp);
+ V_backupDate(clonevp) = V_creationDate(clonevp);
}
V_inUse(clonevp) = 0;
VUpdateVolume(&error, clonevp);
if (results) {
memset(results, 0, sizeof(manyResults));
i = results->manyResults_len = destinations->manyDests_len;
- results->manyResults_val = codes =
- (afs_int32 *) malloc(i * sizeof(afs_int32));
+ results->manyResults_val = codes = malloc(i * sizeof(afs_int32));
}
if (!results || !results->manyResults_val)
return ENOMEM;
/* (fromDate == 0) ==> full dump */
is_incremental = (fromDate ? 1 : 0);
- tcons =
- (struct rx_connection **)malloc(i * sizeof(struct rx_connection *));
+ tcons = malloc(i * sizeof(struct rx_connection *));
if (!tcons) {
return ENOMEM;
}
- tcalls = (struct rx_call **)malloc(i * sizeof(struct rx_call *));
+ tcalls = malloc(i * sizeof(struct rx_call *));
if (!tcalls) {
free(tcons);
return ENOMEM;
return ENOENT;
}
- td = &tv->header->diskstuff;
+ td = &(V_disk(tv));
astatus->volID = td->id;
astatus->nextUnique = td->uniquifier;
astatus->type = td->type;
return ENOENT;
}
- td = &tv->header->diskstuff;
+ td = &(V_disk(tv));
/*
* Add more fields as necessary
*/
int len;
/* We need to at least fill it in */
- *aname = (char *)malloc(1);
+ *aname = malloc(1);
if (!*aname)
return ENOMEM;
tt = FindTrans(atrans);
return ENOENT;
}
- td = &tv->header->diskstuff;
+ td = &(V_disk(tv));
len = strlen(td->name) + 1; /* don't forget the null */
if (len >= SIZE) {
TClearRxCall(tt);
TRELE(tt);
return E2BIG;
}
- *aname = (char *)realloc(*aname, len);
+ *aname = realloc(*aname, len);
strcpy(*aname, td->name);
TClearRxCall(tt);
if (TRELE(tt))
partList.partId[j++] = i;
}
if (j > 0) {
- pEntries->partEntries_val = (afs_int32 *) malloc(j * sizeof(int));
+ pEntries->partEntries_val = malloc(j * sizeof(int));
if (!pEntries->partEntries_val)
return ENOMEM;
memcpy((char *)pEntries->partEntries_val, (char *)&partList,
}
-/*extract the volume id from string vname. Its of the form " V0*<id>.vol "*/
-afs_int32
-ExtractVolId(char vname[])
-{
- int i;
- char name[VOLSER_MAXVOLNAME + 1];
-
- strcpy(name, vname);
- i = 0;
- while (name[i] == 'V' || name[i] == '0')
- i++;
-
- name[11] = '\0'; /* smash the "." */
- return (atol(&name[i]));
-}
-
-/*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_uint32 * volid)
+/*
+ * Scan a directory for possible volume headers.
+ * in: DIR *dirp -- a directory handle from opendir()
+ * out: char *volname -- set to name of directory entry
+ * afs_uint32 *volid -- set to volume ID parsed from name
+ * returns:
+ * true if volname and volid have been set to valid values
+ * false if we got to the end of the directory
+ */
+static int
+GetNextVol(DIR *dirp, char *volname, afs_uint32 *volid)
{
struct dirent *dp;
- dp = readdir(dirp); /*read next entry in the directory */
- if (dp) {
- if ((dp->d_name[0] == 'V') && !strcmp(&(dp->d_name[11]), VHDREXT)) {
- *volid = ExtractVolId(dp->d_name);
+ while ((dp = readdir(dirp)) != NULL) {
+ /* could be optimized on platforms with dp->d_namlen */
+ if (dp->d_name[0] == 'V' && strlen(dp->d_name) == VHDRNAMELEN
+ && strcmp(&(dp->d_name[VFORMATDIGITS + 1]), VHDREXT) == 0) {
+ *volid = VolumeNumber(dp->d_name);
strcpy(volname, dp->d_name);
- return 0; /*return the name of the file representing a volume */
- } else {
- strcpy(volname, "");
- return 0; /*volname doesnot represent a volume */
+ return 1;
}
- } else {
- strcpy(volname, "EOD");
- return 0; /*end of directory */
}
-
+ return 0;
}
/**
FillVolInfo(Volume * vp, volint_info_handle_t * handle)
{
unsigned int numStatBytes, now;
- struct VolumeDiskData *hdr = &vp->header->diskstuff;
+ struct VolumeDiskData *hdr = &(V_disk(vp));
/*read in the relevant info */
strcpy((char *)VOLINT_INFO_PTR(handle, name), hdr->name);
/* Get volume from volserver */
if (mode == VOL_INFO_LIST_MULTIPLE)
tv = VAttachVolumeByName(&error, pname, volname, V_PEEK);
- else
- tv = VAttachVolumeByName_retry(&error, pname, volname, V_PEEK);
+ else {
+#ifdef AFS_DEMAND_ATTACH_FS
+ int mode = V_PEEK;
+#else
+ int mode = V_READONLY; /* informs the fileserver to update the volume headers. */
+#endif
+ tv = VAttachVolumeByName_retry(&error, pname, volname, mode);
+ }
+
if (error) {
Log("1 Volser: GetVolInfo: Could not attach volume %u (%s:%s) error=%d\n",
volumeId, pname, volname, error);
* -- tkeiser 11/28/2007
*/
- if (tv->header->diskstuff.destroyMe == DESTROY_ME) {
+ if (V_destroyMe(tv) == DESTROY_ME) {
switch (mode) {
case VOL_INFO_LIST_MULTIPLE:
code = -2;
}
}
- if (tv->header->diskstuff.needsSalvaged) {
+ if (V_needsSalvaged(tv)) {
/*this volume will be salvaged */
Log("1 Volser: GetVolInfo: Volume %u (%s:%s) needs to be salvaged\n",
volumeId, pname, volname);
int code;
volint_info_handle_t handle;
- volumeInfo->volEntries_val = (volintInfo *) malloc(sizeof(volintInfo));
+ volumeInfo->volEntries_val = calloc(1, sizeof(volintInfo));
if (!volumeInfo->volEntries_val)
return ENOMEM;
- memset(volumeInfo->volEntries_val, 0, sizeof(volintInfo)); /* Clear structure */
volumeInfo->volEntries_len = 1;
if (GetPartName(partid, pname))
if (dirp == NULL)
return VOLSERILLEGAL_PARTITION;
- strcpy(volname, "");
-
- while (strcmp(volname, "EOD") && !found) { /*while there are more volumes in the partition */
-
- if (!strcmp(volname, "")) { /* its not a volume, fetch next file */
- GetNextVol(dirp, volname, &volid);
- continue; /*back to while loop */
- }
-
+ while (GetNextVol(dirp, volname, &volid)) {
if (volid == volumeId) { /*copy other things too */
found = 1;
break;
}
-
- GetNextVol(dirp, volname, &volid);
}
if (found) {
}
closedir(dirp);
- return (found) ? 0 : ENODEV;
+ if (found)
+ return code ? ENODEV: 0;
+ else
+ return ENODEV;
}
/*------------------------------------------------------------------------
* Set up our pointers for action, marking our structure to hold exactly
* one entry. Also, assume we'll fail in our quest.
*/
- a_volumeXInfoP->volXEntries_val =
- (volintXInfo *) malloc(sizeof(volintXInfo));
+ a_volumeXInfoP->volXEntries_val = calloc(1, sizeof(volintXInfo));
if (!a_volumeXInfoP->volXEntries_val)
return ENOMEM;
- memset(a_volumeXInfoP->volXEntries_val, 0, sizeof(volintXInfo)); /* Clear structure */
a_volumeXInfoP->volXEntries_len = 1;
code = ENODEV;
if (dirp == NULL)
return (VOLSERILLEGAL_PARTITION);
- strcpy(volname, "");
/*
* Sweep through the partition directory, looking for the desired entry.
* First, of course, figure out how many stat bytes to copy out of each
* volume.
*/
- while (strcmp(volname, "EOD") && !found) {
- /*
- * If this is not a volume, move on to the next entry in the
- * partition's directory.
- */
- if (!strcmp(volname, "")) {
- GetNextVol(dirp, volname, &currVolID);
- continue;
- }
-
+ while (GetNextVol(dirp, volname, &currVolID)) {
if (currVolID == a_volID) {
/*
* We found the volume entry we're interested. Pull out the
found = 1;
break;
} /*Found desired volume */
-
- GetNextVol(dirp, volname, &currVolID);
}
if (found) {
* return the proper value.
*/
closedir(dirp);
- return (found) ? 0 : ENODEV;
+ if (found)
+ return code ? ENODEV: 0;
+ else
+ return ENODEV;
} /*SAFSVolXListOneVolume */
/*returns all the volumes on partition partid. If flags = 1 then all the
int code;
volint_info_handle_t handle;
- volumeInfo->volEntries_val =
- (volintInfo *) malloc(allocSize * sizeof(volintInfo));
+ volumeInfo->volEntries_val = calloc(allocSize, sizeof(volintInfo));
if (!volumeInfo->volEntries_val)
return ENOMEM;
- memset(volumeInfo->volEntries_val, 0, sizeof(volintInfo)); /* Clear structure */
pntr = volumeInfo->volEntries_val;
volumeInfo->volEntries_len = 0;
dirp = opendir(VPartitionPath(partP));
if (dirp == NULL)
return VOLSERILLEGAL_PARTITION;
- strcpy(volname, "");
-
- while (strcmp(volname, "EOD")) { /*while there are more partitions in the partition */
-
- if (!strcmp(volname, "")) { /* its not a volume, fetch next file */
- GetNextVol(dirp, volname, &volid);
- continue; /*back to while loop */
- }
+ while (GetNextVol(dirp, volname, &volid)) {
if (flags) { /*copy other things too */
#ifndef AFS_PTHREAD_ENV
IOMGR_Poll(); /*make sure that the client does not time out */
volname,
&handle,
VOL_INFO_LIST_MULTIPLE);
- if (code == -2) { /* DESTROY_ME flag set */
- goto drop2;
- }
+ if (code == -2) /* DESTROY_ME flag set */
+ continue;
} else {
pntr->volid = volid;
/*just volids are needed */
if ((allocSize - volumeInfo->volEntries_len) < 5) {
/*running out of space, allocate more space */
allocSize = (allocSize * 3) / 2;
- pntr =
- (volintInfo *) realloc((char *)volumeInfo->volEntries_val,
- allocSize * sizeof(volintInfo));
+ pntr = realloc(volumeInfo->volEntries_val,
+ allocSize * sizeof(volintInfo));
if (pntr == NULL) {
closedir(dirp);
return VOLSERNO_MEMORY;
volumeInfo->volEntries_val = pntr; /* point to new block */
/* set pntr to the right position */
pntr = volumeInfo->volEntries_val + volumeInfo->volEntries_len;
-
}
-
- drop2:
- GetNextVol(dirp, volname, &volid);
-
}
closedir(dirp);
* Allocate a large array of extended volume info structures, then
* set it up for action.
*/
- a_volumeXInfoP->volXEntries_val =
- (volintXInfo *) malloc(allocSize * sizeof(volintXInfo));
+ a_volumeXInfoP->volXEntries_val = calloc(allocSize, sizeof(volintXInfo));
if (!a_volumeXInfoP->volXEntries_val)
return ENOMEM;
- memset(a_volumeXInfoP->volXEntries_val, 0, sizeof(volintXInfo)); /* Clear structure */
xInfoP = a_volumeXInfoP->volXEntries_val;
a_volumeXInfoP->volXEntries_len = 0;
dirp = opendir(VPartitionPath(partP));
if (dirp == NULL)
return (VOLSERILLEGAL_PARTITION);
- strcpy(volname, "");
-
- /*
- * Sweep through the partition directory, acting on each entry. First,
- * of course, figure out how many stat bytes to copy out of each volume.
- */
- while (strcmp(volname, "EOD")) {
-
- /*
- * If this is not a volume, move on to the next entry in the
- * partition's directory.
- */
- if (!strcmp(volname, "")) {
- GetNextVol(dirp, volname, &volid);
- continue;
- }
-
+ while (GetNextVol(dirp, volname, &volid)) {
if (a_flags) {
/*
* Full info about the volume desired. Poll to make sure the
volname,
&handle,
VOL_INFO_LIST_MULTIPLE);
- if (code == -2) { /* DESTROY_ME flag set */
- goto drop2;
- }
+ if (code == -2) /* DESTROY_ME flag set */
+ continue;
} else {
/*
* Just volume IDs are needed.
a_volumeXInfoP->volXEntries_val +
a_volumeXInfoP->volXEntries_len;
}
-
- drop2:
- GetNextVol(dirp, volname, &volid);
- } /*Sweep through the partition directory */
+ }
/*
* We've examined all entries in the partition directory. Close it,
struct volser_trans *tt, *nt, *allTrans;
transInfo->transDebugEntries_val =
- (transDebugInfo *) malloc(allocSize * sizeof(transDebugInfo));
+ malloc(allocSize * sizeof(transDebugInfo));
if (!transInfo->transDebugEntries_val)
return ENOMEM;
pntr = transInfo->transDebugEntries_val;
pntr->callValid = 0;
if (tt->rxCallPtr) { /*record call related info */
pntr->callValid = 1;
+#if 0
pntr->readNext = tt->rxCallPtr->rnext;
pntr->transmitNext = tt->rxCallPtr->tnext;
pntr->lastSendTime = tt->rxCallPtr->lastSendTime;
pntr->lastReceiveTime = tt->rxCallPtr->lastReceiveTime;
+#endif
}
VTRANS_OBJ_UNLOCK(tt);
pntr++;
transInfo->transDebugEntries_len += 1;
if ((allocSize - transInfo->transDebugEntries_len) < 5) { /*alloc some more space */
allocSize = (allocSize * 3) / 2;
- pntr =
- (transDebugInfo *) realloc((char *)transInfo->
- transDebugEntries_val,
- allocSize *
- sizeof(transDebugInfo));
+ pntr = realloc(transInfo->transDebugEntries_val,
+ allocSize * sizeof(transDebugInfo));
transInfo->transDebugEntries_val = pntr;
pntr =
transInfo->transDebugEntries_val +
dirp = opendir(VPartitionPath(partP));
if (dirp == NULL)
return VOLSERILLEGAL_PARTITION;
- strcpy(volname, "");
ttc = (struct volser_trans *)0;
- while (strcmp(volname, "EOD")) {
- if (!strcmp(volname, "")) { /* its not a volume, fetch next file */
- GetNextVol(dirp, volname, &volid);
- continue; /*back to while loop */
- }
-
+ while (GetNextVol(dirp, volname, &volid)) {
if (volid == volumeId) { /*copy other things too */
#ifndef AFS_PTHREAD_ENV
IOMGR_Poll(); /*make sure that the client doesnot time out */
#endif
break;
}
- GetNextVol(dirp, volname, &volid);
}
if (ttc) {