/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
- *
+ *
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
#include <afsconfig.h>
#include <afs/param.h>
+#include <roken.h>
#include <afs/stds.h>
#if defined(AFS_LINUX24_ENV)
static int DBLookupByVolume(char *volumeName);
int
-bc_EvalVolumeSet(struct bc_config *aconfig,
- struct bc_volumeSet *avs,
- struct bc_volumeDump **avols,
+bc_EvalVolumeSet(struct bc_config *aconfig,
+ struct bc_volumeSet *avs,
+ struct bc_volumeDump **avols,
struct ubik_client *uclient)
{ /*bc_EvalVolumeSet */
int code = -1;
};
afs_int32
-getSPEntries(afs_uint32 server, afs_int32 partition,
- struct serversort **serverlist,
- struct serversort **ss,
+getSPEntries(afs_uint32 server, afs_int32 partition,
+ struct serversort **serverlist,
+ struct serversort **ss,
struct partitionsort **ps)
{
if (!(*ss) || ((*ss)->ipaddr != server)) {
}
afs_int32
-randSPEntries(struct serversort *serverlist,
+randSPEntries(struct serversort *serverlist,
struct bc_volumeDump **avols)
{
struct serversort *ss, **pss;
}
static int
-EvalVolumeSet2(struct bc_config *aconfig,
- struct bc_volumeSet *avs,
- struct bc_volumeDump **avols,
+EvalVolumeSet2(struct bc_config *aconfig,
+ struct bc_volumeSet *avs,
+ struct bc_volumeDump **avols,
struct ubik_client *uclient)
{ /*EvalVolumeSet2 */
struct bc_volumeEntry *tve;
/* For each of the volume set entries - collect the volumes that match it */
for (tve = avs->ventries; tve; tve = tve->next) {
- /* Put together a call to the vlserver for this vlentry. The
+ /* Put together a call to the vlserver for this vlentry. The
* performance gain is from letting the vlserver expand the
* volumeset and not this routine.
*/
if (nentries == 0)
ERROR(RXGEN_OPCODE); /* Use EvalVolumeSet1 */
+ if (nentries < 0)
+ nentries = 0;
+ if (nentries > bulkentries.nbulkentries_len)
+ nentries = bulkentries.nbulkentries_len;
+
/* Step through each entry and add it to the list of volumes */
entries = bulkentries.nbulkentries_val;
for (e = 0; e < nentries; e++) {
* EvalVolumeSetOld
*
* Description:
- * Takes the entries in a volumeset and expands them into a list of
+ * Takes the entries in a volumeset and expands them into a list of
* volumes. Every VLDB volume entry is looked at and compared to the
* volumeset entries.
*
- * When matching a VLDB volume entry to a volumeset entry,
+ * When matching a VLDB volume entry to a volumeset entry,
* 1. If the RW volume entry matches, that RW volume is used.
* 2. Otherwise, if the BK volume entry matches, the BK volume is used.
* 3. Finally, if the RO volume entry matches, the RO volume is used.
- * For instance: A volumeset entry of ".* .* user.t.*" will match volume
- * "user.troy" and "user.troy.backup". The rules will use
+ * For instance: A volumeset entry of ".* .* user.t.*" will match volume
+ * "user.troy" and "user.troy.backup". The rules will use
* the RW volume "user.troy".
*
* When a VLDB volume entry matches a volumeset entry (be it RW, BK or RO),
- * that volume is used and matches against any remaining volumeset entries
+ * that volume is used and matches against any remaining volumeset entries
* are not even done.
* For instance: A 1st volumeset entry ".* .* .*.backup" will match with
- * "user.troy.backup". Its 2nd volumeset entry ".* .* .*"
- * would have matched its RW volume "user.troy", but the first
+ * "user.troy.backup". Its 2nd volumeset entry ".* .* .*"
+ * would have matched its RW volume "user.troy", but the first
* match is used and the second match isn't even done.
*
* Arguments:
* aconfig : Global configuration info.
- * avs :
+ * avs :
* avols : Ptr to linked list of entries describing volumes to dump.
* uclient : Ptr to Ubik client structure.
*
*-----------------------------------------------------------------------------
*/
static int
-EvalVolumeSet1(struct bc_config *aconfig,
+EvalVolumeSet1(struct bc_config *aconfig,
struct bc_volumeSet *avs,
- struct bc_volumeDump **avols,
+ struct bc_volumeDump **avols,
struct ubik_client *uclient)
{ /*EvalVolumeSet1 */
afs_int32 code; /*Result of various calls */
}
}
- /* If the BK name matches the volume set entry, take
+ /* If the BK name matches the volume set entry, take
* it and exit. Second choice is to use the BK volume.
*/
if (entry.flags & BACK_EXISTS) {
}
/* concatParams
- *
+ *
* Concatenates the parameters of an option and returns the string.
*
*/
/* printIfStatus
* print out an interface status node as received from butc
*/
-
+
void
printIfStatus(struct tciStatusS *statusPtr)
{
}
}
- /*
+ /*
* Now print the scheduled dumps.
*/
if (!dlqEmpty(&statusHead) && as)
}
statusPtr->flags |= ABORT_REQUEST;
unlock_Status();
- return (0);
}
return 0;
}
oldFlag = 0;
/* Read all the port offsets into the ports array. The first element in the
- * array is for full restore and the rest are for incremental restores
+ * array is for full restore and the rest are for incremental restores
*/
if (as->parms[5].items) {
for (ti = as->parms[5].items; ti; ti = ti->next)
if (dumpID <= 0)
dumpID = 0;
}
-
+
/*
* Perform the call to start the restore.
*/
/* parm 0 is the server to restore
* parm 1 is the partition to restore
-
+
* parm 8 and above as in VolRestoreCmd:
* parm 8 is the new server to restore to
* parm 9 is the new partition to restore to
return (-1);
}
- /* Since we want only RW volumes, remove any
+ /* Since we want only RW volumes, remove any
* BK or RO volumes from the list.
*/
for (prev = 0, tvol = volsToRestore; tvol; tvol = nextvol) {
afs_int32 problemFindingDump; /* can't find parent(s) */
afs_int32 *portp = NULL;
- afs_int32 portCount = 0;
afs_int32 doAt, atTime; /* Time a timed-dump is to start at */
afs_int32 length;
char *timeString;
return (code);
}
- /*
+ /*
* Some parameters cannot be specified together
- * The "-file" option cannot exist with the "-volume", "-dump",
- * "-portoffset", or "-append" option
+ * The "-file" option cannot exist with the "-volume", "-dump",
+ * "-portoffset", or "-append" option
*/
if (as->parms[6].items) {
loadfile = 1;
}
}
- /*
+ /*
* Get the time we are to perform this dump
*/
if (as->parms[3].items) {
dontExecute = (as->parms[5].items ? 1 : 0); /* -n */
- /*
+ /*
* If this dump is not a load file, then check the parameters.
*/
if (!loadfile) { /*6 */
/* get the port number, if one was specified */
if (as->parms[2].items) {
- portCount = 1;
portp = (afs_int32 *) malloc(sizeof(afs_int32));
if (!portp) {
afs_com_err(whoami, BC_NOMEM, NULL);
/*6 */
/*
- * If given the "-at" option, then add this to the jobs list and return
+ * If given the "-at" option, then add this to the jobs list and return
* with no error.
*
* Create a status node for this timed dump.
* Fill in the time to dump and the cmd line for the dump leaving off
- * the -at option. If the -n option is there, it is scheduled with
+ * the -at option. If the -n option is there, it is scheduled with
* the Timed dump as opposed to not scheduling the time dump at all.
*/
if (doAt) {
return (0);
}
- /*
+ /*
* Read and execute the load file if specified. The work of reading is done
* in the main routine prior the dispatch call. loadFile and dontExecute are
* global variables so this can take place in main.
return 0;
}
- /*
+ /*
* We are doing a real dump (no load file or timed dump).
*/
printf("Starting dump of volume set '%s' (dump level '%s')\n", vsName,
}
/* We found the most recent dump at this level. Now check
- * if we should use it by seeing if its full dump hierarchy
+ * if we should use it by seeing if its full dump hierarchy
* exists. If it doesn't, we don't want to base our incremental
- * off of this dump.
+ * off of this dump.
*/
if (!parent || (dumpEntry.id > parent)) {
/* Follow the parent dumps to see if they are all there */
}
}
- /* If the problemflag was raise, it means we are not doing the
+ /* If the problemflag was raise, it means we are not doing the
* dump at the level we requested it be done at.
*/
if (problemFindingDump) {
*/
afs_int32
-bc_ParseExpiration(struct cmd_parmdesc *paramPtr, afs_int32 *expType,
+bc_ParseExpiration(struct cmd_parmdesc *paramPtr, afs_int32 *expType,
afs_int32 *expDate)
{
struct cmd_item *itemPtr;
/* If dump is to an XBSA server, connect to butc and send it
* the dump to delete. Butc will contact the XBSA server.
- * The dump will not be an appended dump because XBSA butc
+ * The dump will not be an appended dump because XBSA butc
* does not support the append option.
*/
if (xbsadump && dumpEntry.nVolumes) {
}
/* ----------------------------------
- * supporting routines for database examination
+ * supporting routines for database examination
* ----------------------------------
*/
return (code);
}
-/* bc_dumpInfoCmd
+/* bc_dumpInfoCmd
* list the dumps and contens of the dumps.
* params:
* as - name of tape