/* **++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ** Copyright (C) 1993 by ** DIGITAL EQUIPMENT CORPORATION, Maynard, MA. ** ** This software is furnished under a license and may be used and copied ** only in accordance with the terms of such license and with the inclusion ** of the above copyright notice. This software or any other copies there- ** of may not be provided or otherwise made available to any other person. ** No title to and ownership of the software is hereby transferred. ** ** The information in this software is subject to change without notice ** and should not be construed as a commitment by DIGITAL EQUIPMENT ** CORPORATION. ** ** DIGITAL assumes no responsibility for the use or reliability of its ** software on equipment which is not supplied by DIGITAL. **------------------------------------------------------------------------ */ /* **++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ** FACILITY: DISKMOUNT ** ** MODULE DESCRIPTION: ** ** Include file for DISKMOUNT parent and child processes. Includes ** common definitions, build procedure, installation and use, etc. ** ** AUTHORS: ** ** Philip Dickerson (with much assistance from the VAXC Notes ** conference and individuals within Digital) ** ** CREATION DATE: March, 1992 ** ** MODIFICATION HISTORY: ** ** March,1992 P. Dickerson ??? ** ** 3 Joseph A. Dziedzic 20-Sep-1993 ** Final cleanup of comments, include some missing build and ** operational info. ** ** 2 Joseph A. Dziedzic 6-Jul-1993 ** Clean up comments, add build information & warnings. ** **------------------------------------------------------------------------ */ /* **++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ** ** Introduction: ** ** DISKMOUNT is a prototype program which is being supplied by VMS ** Engineering. This program can be used to speed up disk mounts ** at system start-up time (and consequently reduce the time required ** for system start-up). DISKMOUNT is being provided to our customers ** who may wish to use it as a base for their own development. ** ** DISKMOUNT achieves this speedup by bypassing the image activation ** time associated with the MOUNT image (direct calls to the $MOUNT ** system service are used instead). Internal testing has shown a ** significant speedup associated with this method. This example program ** does NOT support mounting of disks connected to an Infoserver, disks ** served via DFS, or stripe sets. ** ** DISKMOUNT is designed around a "parent" process which communicates ** with several "child" processes. When run, the parent process reads ** an ASCII data file which contains records describing the disk volumes ** to be mounted. As each record is processed, the information is passed ** to a child sub-process. The child sub-process performs the $MOUNT system ** service and then communicates the results back to the parent. The format ** of the database is defined in the source file DISKMOUNT.C, and also in ** the command procedure DISKMOUNT_CREATE_DAT.COM. ** ** Build Instructions: ** ** Copy the files DISKMOUNT.H, DISKMOUNT.C, and DISKMOUNT_CHILD.C to a ** directory, then define a logical name "SRC$" which points to this ** directory. Assemble DISKMOUNT.C and DISKMOUNT_CHILD.C, then LINK ** DISKMOUNT.OBJ and DISKMOUNT_CHILD.OBJ to produce DISKMOUNT.EXE and ** DISKMOUNT_CHILD.EXE. These executables should then be copied to a ** directory (SYS$MANAGER: is suggested) on the target system. ** ** Sample build procedure: ** ** $ COPY SYS$EXAMPLES:DISKMOUNT.H, DISKMOUNT.C, DISKMOUNT_CHILD.C [] ** $ DEFINE SRC$ [] ** $ DEFINE LNK$LIBRARY SYS$LIBRARY:VAXCRTL ** $ CC DISKMOUNT ** $ CC DISKMOUNT_CHILD ** $ LINK DISKMOUNT ** $ LINK DISKMOUNT_CHILD ** ** Operation Instructions: ** ** To create the initial database file, execute the command procedure ** SYS$EXAMPLES:DISKMOUNT_CREATE_DAT.COM while logged in to the SYSTEM ** account. This procedure will create a database file named ** DISKMOUNT.NEW_DAT. Examine the contents of this file with a text editor ** to verify all disk volumes which are to be mounted at system start-up ** time are included. ** ** WARNING: Be sure that any disk volumes which contain PAGE or SWAP ** files are mounted PRIOR TO execution of DISKMOUNT! These volumes ** should be excluded from DISKMOUNT.NEW_DAT. ** ** Once you are satisfied with the contents of DISKMOUNT_NEW.DAT, rename ** the file to SYS$MANAGER:DISKMOUNT.DAT. ** ** Add a line to SYSTARTUP_VMS.COM (for example) to run DISKMOUNT.EXE. ** Again, be sure this occurs AFTER page and swap file volumes are mounted! ** ** DISKMOUNT optionally provides a command line interface. If a foreign ** command is defined (e.g., $ DISKMOUNT := $SYS$MANAGER:DISKMOUNT.EXE, ** assuming DISKMOUNT.EXE is located in SYS$MANAGER:), DISKMOUNT will ** accept switches to control the default operation. (See DISKMOUNT.C ** for details on the supported command line switches and options.) ** ** Required quotas: ** ** Because DISKMOUNT spawns four child sub-processes, you should ensure ** there are sufficient quotas associated with the parent account (SYSTEM) ** to create these sub-processes. Specific values will vary depending on ** the actual configuration; the Digital-supplied default values for the ** SYSTEM account should be adequate. ** */ /* **++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ** ** INCLUDE FILES ** **------------------------------------------------------------------------ */ #include /* Comm Lang Interface declarations */ #include /* Character Type Classification Macros */ #include /* Argument Descriptor Formats declarations */ #include /* DISMOUNT system service declarations */ #include /* Get Device Info declarations */ #include /* I/O function code declarations */ #include /* Logical Name declarations */ #include /* MOUNT system service declarations */ #include /* Processor Status Longword declarations */ #include /* System service completion codes */ #include /* UNIX 'Standard I/O' Definitions */ #include /* String status definitions */ #include /* String handling function definitions */ #include /* VMS_STATUS_SUCCESS */ #ifdef LAT #include "ladcp_clientdef.h" /* LADCP client declarations */ #include "ladcp_daddef.h" /* LADCP DAD driver declarations */ #endif #define COPYRIGHT_STR \ "\nCopyright (c) 1993 Digital Equipment Corporation. All rights reserved.\n" #define VERSION_STR "\n ** WARNING ** Prototype version: 21-September-1993\n" #define DATA_FILE "SYS$MANAGER:DISKMOUNT.DAT" #define OWNER_ONLY_ACCESS 0xFF0F #define IN_MBX_MAXMSG 1024 #define IN_MBX_BUFQUO 2048 #define OUT_MBX_MAXMSG 256 #define OUT_MBX_BUFQUO 512 #define MAX_ITEMS 64 /* arbitrary number, at present */ #define MAX_SUBPROCESSES 4 /* Must be <= 31 unless EFN mechanism is changed*/ #define STS_NOPATHSPEC 0x08008013 #define STS_PATHNOMATCH 0x08008020 #define STS_PATHNOTAVAIL 0x08008030 /* System service item list descriptor structure */ typedef struct { short buf_length; /* Buffer length - bytes */ short item_code; /* Item code */ void *buf_address; /* Buffer address */ short *ret_length; /* Address of actual length */ } ITMDSC; /* QIO status block structure */ typedef struct { unsigned short status; /* return status */ unsigned short count; /* byte transfer count */ int info; /* device dependent info */ } QIO_SB; /* QIO input buffer structure */ typedef struct { char buffer[IN_MBX_MAXMSG]; } IN_QIO_BUFFER; /* QIO output buffer structure */ typedef struct { char buffer[OUT_MBX_MAXMSG]; } OUT_QIO_BUFFER; /* Macro to initialize a system service item list item (ret len = 0) */ #define ITM_RET0_INIT(entry_, code_, buff_len_, buff_addr_) \ ( \ (entry_).buf_length = (buff_len_), \ (entry_).item_code = (code_), \ (entry_).buf_address = (buff_addr_), \ (entry_).ret_length = 0 \ ) /* Macro to initialize a system service item list item */ #define ITM_INIT(entry_, code_, buffer_, ret_len_addr_) \ ( \ (entry_).buf_length = sizeof (buffer_), \ (entry_).item_code = (code_), \ (entry_).buf_address = (void *)&(buffer_), \ (entry_).ret_length = (short *)&(ret_len_addr_) \ ) /* Macro to terminate a system service item list */ #define ITM_TERM(entry_) \ ( \ (entry_).buf_length = 0, \ (entry_).item_code = 0, \ (entry_).buf_address = 0, \ (entry_).ret_length = 0 \ ) /* Macro to initialize a descriptor */ #define DSC_INIT(dsc_, string_) \ ( \ (dsc_).dsc$w_length = strlen (string_), \ (dsc_).dsc$b_dtype = DSC$K_DTYPE_T, \ (dsc_).dsc$b_class = DSC$K_CLASS_S, \ (dsc_).dsc$a_pointer = (string_) \ ) /* Macro to initialize a descriptor */ #define DSC_INIT_BUF(dsc_, string_) \ ( \ (dsc_).dsc$w_length = sizeof (string_), \ (dsc_).dsc$b_dtype = DSC$K_DTYPE_T, \ (dsc_).dsc$b_class = DSC$K_CLASS_S, \ (dsc_).dsc$a_pointer = (string_) \ )