--******************************************************************************************************************** -- Created: 30-Mar-2010 17:01:55 by OpenVMS SDL EV3-3 -- Source: 19-MAR-1998 16:38:21 $1$DGA7274:[STARLET_ADA.LIS]SDDEF.SDL;1 --******************************************************************************************************************** with SYSTEM; use SYSTEM; with STARLET; use STARLET; with CONDITION_HANDLING; use CONDITION_HANDLING; package SDDEF is -- module $SDDEF -- -- item codes for sd$xxx calls -- SD_MAJOR_ID : constant := 1; -- longword (major ODS version number) SD_MINOR_ID : constant := 2; -- longword (minor ODS version number) SD_POOL_ID : constant := 3; -- UID (16 bytes) (Pool identifier) SD_CREATION_DATE : constant := 4; -- Date/time (8 bytes) (Date pool was created) SD_MODIFIED_DATE : constant := 5; -- Date/time (8 bytes) (Date pool membership was last changed) SD_SEGMENT_SIZE : constant := 6; -- longword (Size of segment in pool # blocks) SD_MAX_UNITS : constant := 7; -- longword (Maximum # members allowed in pool) SD_UNIT_COUNT : constant := 8; -- longword (Number of members currently in pool) SD_POOL_OPTIONS : constant := 9; -- longword (Pool flags) SD_UNIT_ID : constant := 10; -- UID (16 bytes) (Identifier of storage unit) SD_UNIT_NUMBER : constant := 11; -- longword (Storage unit number) SD_UNIT_OPTIONS : constant := 12; -- longword (Storage unit flags) SD_SEQUENCE_NUMBER : constant := 13; -- longword (Homeblock sequence number) SD_HIGHEST_UNIT : constant := 14; -- longword (Number of highest member in pool) SD_LOWEST_UNIT : constant := 15; -- longword (Number of lowest member in pool) SD_TOTAL_SEGMENTS : constant := 16; -- longword (Total # of segment in pool) SD_FREE_SEGMENTS : constant := 17; -- longword (Total # of free segments in pool) SD_MAX_FAMILY : constant := 18; -- longword (Maximum # of families allowed in pool) SD_MAX_DISK : constant := 19; -- longword (Maximum # members in a family) SD_META_LBN : constant := 20; -- longword (Start of SD metadata on member) SD_META_SIZE : constant := 21; -- longword (Size of SD metadata on member) SD_DATA_LBN : constant := 22; -- longword (Start of pool space on member) SD_DATA_SIZE : constant := 23; -- longword (Size of pool space on member) SD_POOL_DEVICE : constant := 24; -- character string (Name of pool device) SD_FAMILY_NUMBER : constant := 25; -- longword (Familiy number of a SnapDisk) SD_MEMBER_NUMBER : constant := 26; -- longword (Number within family of a SnapDisk) SD_DISK_NAME : constant := 27; -- character string (Name of SnapDisk) SD_DISK_CAPACITY : constant := 28; -- longword (Size/capacity of a SnapDisk) SD_DELSPACE : constant := 29; -- longword (# segments that can be recovered by deleting SnapDisk) SD_DISK_DEVICE : constant := 30; -- character string (Name of device as bound to OpenVMS) SD_BACKUP_DATE : constant := 31; -- Date/time (8 bytes) (Date that recorded snap was last created) SD_READS : constant := 32; -- longword (Number of read received from user) SD_WRITES : constant := 33; -- longword (Number of writes received from user) SD_SPLIT_READS : constant := 34; -- longword (Number of reads that were split by SD) SD_SPLIT_WRITES : constant := 35; -- longword (Number of writes that were split by SD) SD_DISK_READS : constant := 36; -- longword (Number of reads to underlying pool units) SD_DISK_WRITES : constant := 37; -- longword (Number of writes to underlying pool units) SD_COPY_OUTS : constant := 38; -- longword (Number of copy-on-write operations) SD_CONVERT_CANCELS : constant := 39; -- longword (Number of cancelled lock requests) SD_POOL_FULL_STALLS : constant := 40; -- longword (NUmber of requests stalled by pool full) SD_SPARE1 : constant := 41; -- longword SD_SPARE2 : constant := 42; -- longword SD_SPARE3 : constant := 43; -- longword SD_SPARE4 : constant := 44; -- longword SD_SPARE5 : constant := 45; -- longword SD_SPARE6 : constant := 46; -- longword SD_SPARE7 : constant := 47; -- longword SD_SPARE8 : constant := 48; -- longword SD_COPY_STATS : constant := 49; -- Array of SD$K_COPYCOUNTERS longwords SD_DEV_LOCKID : constant := 50; -- longword (LockId of device name consistancy lock) SD_UID_LOCKID : constant := 51; -- longword (LockId of UID name consistancy lock) SD_K_COPYCOUNTERS : constant := 24; -- -- options and flags for RTL routines -- SD_M_CONTAINER_DISK : constant := 1; SD_M_CONVERTED_DISK : constant := 2; -- -- Function codes for cluster-server requests -- SD_K_CLU_BIND_POOL : constant := 1; SD_K_CLU_BIND_DISK : constant := 2; SD_K_CLU_UNBIND : constant := 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 -- -- type SDDEVLIST_TYPE is record START_LBN : UNSIGNED_LONGWORD; -- Starting LBN of data space LBN_COUNT : UNSIGNED_LONGWORD; -- Size of data space META_LBN : UNSIGNED_LONGWORD; -- Location of SnapDisk metadata META_COUNT : UNSIGNED_LONGWORD; -- Size of metadata area UCB : ADDRESS; -- UCB of pool unit NAME_LENGTH : UNSIGNED_LONGWORD; -- Length of device name NAME : STRING(1 .. 64); -- Device name end record; for SDDEVLIST_TYPE use record START_LBN at 0 range 0 .. 31; LBN_COUNT at 4 range 0 .. 31; META_LBN at 8 range 0 .. 31; META_COUNT at 12 range 0 .. 31; UCB at 16 range 0 .. 31; NAME_LENGTH at 20 range 0 .. 31; NAME at 24 range 0 .. 511; end record; for SDDEVLIST_TYPE'SIZE use 704; SDDEVLIST_TYPE_INIT : constant SDDEVLIST_TYPE := (START_LBN => 0, LBN_COUNT => 0, META_LBN => 0, META_COUNT => 0, UCB => ADDRESS_ZERO, NAME_LENGTH => 0, NAME => (others => ASCII.NUL)); -- -- SD Parameter list - This is used to pass Snapshot Services -- parameters/characteristics between the runtime library -- and the I/O functions -- SD_M_STALL : constant := 16#00000001#; SD_M_REDUNDANT : constant := 16#00000002#; SD_M_RECORD : constant := 16#00000004#; SD_M_CLUSTER : constant := 16#00000008#; SD_M_PARTIAL : constant := 16#00000010#; type SD_SIZE_OVERLAY_TYPE is record SEGMENT_SIZE : UNSIGNED_LONGWORD; -- Segment size for copy-on-write ----Component(s) below are defined as comments since they ----overlap other fields ---- ----DISK_SIZE : UNSIGNED_LONGWORD; -- Disk size for create/disk end record; for SD_SIZE_OVERLAY_TYPE use record SEGMENT_SIZE at 0 range 0 .. 31; ----Component representation spec(s) below are defined as ----comments since they overlap other fields ---- ----DISK_SIZE at 0 range 0 .. 31; end record; for SD_SIZE_OVERLAY_TYPE'SIZE use 32; SD_SIZE_OVERLAY_TYPE_INIT : constant SD_SIZE_OVERLAY_TYPE := (SEGMENT_SIZE => 0); type SD_FLAGS_TYPE is -- Miscellaneous flags record STALL : BOOLEAN; -- Stall/Fail on pool full REDUNDANT : BOOLEAN; -- Use redundancy for SnapDisk metadata RECOR : BOOLEAN; -- Record snapshot creation time CLUSTER : BOOLEAN; -- Operation is cluster-wide PARTIAL : BOOLEAN; -- Partial bind on pool FILLER_1 : UNSIGNED_27; end record; for SD_FLAGS_TYPE use record STALL at 0 range 0 .. 0; REDUNDANT at 0 range 1 .. 1; RECOR at 0 range 2 .. 2; CLUSTER at 0 range 3 .. 3; PARTIAL at 0 range 4 .. 4; FILLER_1 at 0 range 5 .. 31; end record; for SD_FLAGS_TYPE'SIZE use 32; SD_FLAGS_TYPE_INIT : constant SD_FLAGS_TYPE := (STALL => FALSE, REDUNDANT => FALSE, RECOR => FALSE, CLUSTER => FALSE, PARTIAL => FALSE, FILLER_1 => 0); type SDPARAMLIST_TYPE is record SIZE_OVERLAY : SD_SIZE_OVERLAY_TYPE; FLAGS : SD_FLAGS_TYPE; -- Miscellaneous flags end record; for SDPARAMLIST_TYPE use record SIZE_OVERLAY at 0 range 0 .. 31; FLAGS at 4 range 0 .. 31; end record; for SDPARAMLIST_TYPE'SIZE use 64; SDPARAMLIST_TYPE_INIT : constant SDPARAMLIST_TYPE := ( SIZE_OVERLAY => SD_SIZE_OVERLAY_TYPE_INIT, FLAGS => SD_FLAGS_TYPE_INIT ); -- -- IOCTL function codes - miscellaneous functions -- SD_K_GET_DISK : constant := 1; SD_K_GET_STATS : constant := 2; SD_K_GET_UNIT : constant := 3; SD_K_POOL_DISK : constant := 4; SD_K_POOL_INFO : constant := 5; SD_K_POOL_UNIT : constant := 6; SD_K_CLU_TEST : constant := 7; SD_K_STORE_LOCKIDS : constant := 8; SD_K_RETRIEVE_LOCKIDS : constant := 9; SD_K_RETRIEVE_MEMBERLIST : constant := 10; SD_K_SET_TRACE_LEVEL : constant := 11; SD_K_GET_TRACE_LEVEL : constant := 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 -- ---- -- procedure SD_ADD_UNITS ( STATUS : out COND_VALUE_TYPE; -- return value POOL_DEVICE : in STRING; UNIT_LIST : in ITEM_LIST_TYPE; FLAGS : in UNSIGNED_LONGWORD); pragma INTERFACE (EXTERNAL, SD_ADD_UNITS); pragma IMPORT_VALUED_PROCEDURE (SD_ADD_UNITS, "sd$add_units", (COND_VALUE_TYPE, STRING, ITEM_LIST_TYPE, UNSIGNED_LONGWORD), (VALUE, DESCRIPTOR(S), REFERENCE, 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 -- ---- -- procedure SD_BIND_DISK ( STATUS : out COND_VALUE_TYPE; -- return value DISK_DEVICE : in STRING; POOL_DEVICE : in STRING; DISK_NAME : in STRING; FLAGS : in UNSIGNED_LONGWORD); pragma INTERFACE (EXTERNAL, SD_BIND_DISK); pragma IMPORT_VALUED_PROCEDURE (SD_BIND_DISK, "sd$bind_disk", (COND_VALUE_TYPE, STRING, STRING, STRING, UNSIGNED_LONGWORD), (VALUE, DESCRIPTOR(S), DESCRIPTOR(S), DESCRIPTOR(S), 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 -- ---- -- procedure SD_BIND_POOL ( STATUS : out COND_VALUE_TYPE; -- return value POOL_DEVICE : in STRING; UNIT_LIST : in ITEM_LIST_TYPE; FLAGS : in UNSIGNED_LONGWORD); pragma INTERFACE (EXTERNAL, SD_BIND_POOL); pragma IMPORT_VALUED_PROCEDURE (SD_BIND_POOL, "sd$bind_pool", (COND_VALUE_TYPE, STRING, ITEM_LIST_TYPE, UNSIGNED_LONGWORD), (VALUE, DESCRIPTOR(S), REFERENCE, 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 -- ---- -- procedure SD_CREATE_DISK ( STATUS : out COND_VALUE_TYPE; -- return value POOL_DEVICE : in STRING; DISK_NAME : in STRING; DISK_CAPACITY : in UNSIGNED_LONGWORD); pragma INTERFACE (EXTERNAL, SD_CREATE_DISK); pragma IMPORT_VALUED_PROCEDURE (SD_CREATE_DISK, "sd$create_disk", (COND_VALUE_TYPE, STRING, STRING, UNSIGNED_LONGWORD), (VALUE, DESCRIPTOR(S), DESCRIPTOR(S), 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 -- ---- -- procedure SD_CREATE_POOL ( STATUS : out COND_VALUE_TYPE; -- return value UNIT_LIST : in ITEM_LIST_TYPE; SEGMENT_SIZE : in UNSIGNED_LONGWORD; FLAGS : in UNSIGNED_LONGWORD); pragma INTERFACE (EXTERNAL, SD_CREATE_POOL); pragma IMPORT_VALUED_PROCEDURE (SD_CREATE_POOL, "sd$create_pool", (COND_VALUE_TYPE, ITEM_LIST_TYPE, UNSIGNED_LONGWORD, UNSIGNED_LONGWORD), (VALUE, REFERENCE, VALUE, 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 -- ---- -- procedure SD_CREATE_SNAP ( STATUS : out COND_VALUE_TYPE; -- return value POOL_DEVICE : in STRING; DISK_DEVICE : in STRING; DISK_NAME : in STRING; FLAGS : in UNSIGNED_LONGWORD); pragma INTERFACE (EXTERNAL, SD_CREATE_SNAP); pragma IMPORT_VALUED_PROCEDURE (SD_CREATE_SNAP, "sd$create_snap", (COND_VALUE_TYPE, STRING, STRING, STRING, UNSIGNED_LONGWORD), (VALUE, DESCRIPTOR(S), DESCRIPTOR(S), DESCRIPTOR(S), 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 -- ---- -- procedure SD_DELETE_DISK ( STATUS : out COND_VALUE_TYPE; -- return value POOL_DEVICE : in STRING; DISK_NAME : in STRING); pragma INTERFACE (EXTERNAL, SD_DELETE_DISK); pragma IMPORT_VALUED_PROCEDURE (SD_DELETE_DISK, "sd$delete_disk", (COND_VALUE_TYPE, STRING, STRING), (VALUE, DESCRIPTOR(S), DESCRIPTOR(S))); -- --++ -- -- 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 -- ---- -- procedure SD_REMOVE_UNITS ( STATUS : out COND_VALUE_TYPE; -- return value POOL_DEVICE : in STRING; UNIT_LIST : in ITEM_LIST_TYPE); pragma INTERFACE (EXTERNAL, SD_REMOVE_UNITS); pragma IMPORT_VALUED_PROCEDURE (SD_REMOVE_UNITS, "sd$remove_units", (COND_VALUE_TYPE, STRING, ITEM_LIST_TYPE), (VALUE, DESCRIPTOR(S), REFERENCE)); -- --++ -- -- 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 -- ---- -- procedure SD_UNBIND ( STATUS : out COND_VALUE_TYPE; -- return value VIRTUAL_DEVICE : in STRING; FLAGS : in UNSIGNED_LONGWORD); pragma INTERFACE (EXTERNAL, SD_UNBIND); pragma IMPORT_VALUED_PROCEDURE (SD_UNBIND, "sd$unbind", (COND_VALUE_TYPE, STRING, UNSIGNED_LONGWORD), (VALUE, DESCRIPTOR(S), 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 ---- -- procedure SD_GET_DISK ( STATUS : out COND_VALUE_TYPE; -- return value DISK_DEVICE : in STRING; ITMLST : in ITEM_LIST_TYPE); pragma INTERFACE (EXTERNAL, SD_GET_DISK); pragma IMPORT_VALUED_PROCEDURE (SD_GET_DISK, "sd$get_disk", (COND_VALUE_TYPE, STRING, ITEM_LIST_TYPE), (VALUE, DESCRIPTOR(S), REFERENCE)); -- --++ -- -- 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 ---- -- procedure SD_GET_POOL ( STATUS : out COND_VALUE_TYPE; -- return value POOL_DEVICE : in STRING; ITMLST : in ITEM_LIST_TYPE); pragma INTERFACE (EXTERNAL, SD_GET_POOL); pragma IMPORT_VALUED_PROCEDURE (SD_GET_POOL, "sd$get_pool", (COND_VALUE_TYPE, STRING, ITEM_LIST_TYPE), (VALUE, DESCRIPTOR(S), REFERENCE)); -- --++ -- -- 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 -- ---- -- procedure SD_GET_POOL_BEGIN ( STATUS : out COND_VALUE_TYPE; -- return value POOL_DEVICE : in STRING; POOL_CONTEXT : in ADDRESS); pragma INTERFACE (EXTERNAL, SD_GET_POOL_BEGIN); pragma IMPORT_VALUED_PROCEDURE (SD_GET_POOL_BEGIN, "sd$get_pool_begin", (COND_VALUE_TYPE, STRING, ADDRESS), (VALUE, DESCRIPTOR(S), VALUE)); -- --++ -- -- 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 ---- -- procedure SD_GET_POOL_DISK ( STATUS : out COND_VALUE_TYPE; -- return value POOL_CONTEXT : in ADDRESS; ITMLST : in ITEM_LIST_TYPE); pragma INTERFACE (EXTERNAL, SD_GET_POOL_DISK); pragma IMPORT_VALUED_PROCEDURE (SD_GET_POOL_DISK, "sd$get_pool_disk", (COND_VALUE_TYPE, ADDRESS, ITEM_LIST_TYPE), (VALUE, VALUE, REFERENCE)); -- --++ -- -- 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 -- ---- -- procedure SD_GET_POOL_END ( STATUS : out COND_VALUE_TYPE; -- return value POOL_CONTEXT : in ADDRESS); pragma INTERFACE (EXTERNAL, SD_GET_POOL_END); pragma IMPORT_VALUED_PROCEDURE (SD_GET_POOL_END, "sd$get_pool_end", (COND_VALUE_TYPE, ADDRESS), (VALUE, VALUE)); -- --++ -- -- 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 -- ---- -- procedure SD_GET_POOL_UNIT ( STATUS : out COND_VALUE_TYPE; -- return value POOL_CONTEXT : in ADDRESS; NEXT_UNIT : in STRING); pragma INTERFACE (EXTERNAL, SD_GET_POOL_UNIT); pragma IMPORT_VALUED_PROCEDURE (SD_GET_POOL_UNIT, "sd$get_pool_unit", (COND_VALUE_TYPE, ADDRESS, STRING), (VALUE, VALUE, DESCRIPTOR(S))); -- --++ -- -- 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 -- ---- -- procedure SD_GET_RAW_BEGIN ( STATUS : out COND_VALUE_TYPE; -- return value UNIT_DEVICE : in STRING; UNIT_CONTEXT : in ADDRESS); pragma INTERFACE (EXTERNAL, SD_GET_RAW_BEGIN); pragma IMPORT_VALUED_PROCEDURE (SD_GET_RAW_BEGIN, "sd$get_raw_begin", (COND_VALUE_TYPE, STRING, ADDRESS), (VALUE, DESCRIPTOR(S), VALUE)); -- --++ -- -- 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 -- ---- -- procedure SD_GET_RAW_END ( STATUS : out COND_VALUE_TYPE; -- return value UNIT_CONTEXT : in ADDRESS); pragma INTERFACE (EXTERNAL, SD_GET_RAW_END); pragma IMPORT_VALUED_PROCEDURE (SD_GET_RAW_END, "sd$get_raw_end", (COND_VALUE_TYPE, ADDRESS), (VALUE, VALUE)); -- --++ -- -- 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 -- ---- -- procedure SD_GET_RAW_NEXT ( STATUS : out COND_VALUE_TYPE; -- return value UNIT_CONTEXT : in ADDRESS; NEXT_UNIT : in STRING); pragma INTERFACE (EXTERNAL, SD_GET_RAW_NEXT); pragma IMPORT_VALUED_PROCEDURE (SD_GET_RAW_NEXT, "sd$get_raw_next", (COND_VALUE_TYPE, ADDRESS, STRING), (VALUE, VALUE, DESCRIPTOR(S))); -- --++ -- -- 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 ---- -- procedure SD_GET_RAW_INFO ( STATUS : out COND_VALUE_TYPE; -- return value UNIT_CONTEXT : in ADDRESS; ITMLST : in ITEM_LIST_TYPE); pragma INTERFACE (EXTERNAL, SD_GET_RAW_INFO); pragma IMPORT_VALUED_PROCEDURE (SD_GET_RAW_INFO, "sd$get_raw_info", (COND_VALUE_TYPE, ADDRESS, ITEM_LIST_TYPE), (VALUE, VALUE, REFERENCE)); -- --++ -- -- 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 ---- -- procedure SD_GET_STATS ( STATUS : out COND_VALUE_TYPE; -- return value POOL_DEVICE : in STRING; ITMLST : in ITEM_LIST_TYPE); pragma INTERFACE (EXTERNAL, SD_GET_STATS); pragma IMPORT_VALUED_PROCEDURE (SD_GET_STATS, "sd$get_stats", (COND_VALUE_TYPE, STRING, ITEM_LIST_TYPE), (VALUE, DESCRIPTOR(S), REFERENCE)); -- --++ -- -- 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 ---- -- procedure SD_GET_UNIT ( STATUS : out COND_VALUE_TYPE; -- return value UNIT_DEVICE : in STRING; ITMLST : in ITEM_LIST_TYPE); pragma INTERFACE (EXTERNAL, SD_GET_UNIT); pragma IMPORT_VALUED_PROCEDURE (SD_GET_UNIT, "sd$get_unit", (COND_VALUE_TYPE, STRING, ITEM_LIST_TYPE), (VALUE, DESCRIPTOR(S), REFERENCE)); end SDDEF;