DEFINE EXTENT (X'63')

As shown in Table 1, the Define Extent command operates on 16 bytes of information which define an addressing range on a virtual disk. Subsequent chained commands may operate only within that addressing range. Also included is an operation inhibit mask (byte 0, bits 0-1).

If less than 16 bytes are specified, the command is rejected with Unit Check (Command Reject), Channel End, and Device End. If the CCW count is greater than 16 bytes, only 16 bytes of information are used.

If another Define Extent command was previously issued in the same chain, the command is rejected with Unit Check (Command Reject), Channel End, and Device End.

If parameters of the extent are incorrect, the command is terminated with Unit Check (Command Reject), Channel End and Device End status.

If the addressable block size is incorrect, the command is terminated with Unit Check (Block Size Exception), Channel End and Device End status.

If the parameters are valid and command chaining is not indicated, Channel End and Device End status are presented.

If the parameters are correct and command chaining is indicated, the next CCW is executed. This is normally a Locate command.

Before continuing, two terms must be defined. The first term is storage space. Storage space is the usable storage contained in a virtual disk. Storage space is addressed in blocks from 0 to N-1.

The second term is disk data space. This is not the same as a z/VSE data space, which is used to create a virtual disk. Instead, disk data space refers to space on a virtual disk that contains addressable blocks of user data. These blocks are numbered from 0 to M-1. An Extent Locator specified in a Define Extent command references a disk data space to its storage space. An example follows:

An explanation of this figure is provided in the surrounding text.

In this example, points A (bytes 8-11) and B (bytes 12-15) represent the limits of the extent in the data space. EL is the Extent Locator (bytes 4-7). EL and Z represent the limits of the extent in storage space. All points (A, B, EL, and Z) must be valid block numbers.

For example, EL = 500, A = 150, B = 400.

The location in the storage space of A is 500 and of B it is 750.

The following 16 bytes are the parameters of the Define Extent command.

Table 1. Parameters of the Define Extent command
Bytes Bits Mask Byte Description
0 0-1 00 01 10 11 Non-formatting write permitted All write operations inhibited Reserved - not allowed All write operations permitted
  2-7   Unused - must be zero
1     Reserved - must be zero
2-3     Addressable block size in bytes (512,or 0). 0 defaults to 512.
4-7     Extent Locator. This is a block number which identifies the location on the storage space of the first block of an extent.
8-11     Addressable block number of the first block of this extent in the data space
12-15     Addressable block number of the last block of this extent in the data space

The following describes the bytes used by the Define Extent command.

Byte 0: If any of byte 0 bits 2-7 is not zero or bits 0-1 are B'10', then Unit Check (Command Reject), Channel End, and Device End are set.

Bytes 2-3: The addressable block size specification in bytes 2-3 must be 512 or 0. A block size of 0 is interpreted as a default value of 512.

Bytes 4-7: Bytes 4-7 contain the extent locator. The extent locator is the block number specifying the location on the virtual disk of the first block of an extent.

Bytes 8-11: Bytes 8-11 contain the addressable block number of the first block of data for this extent.

Bytes 12-15: Bytes 12-15 contain the addressable block number of the last block of data for this extent. This value must obey the following rules or the command is rejected:
  • A less than or equal to B, and
  • D less than or equal to the maximum data block number that is valid for the device.
Where:
  • A = Value in bytes 8-11 (number of first block of extent)
  • B = Value in bytes 12-15 (number of last block of extent)
  • C = Value in bytes 4-7 (extent locator)
  • D = C+(B-A).