! *** PREDECLARED TYPES %IF %DECLARED ( %BASIC$QUADWORD_DECLARED ) = 0 %THEN RECORD BASIC$QUADWORD LONG FILL ( 2 ) END RECORD %LET %BASIC$QUADWORD_DECLARED = 1 %END %IF %IF %DECLARED ( %BASIC$OCTAWORD_DECLARED ) = 0 %THEN RECORD BASIC$OCTAWORD LONG FILL ( 4 ) END RECORD %LET %BASIC$OCTAWORD_DECLARED = 1 %END %IF %IF %DECLARED ( %BASIC$HFLOAT_AXP_DECLARED ) = 0 %THEN RECORD BASIC$HFLOAT_AXP LONG FILL ( 4 ) END RECORD %LET %BASIC$HFLOAT_AXP_DECLARED = 1 %END %IF %IF %DECLARED ( %BASIC$F_FLOATING_COMPLEX_DECL ) = 0 %THEN RECORD BASIC$F_FLOATING_COMPLEX SINGLE REAL_PART SINGLE IMAGINARY_PART END RECORD %LET %BASIC$F_FLOATING_COMPLEX_DECL = 1 %END %IF %IF %DECLARED ( %BASIC$D_FLOATING_COMPLEX_DECL ) = 0 %THEN RECORD BASIC$D_FLOATING_COMPLEX DOUBLE REAL_PART DOUBLE IMAGINARY_PART END RECORD %LET %BASIC$D_FLOATING_COMPLEX_DECL = 1 %END %IF %IF %DECLARED ( %BASIC$G_FLOATING_COMPLEX_DECL ) = 0 %THEN RECORD BASIC$G_FLOATING_COMPLEX GFLOAT REAL_PART GFLOAT IMAGINARY_PART END RECORD %LET %BASIC$G_FLOATING_COMPLEX_DECL = 1 %END %IF %IF %DECLARED ( %BASIC$H_FLOAT_AXP_CMPLX_DCL ) = 0 %THEN RECORD BASIC$H_FLOATING_COMPLEX_AXP BASIC$HFLOAT_AXP REAL_PART BASIC$HFLOAT_AXP IMAGINARY_PART END RECORD %LET %BASIC$H_FLOAT_AXP_CMPLX_DCL = 1 %END %IF ! ! item codes for sd$xxx calls ! DECLARE LONG CONSTANT SD$_MAJOR_ID = 1 ! longword (major ODS version number) DECLARE LONG CONSTANT SD$_MINOR_ID = 2 ! longword (minor ODS version number) DECLARE LONG CONSTANT SD$_POOL_ID = 3 ! UID (16 bytes) (Pool identifier) DECLARE LONG CONSTANT SD$_CREATION_DATE = 4 ! Date/time (8 bytes) (Date pool was created) DECLARE LONG CONSTANT SD$_MODIFIED_DATE = 5 ! Date/time (8 bytes) (Date pool membership was last changed) DECLARE LONG CONSTANT SD$_SEGMENT_SIZE = 6 ! longword (Size of segment in pool # blocks) DECLARE LONG CONSTANT SD$_MAX_UNITS = 7 ! longword (Maximum # members allowed in pool) DECLARE LONG CONSTANT SD$_UNIT_COUNT = 8 ! longword (Number of members currently in pool) DECLARE LONG CONSTANT SD$_POOL_OPTIONS = 9 ! longword (Pool flags) DECLARE LONG CONSTANT SD$_UNIT_ID = 10 ! UID (16 bytes) (Identifier of storage unit) DECLARE LONG CONSTANT SD$_UNIT_NUMBER = 11 ! longword (Storage unit number) DECLARE LONG CONSTANT SD$_UNIT_OPTIONS = 12 ! longword (Storage unit flags) DECLARE LONG CONSTANT SD$_SEQUENCE_NUMBER = 13 ! longword (Homeblock sequence number) DECLARE LONG CONSTANT SD$_HIGHEST_UNIT = 14 ! longword (Number of highest member in pool) DECLARE LONG CONSTANT SD$_LOWEST_UNIT = 15 ! longword (Number of lowest member in pool) DECLARE LONG CONSTANT SD$_TOTAL_SEGMENTS = 16 ! longword (Total # of segment in pool) DECLARE LONG CONSTANT SD$_FREE_SEGMENTS = 17 ! longword (Total # of free segments in pool) DECLARE LONG CONSTANT SD$_MAX_FAMILY = 18 ! longword (Maximum # of families allowed in pool) DECLARE LONG CONSTANT SD$_MAX_DISK = 19 ! longword (Maximum # members in a family) DECLARE LONG CONSTANT SD$_META_LBN = 20 ! longword (Start of SD metadata on member) DECLARE LONG CONSTANT SD$_META_SIZE = 21 ! longword (Size of SD metadata on member) DECLARE LONG CONSTANT SD$_DATA_LBN = 22 ! longword (Start of pool space on member) DECLARE LONG CONSTANT SD$_DATA_SIZE = 23 ! longword (Size of pool space on member) DECLARE LONG CONSTANT SD$_POOL_DEVICE = 24 ! character string (Name of pool device) DECLARE LONG CONSTANT SD$_FAMILY_NUMBER = 25 ! longword (Familiy number of a SnapDisk) DECLARE LONG CONSTANT SD$_MEMBER_NUMBER = 26 ! longword (Number within family of a SnapDisk) DECLARE LONG CONSTANT SD$_DISK_NAME = 27 ! character string (Name of SnapDisk) DECLARE LONG CONSTANT SD$_DISK_CAPACITY = 28 ! longword (Size/capacity of a SnapDisk) DECLARE LONG CONSTANT SD$_DELSPACE = 29 ! longword (# segments that can be recovered by deleting SnapDisk) DECLARE LONG CONSTANT SD$_DISK_DEVICE = 30 ! character string (Name of device as bound to OpenVMS) DECLARE LONG CONSTANT SD$_BACKUP_DATE = 31 ! Date/time (8 bytes) (Date that recorded snap was last created) DECLARE LONG CONSTANT SD$_READS = 32 ! longword (Number of read received from user) DECLARE LONG CONSTANT SD$_WRITES = 33 ! longword (Number of writes received from user) DECLARE LONG CONSTANT SD$_SPLIT_READS = 34 ! longword (Number of reads that were split by SD) DECLARE LONG CONSTANT SD$_SPLIT_WRITES = 35 ! longword (Number of writes that were split by SD) DECLARE LONG CONSTANT SD$_DISK_READS = 36 ! longword (Number of reads to underlying pool units) DECLARE LONG CONSTANT SD$_DISK_WRITES = 37 ! longword (Number of writes to underlying pool units) DECLARE LONG CONSTANT SD$_COPY_OUTS = 38 ! longword (Number of copy-on-write operations) DECLARE LONG CONSTANT SD$_CONVERT_CANCELS = 39 ! longword (Number of cancelled lock requests) DECLARE LONG CONSTANT SD$_POOL_FULL_STALLS = 40 ! longword (NUmber of requests stalled by pool full) DECLARE LONG CONSTANT SD$_SPARE1 = 41 ! longword DECLARE LONG CONSTANT SD$_SPARE2 = 42 ! longword DECLARE LONG CONSTANT SD$_SPARE3 = 43 ! longword DECLARE LONG CONSTANT SD$_SPARE4 = 44 ! longword DECLARE LONG CONSTANT SD$_SPARE5 = 45 ! longword DECLARE LONG CONSTANT SD$_SPARE6 = 46 ! longword DECLARE LONG CONSTANT SD$_SPARE7 = 47 ! longword DECLARE LONG CONSTANT SD$_SPARE8 = 48 ! longword DECLARE LONG CONSTANT SD$_COPY_STATS = 49 ! Array of SD$K_COPYCOUNTERS longwords DECLARE LONG CONSTANT SD$_DEV_LOCKID = 50 ! longword (LockId of device name consistancy lock) DECLARE LONG CONSTANT SD$_UID_LOCKID = 51 ! longword (LockId of UID name consistancy lock) DECLARE LONG CONSTANT SD$K_COPYCOUNTERS = 24 ! ! options and flags for RTL routines ! DECLARE LONG CONSTANT SD$M_CONTAINER_DISK = 1 DECLARE LONG CONSTANT SD$M_CONVERTED_DISK = 2 ! ! Function codes for cluster-server requests ! DECLARE LONG CONSTANT SD$K_CLU_BIND_POOL = 1 DECLARE LONG CONSTANT SD$K_CLU_BIND_DISK = 2 DECLARE LONG CONSTANT SD$K_CLU_UNBIND = 3 ! ! Define structures used by QIO interface to SD management functions ! ! ++ ! Device list ! ! This structure is used to pass information between ! the runtime library, the FDT routines and the start ! I/O routines ! -- DECLARE LONG CONSTANT sd$S_SDDEVLIST = 88 record SDDEVLIST LONG sd$l_start_lbn ! Starting LBN of data space LONG sd$l_lbn_count ! Size of data space LONG sd$l_meta_lbn ! Location of SnapDisk metadata LONG sd$l_meta_count ! Size of metadata area LONG sd$ps_ucb ! UCB of pool unit LONG sd$l_name_length ! Length of device name STRING sd$t_name ( 1 to 64 ) = 1 ! Device name end record SDDEVLIST ! ! SD Parameter list - This is used to pass Snapshot Services ! parameters/characteristics between the runtime library ! and the I/O functions ! DECLARE LONG CONSTANT sd$m_stall = x'00000001' DECLARE LONG CONSTANT sd$m_redundant = x'00000002' DECLARE LONG CONSTANT sd$m_record = x'00000004' DECLARE LONG CONSTANT sd$m_cluster = x'00000008' DECLARE LONG CONSTANT sd$m_partial = x'00000010' DECLARE LONG CONSTANT sd$S_SDPARAMLIST = 8 record SDPARAMLIST group sd$r_size_overlay variant case LONG sd$l_segment_size ! Segment size for copy-on-write case LONG sd$l_disk_size ! Disk size for create/disk end variant end group sd$r_size_overlay group sd$r_flags_overlay variant case LONG sd$l_flags ! Miscellaneous flags case group sd$r_flags_bits ! Stall/Fail on pool full ! Use redundancy for SnapDisk metadata ! Record snapshot creation time ! Operation is cluster-wide ! Partial bind on pool BYTE stall_bits ! COMMENT ADDED BY SDL - stall_bits contains bits stall through fill_17_ end group sd$r_flags_bits end variant end group sd$r_flags_overlay end record SDPARAMLIST ! ! IOCTL function codes - miscellaneous functions ! DECLARE LONG CONSTANT SD$K_GET_DISK = 1 DECLARE LONG CONSTANT SD$K_GET_STATS = 2 DECLARE LONG CONSTANT SD$K_GET_UNIT = 3 DECLARE LONG CONSTANT SD$K_POOL_DISK = 4 DECLARE LONG CONSTANT SD$K_POOL_INFO = 5 DECLARE LONG CONSTANT SD$K_POOL_UNIT = 6 DECLARE LONG CONSTANT SD$K_CLU_TEST = 7 DECLARE LONG CONSTANT SD$K_STORE_LOCKIDS = 8 DECLARE LONG CONSTANT SD$K_RETRIEVE_LOCKIDS = 9 DECLARE LONG CONSTANT SD$K_RETRIEVE_MEMBERLIST = 10 DECLARE LONG CONSTANT SD$K_SET_TRACE_LEVEL = 11 DECLARE LONG CONSTANT SD$K_GET_TRACE_LEVEL = 12 ! ! Define Snapshot Services runtime library functions ! ! ! ++ ! ! ROUTINE: ! ! sd$add_units POOL_DEVICE, UNIT_LIST ! ! FUNCTIONAL DESCRIPTION: ! ! Runtime library routine ! Add additional storage units to an existing pool ! This function takes care of all the creation of container ! files etc. for the storage units being added. ! ! FORMAL PARAMETERS: ! ! POOL_DEVICE (IN) : Name of device to add members ! UNIT_LIST (IN) : Item List 3 containing Device list ! FLAGS (IN) : Indicates temporary or permanent pool member ! ! ! PRE-CONDITIONS: ! ! The set of devices must be mounted as Files-11 devices ! ! POST-CONDITIONS: ! ! The new storage units are added as new members to the pool. ! All current and new members are stamped with a new membership list ! ! RETURN VALUE: ! ! Various statuses ! ! -- ! EXTERNAL LONG FUNCTION sd$add_units & ( & STRING BY DESC, & LONG BY REF, & LONG BY VALUE & ) ! ! ++ ! ! ROUTINE: ! ! sd$bind_disk DISK_DEVICE, POOL_DEVICE, DISK_NAME, FLAGS ! ! FUNCTIONAL DESCRIPTION: ! ! Runtime library routine ! Export a SnappyDisk from the pool as an OpenVMS device ! ! FORMAL PARAMETERS: ! ! DISK_DEVICE (IN) : Name of disk device to create ! POOL_DEVICE (IN) : Name of pool device to use ! DISK_NAME (IN) : Name of disk to export from pool ! FLAGS (IN) : Optional flags SD$M_CLUSTER ! ! PRE-CONDITIONS: ! ! The pool must be bound. ! The SnappyDisk name must exist in the pool. ! The SnappyDisk must not be bound to a device on another computer in the ! cluster. ! Another SnappyDisk must not be bound to the specified device on any ! computer in the cluster. ! ! POST-CONDITIONS: ! ! The SnappyDisk is exposed as an OpenVMS device ! ! RETURN VALUE: ! ! Various statuses ! ! -- ! EXTERNAL LONG FUNCTION sd$bind_disk & ( & STRING BY DESC, & STRING BY DESC, & STRING BY DESC, & LONG BY VALUE & ) ! ! ++ ! ! ROUTINE: ! ! sd$bind_pool POOL_DEVICE, UNIT_LIST, FLAGS ! ! FUNCTIONAL DESCRIPTION: ! ! Runtime library routine ! Rebind a pool from a set of devices that have been ! previously created as a pool. ! This function takes care of all the location of container ! files, driver loading. ! ! FORMAL PARAMETERS: ! ! POOL_DEVICE (IN) : Name of device to create ! UNIT_LIST (IN) : Itemlist3 containing list of storage units ! FLAGS (IN) : Optional flags SD$M_CLUSTER ! ! PRE-CONDITIONS: ! ! The storage units must be mounted as Files-11 devices. ! The storage units must have been previously used to create a pool. ! The list of storage units must not include storage units in another ! pool. ! The list of storage units must not include a SnappyDisk bound to a ! device. ! ! POST-CONDITIONS: ! ! A pool is rebound and exported as the specified pool_device. ! ! RETURN VALUE: ! ! Various statuses ! ! -- ! EXTERNAL LONG FUNCTION sd$bind_pool & ( & STRING BY DESC, & LONG BY REF, & LONG BY VALUE & ) ! ! ++ ! ! ROUTINE: ! ! sd$create_disk POOL_DEVICE, DISK_NAME, DISK_CAPACITY ! ! FUNCTIONAL DESCRIPTION: ! ! Runtime library routine ! Create a SnappyDisk in a pool ! ! FORMAL PARAMETERS: ! ! POOL_DEVICE (IN) : Name of pool device to use ! DISK_NAME (IN) : Name of SnappyDisk to create ! DISK_CAPACITY (IN) : Size in blocks of SnappyDisk to create ! ! PRE-CONDITIONS: ! ! The pool must be bound. ! The SnappyDisk name must not already exist in the pool. ! The pool must have enough free space to create a SnappyDisk of the size ! specified. ! ! POST-CONDITIONS: ! ! A new SnappyDisk, named disk_name, is created in the pool ! ! RETURN VALUE: ! ! Various statuses ! ! -- ! EXTERNAL LONG FUNCTION sd$create_disk & ( & STRING BY DESC, & STRING BY DESC, & LONG BY VALUE & ) ! ! ++ ! ! ROUTINE: ! ! sd$create_pool UNIT_LIST, SEGMENT_SIZE, FLAGS ! ! FUNCTIONAL DESCRIPTION: ! ! Create a pool from a set of storage units. ! This function takes care of all the creation of container ! files and driver loading that needs to be done before calling ! the IO$_BIND function. ! ! FORMAL PARAMETERS: ! ! UNIT_LIST (IN) : Item list 3 containing list of storage units ! SEGMENT_SIZE (IN) : Size of segments in pool (blocks) ! FLAGS (IN) : Optional flags SD$M_STALL, SD$M_FAIL ! ! PRE-CONDITIONS: ! ! The storage units must be initialised and mounted as Files-11 devices. ! The list of storage units must not include storage units in another ! pool. ! The list of storage units must not include a SnappyDisk bound to a ! device. ! ! POST-CONDITIONS: ! ! A new pool is created on the storage units. ! The storage units are stamped as belonging to the same pool. ! ! RETURN VALUE: ! ! Various statuses ! ! -- ! EXTERNAL LONG FUNCTION sd$create_pool & ( & LONG BY REF, & LONG BY VALUE, & LONG BY VALUE & ) ! ! ++ ! ! ROUTINE: ! ! sd$create_snap POOL_DEVICE, DISK_DEVICE, DISK_NAME, FLAGS ! ! FUNCTIONAL DESCRIPTION: ! ! Runtime library routine ! Create a snap of an existing SnappyDisk ! ! FORMAL PARAMETERS: ! ! POOL_DEVICE (IN) : Name of pool device to use ! DISK_DEVICE (IN) : Name of SnappyDisk device to use as basis ! for snap ! DISK_NAME (IN) : Name of SnappyDisk to create ! FLAGS (IN) : Should we record time snap was taken ! for incremental backup purposes, SD$M_RECORD ! ! PRE-CONDITIONS: ! ! The pool must be bound ! The original SnappyDisk must be exported as a device ! ! POST-CONDITIONS: ! ! A new SnappyDisk is created in the pool. That SnappyDisk will be a snap ! of the original SnappyDisk specified in the call. ! ! RETURN VALUE: ! ! Various statuses ! ! -- ! EXTERNAL LONG FUNCTION sd$create_snap & ( & STRING BY DESC, & STRING BY DESC, & STRING BY DESC, & LONG BY VALUE & ) ! ! ++ ! ! ROUTINE: ! ! sd$delete_disk POOL_DEVICE, DISK_NAME ! ! FUNCTIONAL DESCRIPTION: ! ! Runtime library routine ! Delete a SnapDisk from a pool ! ! FORMAL PARAMETERS: ! ! POOL_DEVICE (IN) : Name of pool device to use ! DISK_NAME (IN) : Name of SnappyDisk to delete ! ! PRE-CONDITIONS: ! ! The pool must be bound ! The SnappyDisk name must exist in the pool ! The SnappyDisk named must not be bound to a device on the local computer ! ! POST-CONDITIONS: ! ! The SnappyDisk is deleted from the pool ! ! RETURN VALUE: ! ! Various statuses ! ! -- ! EXTERNAL LONG FUNCTION sd$delete_disk & ( & STRING BY DESC, & STRING BY DESC & ) ! ! ++ ! ! ROUTINE: ! ! sd$remove_units POOL_DEVICE, UNIT_LIST ! ! FUNCTIONAL DESCRIPTION: ! ! Runtime library routine ! Removes members from a pool. ! If the members are successfully removed, the metadata files are ! removed from the devices. ! ! FORMAL PARAMETERS: ! ! POOL_DEVICE (IN) : Name of device to remove members ! UNIT_LIST (IN) : Item list 3 containing list of storage units ! ! PRE-CONDITIONS: ! ! The list of storage units must be part of the specified pool. ! The pool must contain enough free space to allow data on the outgoing ! storage units to be copied to other storage units in the pool. ! The list of storage units must not be the complete set of units in ! the pool. ! ! POST-CONDITIONS: ! ! The remaining members are updated with the new pool ! membership list. ! ! RETURN VALUE: ! ! Various statuses ! ! -- ! EXTERNAL LONG FUNCTION sd$remove_units & ( & STRING BY DESC, & LONG BY REF & ) ! ! ++ ! ! ROUTINE: ! ! sd$unbind VIRTUAL_DEVICE, FLAGS ! ! FUNCTIONAL DESCRIPTION: ! ! Runtime library routine ! Unbind a pool or SnapDisk. ! ! FORMAL PARAMETERS: ! ! VIRTUAL_DEVICE (IN) : Name of device to unbind ! FLAGS (IN) : Optional flags SD$M_CLUSTER ! ! PRE-CONDITIONS: ! ! The pool or SnappyDisk must be bound to the device on the local computer ! ! POST-CONDITIONS: ! ! The pool or SnappyDisk is unbound from the device ! ! RETURN VALUE: ! ! Various statuses ! ! -- ! EXTERNAL LONG FUNCTION sd$unbind & ( & STRING BY DESC, & LONG BY VALUE & ) ! ! ++ ! ! ROUTINE: ! ! sd$get_disk DISK_DEVICE, ITMLST ! ! FUNCTIONAL DESCRIPTION: ! ! Runtime library routine ! Get information about an exported disk. ! The information is returned using a standard OpenVMS ! itemlist mechanism. ! NOTE: The itemlist must be zero terminated ! ! Valid item codes are: ! ! SD$_BACKUP_DATE ! SD$_CREATION_DATE ! SD$_DELSPACE ! SD$_DISK_CAPACITY ! SD$_DISK_DEVICE ! SD$_DISK_NAME ! SD$_FAMILY_NUMBER ! SD$_MEMBER_NUMBER ! SD$_POOL_DEVICE ! ! FORMAL PARAMETERS: ! ! DISK_DEVICE (IN) : Name of SnappyDisk device ! ITMLST (IN): Address of items to return ! ! PRE-CONDITIONS: ! ! The device must be a SnappyDisk device ! ! POST-CONDITIONS: ! ! The information requested is returned ! ! RETURN VALUE: ! ! SS$_NORMAL - Member info returned ! SS$_ACCVIO - Parameters not accessible ! SS$_BADPARAM - One or more item codes are invalid ! SS$_IVBUFLEN - one or more buffer lengths are invalid ! SS$_IVDEVNAM - ucb is not that of a pool member ! SS$_NOTBOUND - the member is not bound into a pool ! SS$_SDDISABLED - Snap-capable disk not loaded ! -- ! EXTERNAL LONG FUNCTION sd$get_disk & ( & STRING BY DESC, & LONG BY REF & ) ! ! ++ ! ! ROUTINE: ! ! sd$get_pool POOL_DEVICE, ITMLST ! ! FUNCTIONAL DESCRIPTION: ! ! Runtime library routine ! Get pool-wide information ! The information is returned using a standard OpenVMS ! itemlist mechanism. ! NOTE: The itemlist must be zero terminated ! ! Valid item codes are: ! ! SD$_CREATION_DATE ! SD$_FREE_SEGMENTS ! SD$_HIGHEST_UNIT ! SD$_LOWEST_UNIT ! SD$_MAJOR_ID ! SD$_MAX_DISK ! SD$_MAX_FAMILY ! SD$_MAX_UNITS ! SD$_MINOR_ID ! SD$_MODIFIED_DATE ! SD$_POOL_ID ! SD$_POOL_OPTIONS ! SD$_SEGMENT_SIZE ! SD$_SEQUENCE_NUMBER ! SD$_TOTAL_SEGMENTS ! SD$_UNIT_COUNT ! ! FORMAL PARAMETERS: ! ! POOL_DEVICE (IN) : Name of storage pool ! ITMLST (IN) : Address of items to return ! ! PRE-CONDITIONS: ! ! A context must have been started with sd$get_pool_begin ! ! POST-CONDITIONS: ! ! The information requested is returned ! ! RETURN VALUE: ! ! SS$_NORMAL - Next member returned ! SS$_BADPARAM - One or more item codes are invalid ! SS$_IVBUFLEN - One or more buffer lengths are invalid ! SS$_SDDISABLED - Snap-capable disk not loaded ! -- ! EXTERNAL LONG FUNCTION sd$get_pool & ( & STRING BY DESC, & LONG BY REF & ) ! ! ++ ! ! ROUTINE: ! ! sd$get_pool_begin POOL_DEVICE, POOL_CONTEXT ! ! FUNCTIONAL DESCRIPTION: ! ! Runtime library routine ! Routine to setup context to read SnapDisk pool ! parameters from a pool device. ! ! FORMAL PARAMETERS: ! ! POOL_DEVICE (IN) : Name of pool device to query ! POOL_CONTEXT (IN) : Address of context to return ! ! PRE-CONDITIONS: ! ! The pool device must exist ! ! POST-CONDITIONS: ! ! A context is setup to allow sd$get_pool and sd$get_pooldevice ! to be called to return the pool parameters. ! ! RETURN VALUE: ! ! Various statuses ! ! -- ! EXTERNAL LONG FUNCTION sd$get_pool_begin & ( & STRING BY DESC, & LONG BY REF & ) ! ! ++ ! ! ROUTINE: ! ! sd$get_pool_disk POOL_CONTEXT, ITMLST ! ! FUNCTIONAL DESCRIPTION: ! ! Runtime library routine ! Routine to return the information for the next SnappyDisk in the pool. ! ! For example: ! ! status = sd$get_pool_begin(raw_device, context) ! while (success(status)) ! status = sd$get_pool_disk(context, itmlst) ! status = sd$get_pool_end(context) ! ! Valid item code are: ! ! SD$_BACKUP_DATE ! SD$_CREATION_DATE ! SD$_DELSPACE ! SD$_DISK_CAPACITY ! SD$_DISK_DEVICE ! SD$_DISK_NAME ! SD$_FAMILY_NUMBER ! SD$_MEMBER_NUMBER ! SD$_POOL_DEVICE ! ! FORMAL PARAMETERS: ! ! POOL_CONTEXT (IN) : Address of pool context ! ITMLST (IN): Address of items to return ! ! PRE-CONDITIONS: ! ! A context must have been started with sd$get_pool_begin ! ! POST-CONDITIONS: ! ! The next member is returned ! ! RETURN VALUE: ! ! SS$_NORMAL - Next member returned ! SS$_NOMOREDEV - No more diks in pool ! -- ! EXTERNAL LONG FUNCTION sd$get_pool_disk & ( & LONG BY REF, & LONG BY REF & ) ! ! ++ ! ! ROUTINE: ! ! sd$get_pool_end POOL_CONTEXT ! ! FUNCTIONAL DESCRIPTION: ! ! Runtime library routine ! Routine to tidy up the context associated with a ! sd$get_pool_begin. ! ! FORMAL PARAMETERS: ! ! POOL_CONTEXT (IN) : Address of context to delete ! ! PRE-CONDITIONS: ! ! A context must have been started with sd$get_pool_begin ! ! POST-CONDITIONS: ! ! The context is deleted ! ! RETURN VALUE: ! ! SS$_NORMAL ! ! -- ! EXTERNAL LONG FUNCTION sd$get_pool_end & ( & LONG BY REF & ) ! ! ++ ! ! ROUTINE: ! ! sd$get_pool_unit POOL_CONTEXT, NEXT_UNIT ! ! FUNCTIONAL DESCRIPTION: ! ! Runtime library routine ! Routine to return the next member device making up the pool. ! This routine is designed to be called in a loop to return ! all the members making up the pool. ! For example: ! ! status = sd$get_pool_begin(raw_device, context) ! while (success(status)) ! status = sd$get_pool_unit(context, unit_device) ! status = sd$get_pool_end ! ! FORMAL PARAMETERS: ! ! POOL_CONTEXT (IN) : Address of context ! NEXT_UNIT (OUT) : Address of descriptor to return ! ! PRE-CONDITIONS: ! ! A context must have been started with sd$get_pool_begin ! ! POST-CONDITIONS: ! ! The next member is returned ! ! RETURN VALUE: ! ! SS$_NORMAL - Next member returned ! SS$_NOMOREDEV - No more devices ! SS$_BADPARAM - Invalid context ! SS$_SDDISABLED - Snap-capable disk not loaded ! ! -- ! EXTERNAL LONG FUNCTION sd$get_pool_unit & ( & LONG BY REF, & STRING BY DESC & ) ! ! ++ ! ! ROUTINE: ! ! sd$get_raw_begin UNIT_DEVICE, UNIT_CONTEXT ! ! FUNCTIONAL DESCRIPTION: ! ! Runtime library routine ! Routine to setup context to read SnappyDisk pool ! parameters from a raw (mounted but not bound) storage unit. ! ! FORMAL PARAMETERS: ! ! UNIT_DEVICE (IN) : Name of storage unit to query ! UNIT_CONTEXT (IN) : Address of context to return ! ! PRE-CONDITIONS: ! ! The member device must be mounted but not bound ! ! POST-CONDITIONS: ! ! A context is setup to allow sd$get_raw_info and sd$get_unitdevice ! to be called to return pool parameters stored on the member. ! ! RETURN VALUE: ! ! Various statuses ! ! -- ! EXTERNAL LONG FUNCTION sd$get_raw_begin & ( & STRING BY DESC, & LONG BY REF & ) ! ! ++ ! ! ROUTINE: ! ! sd$get_raw_end UNIT_CONTEXT ! ! FUNCTIONAL DESCRIPTION: ! ! Runtime library routine ! Routine to tidy up the context associated with a ! sd$get_raw_begin. ! ! FORMAL PARAMETERS: ! ! UNIT_CONTEXT (IN) : Address of context ! ! PRE-CONDITIONS: ! ! A context must have been started with sd$get_raw_begin ! ! POST-CONDITIONS: ! ! The context is deleted ! ! RETURN VALUE: ! ! SS$_NORMAL ! ! -- ! EXTERNAL LONG FUNCTION sd$get_raw_end & ( & LONG BY REF & ) ! ! ++ ! ! ROUTINE: ! ! sd$get_raw_next UNIT_CONTEXT, NEXT_UNIT ! ! FUNCTIONAL DESCRIPTION: ! ! Runtime library routine ! Routine to return the next member device making up the pool. ! This routine is designed to be called in a loop to return ! all the members in the pool making up the device. ! For example: ! ! status = sd$get_raw_begin(raw_device, context) ! while (success(status)) ! status = sd$get_raw_next(context, unit_device) ! status = sd$get_raw_end ! ! FORMAL PARAMETERS: ! ! UNIT_CONTEXT (IN) : Address of context ! NEXT_UNIT(OUT) : Address of descriptor to return ! ! PRE-CONDITIONS: ! ! A context must have been started with sd$get_raw_begin ! ! POST-CONDITIONS: ! ! The next member is returned ! ! RETURN VALUE: ! ! SS$_NORMAL - Next member returned ! SS$_NOMOREDEV - No more devices ! ! -- ! EXTERNAL LONG FUNCTION sd$get_raw_next & ( & LONG BY REF, & STRING BY DESC & ) ! ! ++ ! ! ROUTINE: ! ! sd$get_raw_info UNIT_CONTEXT, ITMLST ! ! FUNCTIONAL DESCRIPTION: ! ! Runtime library routine ! Get information from the member ! The information is returned using a standard OpenVMS ! itemlist mechanism. ! NOTE: The itemlist must be zero terminated ! ! Valid item codes are: ! ! SD$_CREATION_DATE ! SD$_HIGHEST_UNIT ! SD$_LOWEST_UNIT ! SD$_MAJOR_ID ! SD$_MAX_DISK ! SD$_MAX_FAMILY ! SD$_MAX_UNITS ! SD$_MINOR_ID ! SD$_MODIFIED_DATE ! SD$_POOL_ID ! SD$_POOL_OPTIONS ! SD$_SEGMENT_SIZE ! SD$_SEQUENCE_NUMBER ! SD$_UNIT_COUNT ! SD$_UNIT_ID ! SD$_UNIT_NUMBER ! SD$_UNIT_OPTIONS ! ! FORMAL PARAMETERS: ! ! UNIT_CONTEXT (IN) : Address of context ! ITMLST (IN) : Address of items to return ! ! PRE-CONDITIONS: ! ! A context must have been started with sd$get_raw_begin ! ! POST-CONDITIONS: ! ! The information requested is returned ! ! RETURN VALUE: ! ! SS$_NORMAL - Next member returned ! SS$_BADPARAM - One or more item codes are invalid ! SS$_IVBUFLEN - One or more buffer lengths are invalid ! -- ! EXTERNAL LONG FUNCTION sd$get_raw_info & ( & LONG BY REF, & LONG BY REF & ) ! ! ++ ! ! ROUTINE: ! ! sd$get_stats POOL_DEVICE, ITMLST ! ! FUNCTIONAL DESCRIPTION: ! ! Runtime library routine ! Get monitor-type runtime statistics on a system-wide ! or per-pool basis. ! ! If POOL_DEVICE is NULL, this call returns the system-wide ! statistics otherwise it returns the statistics for the ! specified pool. ! ! The information is returned using a standard OpenVMS ! itemlist mechanism. ! NOTE: The itemlist must be zero terminated ! ! Valid item codes are: ! ! SD$_COPY_OUTS ! SD$_DISK_READS ! SD$_DISK_WRITES ! SD$_READS ! SD$_SPLIT_READS ! SD$_SPLIT_WRITES ! SD$_WRITES ! ! FORMAL PARAMETERS: ! ! POOL_DEVICE(IN) : Pool device name ! ITMLST (IN) : Address of items to return ! ! PRE-CONDITIONS: ! ! The SnappyDisk driver must be loaded and enabled. ! For a non NULL pool_device, the pool must be bound to the device on ! the local computer. ! ! POST-CONDITIONS: ! ! The information requested is returned ! ! RETURN VALUE: ! ! SS$_NORMAL - Stats returned ! SS$_ACCVIO - Parameters not accessible ! SS$_BADPARAM - One or more item codes are invalid ! SS$_IVBUFLEN - one or more buffer lengths are invalid ! SS$_IVDEVNAM - Device is not a pool device ! SS$_NOSUCHDEV - No such pool device ! SS$_SDDISABLED - Snap-capable disk not loaded ! -- ! EXTERNAL LONG FUNCTION sd$get_stats & ( & STRING BY DESC, & LONG BY REF & ) ! ! ++ ! ! ROUTINE: ! ! sd$get_unit UNIT_DEVICE, ITMLST ! ! FUNCTIONAL DESCRIPTION: ! ! Runtime library routine ! Get information about a pool member ! The information is returned using a standard OpenVMS ! itemlist mechanism. ! NOTE: The itemlist must be zero terminated ! ! Valid item codes are: ! ! SD$_DATA_LBN ! SD$_DATA_SIZE ! SD$_FREE_SEGMENTS ! SD$_META_LBN ! SD$_META_SIZE ! SD$_POOL_DEVICE ! SD$_TOTAL_SEGMENTS ! SD$_UNIT_ID ! SD$_UNIT_NUMBER ! SD$_UNIT_OPTIONS ! ! FORMAL PARAMETERS: ! ! UNIT_DEVICE (IN) : Name of storage unit ! ITMLST (IN) : Address of items to return ! ! PRE-CONDITIONS: ! ! The storage unit must exist on the local computer ! ! POST-CONDITIONS: ! ! The information requested is returned ! ! RETURN VALUE: ! ! SS$_NORMAL - Member info returned ! SS$_ACCVIO - Parameters not accessible ! SS$_BADPARAM - One or more item codes are invalid ! SS$_IVBUFLEN - one or more buffer lengths are invalid ! SS$_IVDEVNAM - ucb is not that of a pool member ! SS$_NOTBOUND - the member is not bound into a pool ! SS$_SDDISABLED - Snap-capable disk not loaded ! -- ! EXTERNAL LONG FUNCTION sd$get_unit & ( & STRING BY DESC, & LONG BY REF & )