breada Kernel Service

Purpose

Reads in the specified block and then starts I/O on the read-ahead block.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/buf.h>

struct buf *breada ( dev,  blkno,  rablkno)
dev_t   dev;
daddr_t  blkno;
daddr_t  rablkno;

Parameters

Item Description
dev Specifies the device containing the block to be read.
blkno Specifies the block to be read.
rablkno Specifies the read-ahead block to be read.

Description

The breada kernel service assigns a buffer to the given block. If the specified block is already in the buffer cache, then the bread service is called to:

Otherwise, the getblk service is called to assign a free buffer to the specified block and to read the data into the buffer. The breada service waits for I/O to complete and then returns the buffer header.

I/O is also started on the specified read-ahead block if the free list is not empty and the block is not already in the cache. However, the breada service does not wait for I/O to complete on this read-ahead block.

"Block I/O Buffer Cache Kernel Services: Overview" in AIX® Version 7.1 Kernel Extensions and Device Support Programming Concepts summarizes how the getblk, bread, breada, and brelse services uniquely manage the block I/O buffer cache.

Execution Environment

The breada kernel service can be called from the process environment only.

Return Values

The breada service returns the address of the selected buffer's header. A nonzero value for B_ERROR in the b_flags field of the buffer header (buf structure) indicates an error. If this occurs, the caller should release the buffer associated with the block using the brelse kernel service.

On a platform that supports storage keys, the buffer header is allocated from the storage protected by the KKEY_BLOCK_DEV kernel key.