callerAddress(acid, buffer), newName);
}
error = 0;
- originalvp = (Volume *) 0;
purgevp = (Volume *) 0;
newvp = (Volume *) 0;
tt = ttc = (struct volser_trans *)0;
}
error = 0;
clonevp = originalvp = (Volume *) 0;
- tt = (struct volser_trans *)0;
tt = FindTrans(atrans);
if (!tt)
if (!afsconf_SuperUser(tdir, acid, caller))
return VOLSERBAD_ACCESS; /*not a super user */
- /* initialize things */
- tcon = (struct rx_connection *)0;
- tt = (struct volser_trans *)0;
/* find the local transaction */
tt = FindTrans(fromTrans);
TRELE(tt);
return ENOENT;
}
+ if (DoLogging) {
+ char buffer[16];
+ Log("%s on %s is executing Restore %" AFS_VOLID_FMT "\n", caller,
+ callerAddress(acid, buffer), afs_printable_VolumeId_lu(tt->volid));
+ }
TSetRxCall(tt, acid, "Restore");
DFlushVolume(V_parentId(tt->volume)); /* Ensure dir buffers get dropped */
pEntries->partEntries_val = malloc(j * sizeof(int));
if (!pEntries->partEntries_val)
return ENOMEM;
- memcpy((char *)pEntries->partEntries_val, (char *)&partList,
+ memcpy(pEntries->partEntries_val, partList.partId,
j * sizeof(int));
pEntries->partEntries_len = j;
} else {
ttc = NewTrans(volumeId, partId);
if (!ttc) {
code = -3;
- VOLINT_INFO_STORE(handle, status, VOLSERVOLBUSY);
+ VOLINT_INFO_STORE(handle, status, VBUSY);
VOLINT_INFO_STORE(handle, volid, volumeId);
goto drop;
}
DIR *dirp;
VolumeId volid;
int found = 0;
- int code;
volint_info_handle_t handle;
volumeInfo->volEntries_val = calloc(1, sizeof(volintInfo));
handle.volinfo_type = VOLINT_INFO_TYPE_BASE;
handle.volinfo_ptr.base = volumeInfo->volEntries_val;
- code = GetVolInfo(partid,
- volid,
- pname,
- volname,
- &handle,
- VOL_INFO_LIST_SINGLE);
+ /* The return code from GetVolInfo is ignored; there is no error from
+ * it that results in the whole call being aborted. Any volume
+ * attachment failures are reported in 'status' field in the
+ * volumeInfo payload. */
+ GetVolInfo(partid,
+ volid,
+ pname,
+ volname,
+ &handle,
+ VOL_INFO_LIST_SINGLE);
}
closedir(dirp);
- if (found)
- return code ? ENODEV: 0;
- else
- return ENODEV;
+ return (found) ? 0 : ENODEV;
}
/*------------------------------------------------------------------------
DIR *dirp; /*Partition directory ptr */
VolumeId currVolID; /*Current volume ID */
int found = 0; /*Did we find the volume we need? */
- int code;
volint_info_handle_t handle;
/*
return ENOMEM;
a_volumeXInfoP->volXEntries_len = 1;
- code = ENODEV;
/*
* If the partition name we've been given is bad, bogue out.
handle.volinfo_type = VOLINT_INFO_TYPE_EXT;
handle.volinfo_ptr.ext = a_volumeXInfoP->volXEntries_val;
- code = GetVolInfo(a_partID,
- a_volID,
- pname,
- volname,
- &handle,
- VOL_INFO_LIST_SINGLE);
-
+ /* The return code from GetVolInfo is ignored; there is no error from
+ * it that results in the whole call being aborted. Any volume
+ * attachment failures are reported in 'status' field in the
+ * volumeInfo payload. */
+ GetVolInfo(a_partID,
+ a_volID,
+ pname,
+ volname,
+ &handle,
+ VOL_INFO_LIST_SINGLE);
}
/*
* return the proper value.
*/
closedir(dirp);
- if (found)
- return code ? ENODEV: 0;
- else
- return ENODEV;
+ return (found) ? 0 : ENODEV;
} /*SAFSVolXListOneVolume */
/*returns all the volumes on partition partid. If flags = 1 then all the
}
}
- if (ttc) {
+ if (ttc)
DeleteTrans(ttc, 1);
- ttc = (struct volser_trans *)0;
- }
closedir(dirp);
return ret;