Skip to content

Commit

Permalink
Increase MAXDSCB and allow cmdline override:
Browse files Browse the repository at this point in the history
  • Loading branch information
Fish-Git committed May 20, 2023
1 parent d3b743c commit 8f6ccf2
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 24 deletions.
67 changes: 48 additions & 19 deletions dasdload2.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
/*-------------------------------------------------------------------*/
/* Internal table sizes */
/*-------------------------------------------------------------------*/
#define MAXDBLK 10000 /* Maximum number of directory
#define DEF_MAXDBLK 10000 /* Maximum number of directory
blocks per dataset */
#define MAXTTR 50000 /* Maximum number of TTRs
#define DEF_MAXTTR 50000 /* Maximum number of TTRs
per dataset */
#define MAXDSCB 1000 /* Maximum number of DSCBs */
#define DEF_MAXDSCB 5000 /* Maximum number of DSCBs */

/*-------------------------------------------------------------------*/
/* Internal macro definitions */
Expand Down Expand Up @@ -109,8 +109,13 @@ BYTE cvol_low_key[] = {0, 0, 0, 0, 0, 0, 0, 1};

/* Information message level: 0=None, 1=File name, 2=File information,
3=Member information, 4=Text units, record headers, 5=Dump data */

int infolvl = 1;

int nMaxDBLK = DEF_MAXDBLK;
int nMaxTTR = DEF_MAXTTR;
int nMaxDSCB = DEF_MAXDSCB;

/*-------------------------------------------------------------------*/
/* Subroutine to display command syntax and exit */
/*-------------------------------------------------------------------*/
Expand Down Expand Up @@ -992,10 +997,10 @@ time_t timeval; /* Current time value */
}

/* Check that there is room in the DSCB pointer array */
if (dscbnum >= MAXDSCB)
if (dscbnum >= nMaxDSCB)
{
// "Internal error: DSCB count exceeds MAXDSCB of %d"
XMERRF ( MSG( HHC02518, "E", MAXDSCB ) );
XMERRF ( MSG( HHC02518, "E", nMaxDSCB ) );
return -1;
}

Expand Down Expand Up @@ -1104,10 +1109,10 @@ int tolfact; /* Device tolerance */
}

/* Check that there is room in the DSCB pointer array */
if (dscbnum >= MAXDSCB)
if (dscbnum >= nMaxDSCB)
{
// "Internal error: DSCB count exceeds MAXDSCB of %d"
XMERRF ( MSG( HHC02518, "E", MAXDSCB ) );
XMERRF ( MSG( HHC02518, "E", nMaxDSCB ) );
return -1;
}

Expand Down Expand Up @@ -1178,10 +1183,10 @@ int blklen; /* Size of data block */
}

/* Check that there is room in the DSCB pointer array */
if (dscbnum >= MAXDSCB)
if (dscbnum >= nMaxDSCB)
{
// "Internal error: DSCB count exceeds MAXDSCB of %d"
XMERRF ( MSG( HHC02518, "E", MAXDSCB ) );
XMERRF ( MSG( HHC02518, "E", nMaxDSCB ) );
return -1;
}

Expand Down Expand Up @@ -2185,10 +2190,10 @@ char hex[49]; /* Character work areas */
memcpy (blkp, xbuf, blklen);

/* Check that there is room in the directory block pointer array */
if (dirblkn >= MAXDBLK)
if (dirblkn >= nMaxDBLK)
{
// "Internal error: Number of directory blocks exceeds MAXDBLK of %d"
XMERRF ( MSG( HHC02545, "E", MAXDBLK ) );
XMERRF ( MSG( HHC02545, "E", nMaxDBLK ) );
return -1;
}

Expand Down Expand Up @@ -2682,7 +2687,7 @@ char pathname[MAX_PATH]; /* xfname in host path format*/
}

/* Obtain storage for the directory block array */
dirblka = (DATABLK**)malloc (sizeof(DATABLK*) * MAXDBLK);
dirblka = (DATABLK**)malloc (sizeof(DATABLK*) * nMaxDBLK);
if (dirblka == NULL)
{
// "Storage allocation for %s using %s failed: %s"
Expand All @@ -2693,7 +2698,7 @@ char pathname[MAX_PATH]; /* xfname in host path format*/
}

/* Obtain storage for the TTR conversion table */
ttrtab = (TTRCONV*)malloc (sizeof(TTRCONV) * MAXTTR);
ttrtab = (TTRCONV*)malloc (sizeof(TTRCONV) * nMaxTTR);
if (ttrtab == NULL)
{
// "Storage allocation for %s using %s failed: %s"
Expand Down Expand Up @@ -2861,10 +2866,10 @@ char pathname[MAX_PATH]; /* xfname in host path format*/
else /* Not a directory block */
{
/* Check that TTR conversion table is not full */
if (numttr >= MAXTTR)
if (numttr >= nMaxTTR)
{
// "Internal error: TTR count exceeds MAXTTR of %d"
XMERRF ( MSG( HHC02571, "E", MAXTTR ) );
XMERRF ( MSG( HHC02571, "E", nMaxTTR ) );
return -1;
}

Expand Down Expand Up @@ -4089,7 +4094,7 @@ int offset = 0; /* Offset into trkbuf */
int fsflag = 0; /* 1=Free space message sent */

/* Obtain storage for the array of DSCB pointers */
dscbtab = (DATABLK**)malloc (sizeof(DATABLK*) * MAXDSCB);
dscbtab = (DATABLK**)malloc (sizeof(DATABLK*) * nMaxDSCB);
if (dscbtab == NULL)
{
// "Storage allocation for %s using %s failed: %s"
Expand Down Expand Up @@ -4406,7 +4411,7 @@ char *strtok_str = NULL; /* last token position */
}

/* Check the number of arguments */
if (argc < 3 || argc > 4)
if (argc < 3 || argc > 7)
argexit(4, pgm);

/* The first argument is the control file name */
Expand All @@ -4422,9 +4427,33 @@ char *strtok_str = NULL; /* last token position */
/* The optional third argument is the message level */
if (argc > 3 && argv[3] != NULL)
{
if (sscanf(argv[3], "%u%c", &infolvl, &c) != 1
|| infolvl > 5)
if (sscanf(argv[3], "%u%c", &infolvl, &c) != 1 || infolvl > 5)
argexit(3, pgm);

/* The optional forth argument is the maximum number of DBLK entries */
if (argc > 4 && argv[4] != NULL)
{
if (sscanf( argv[4], "%u%c", &nMaxDBLK, &c) != 1 || nMaxDBLK < 0)
argexit(5, pgm);

/* The optional fifth argument is the maximum number of TTR entries */
if (argc > 5 && argv[5] != NULL)
{
if (sscanf( argv[5], "%u%c", &nMaxTTR, &c) != 1 || nMaxTTR < 0)
argexit(5, pgm);

/* The optional sixth argument is the maximum number of DSCB entries */
if (argc > 6 && argv[6] != NULL)
{
if (sscanf( argv[6], "%u%c", &nMaxDSCB, &c) != 1 || nMaxDSCB < 0)
argexit(5, pgm);
}
}
}

if (!nMaxDBLK) nMaxDBLK = DEF_MAXDBLK;
if (!nMaxTTR ) nMaxTTR = DEF_MAXTTR;
if (!nMaxDSCB) nMaxDSCB = DEF_MAXDSCB;
}

/* Open the control file */
Expand Down
14 changes: 11 additions & 3 deletions html/hercload.html
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@ <h3>dasdload / dasdload64</h3>
PDS files.
<p>
The format of the dasdload / dasdload64 command is:
<p> &nbsp; &nbsp; &nbsp; &nbsp; <code>dasdload &nbsp;&nbsp;<i>[options]</i> <em>ctlfile outfile msglevel</em></code><br>
&nbsp; &nbsp; &nbsp; &nbsp; <code>dasdload64 <i>[options]</i> <em>ctlfile outfile msglevel</em></code>
<p> &nbsp; &nbsp; &nbsp; &nbsp; <code>dasdload &nbsp;&nbsp;<i>[options]</i> <em>ctlfile outfile <i>[msglevel [maxdblk maxttr maxdscb]]</i></em></code><br>
&nbsp; &nbsp; &nbsp; &nbsp; <code>dasdload64 <i>[options]</i> <em>ctlfile outfile <i>[msglevel [maxdblk maxttr maxdscb]]</i></em></code>
<p>
where <em>[options]</em> can be:
<blockquote>
Expand All @@ -368,14 +368,22 @@ <h3>dasdload / dasdload64</h3>
<dd>For a volume without IPL text, make the wait PSW written to the IPL1
record enabled for machine checks. The default is to make the wait
PSW disabled for machine checks.</dd>
<p>
<dt><code><em>ctlfile</em></code>
<dd>is the name of the control file which specifies the datasets
that are to be loaded onto the newly-created volume
<dt><code><em>outfile</em></code>
<dd>is the name of the DASD image file to be created
<p>
<dt><code><em>msglevel</em></code>
<dd>is a number from 0 to 5 which controls the level of detail
<dd>is an optional number from 0 to 5 (default is 1) which controls the level of detail
of the messages issued during the load.
<dt><code><em>maxdblk</em></code>
<dd>is the optional maximum number of DBLK table entries or 0 to use the default
<dt><code><em>maxttr</em></code>
<dd>is the optional maximum number of TTR table entries or 0 to use the default
<dt><code><em>maxdscb</em></code>
<dd>is the optional maximum number of DSCB table entries or 0 to use the default
</dl>
</blockquote>

Expand Down
6 changes: 4 additions & 2 deletions msgenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -1799,7 +1799,7 @@ LOGM_DLL_IMPORT int panel_command_capture( char* cmd, char** resp, bool quiet )
"HHC02495I -1 normal checking\n" \
"HHC02495I -2 intermediate checking\n" \
"HHC02495I -3 maximal checking"
#define HHC02496 "Usage: %s [options] ctlfile outfile [n]\n" \
#define HHC02496 "Usage: %s [options] ctlfile outfile [n [maxdblk maxttr maxdscb]]\n" \
"HHC02496I options:\n" \
"HHC02496I -0 no compression (default)\n" \
"HHC02496I -a output disk will include alternate cylinders\n" \
Expand All @@ -1811,7 +1811,9 @@ LOGM_DLL_IMPORT int panel_command_capture( char* cmd, char** resp, bool quiet )
"HHC02496I\n" \
"HHC02496I ctlfile name of input control file\n" \
"HHC02496I outfile name of DASD image file to be created\n" \
"HHC02496I n msglevel 'n' is a digit 0 - 5 indicating output verbosity"
"HHC02496I\n" \
"HHC02496I n 'n' is a digit 0 - 5 (default is 1) indicating output verbosity\n" \
"HHC02496I max... 'maxdblk', etc, is maximum number of DBLK/TTR/DSCB entries or 0 for default"
#define HHC02497 "Usage: %s [-f] [-level] file1 [file2 ... ]\n" \
"HHC02497I file name of CCKD file\n" \
"HHC02497I Options:\n" \
Expand Down

0 comments on commit 8f6ccf2

Please sign in to comment.