bufx Structure

Purpose

Extends the buf structure to accommodate new fields as needed for performance and RAS reasons.

Description

The bufx structure is available for use by the 64-bit kernel and 64-bit kernel extensions. The 32-bit kernel and 32-bit kernel extensions only have the option of using the buf structure.

bufx Structure Variables for Block I/O

The bufx structure, which is defined in the /usr/include/sys/buf.h file, includes the following fields:

Item Description
b_flags Flag bits. The value of this field is constructed by the logical OR operation with 0 or more of the following values:
B_WRITE
This operation is a write operation.
B_READ
This operation is a read data operation.
B_DONE
I/O on the buffer is done, so the buffer information is more current than other versions.
B_ERROR
A transfer error occurred and the transaction aborted.
B_BUSY
The block is not on the free list.
B_INFLIGHT
This I/O request was sent to the physical device driver for processing.
B_AGE
The data is not likely to be reused soon, so prefer this buffer for reuse. This flag suggests that the buffer goes at the head of the free list rather than at the end.
B_ASYNC
Asynchronous I/O is being performed on this block. When I/O is done, release the block.
B_DELWRI
The contents of this buffer still need to be written out before the buffer can be reused, even though this block may be on the free list. This is used by the write subroutine when the system expects another write to the same block to occur soon.
B_NOHIDE
Indicates that the data page should not be hidden during direct memory access (DMA) transfer.
B_STALE
The data conflicts with the data on disk because of an I/O error.
B_MORE_DONE
When set, indicates to the receiver of this bufx structure that more structures are queued in the IODONE level. This permits device drivers to handle all completed requests before processing any new requests.
B_SPLIT
When set, indicates that the transfer can begin anywhere within the data buffer.
B_BUFX
A buffer is identified as an extended buf structure if all of the following conditions are met:
  • B_BUFX bit is set in the b_flags field.
  • The pointer obtained by recombining the bx_refptrtop field and the bx_refptrbot field points to the beginning of the structure.
  • The bx_eyecatcher field, which identifies whether the buf structure is extended or not, is equal to the ASCII string "bufx".
B_BUFX_INITIAL
When set, indicates that the buf is extended.
b_forw The forward busy block pointer.
b_back The backward busy block pointer.
av_forw The forward pointer for a driver request queue.
av_back The backward pointer for a driver request queue.
b_iodone Anyone calling the strategy routine must set this field to point to their I/O done routine. This routine is called on the INTIODONE interrupt level when I/O is complete.
b_dev The major and minor device number.
b_bcount The byte count for the data transfer.
b_un.b_addr The memory address of the data buffer.
b_blkno The block number on the device.
b_resid The amount of data not transferred after error.
b_event The anchor for event list.
b_xmemd The cross-memory descriptor.
bx_refptrtop The top half of the reference pointer.
bx_refptrbot The bottom half of the reference pointer.
bx_version The version of the bufx structure.
bx_eyecatcher The field contains the string "bufx", allowing for easy identification of the bufx structure in KDB when dumping data and for structure verification in addition to using the BUFX_VALIDATE macro.
bx_flags Bufx flags with a 64-bit field that can be used for bufx-specific flags that are yet to be defined.
bx_io_priority If the underlying storage devices do not support I/O priority, this value is ignored. The bx_io_priority must be either the value of IOPRIORITY_UNSET (0) or a value from 1 to 15. Lower I/O priority values are considered to be more important than higher values. For example, a value of 1 is considered the highest priority and a value of 15 is considered the lowest priority. The value of IOPRIORITY_UNSET is defined in the sys/extendio.h file.
bx_io_cache_hint If the underlying storage devices do not support I/O cache hints, this value is ignored. The bx_io_cache_hint must be either the value of CH_AGE_OUT_FAST or the value of CH_PAGE_WRITE (defined in the sys/extendio.h file). These values are mutually exclusive. If CH_AGE_OUT_FAST is set, the I/O buffer can be aged out quickly from the storage device buffer cache. This is useful in the situations where the application is already caching the I/O buffer and redundant caching within the storage layer can be avoided. If CH_PAGE_WRITE is set, the I/O buffer is written only to the storage device cache and not to the disk.