[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 1

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

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 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.

Implementation Specifics

The breada kernel service is part of Base Operating System (BOS) Runtime.

Related Information

The bread kernel service, iowait kernel service.

The ddstrategy device driver entry point.

Block I/O Buffer Cache Kernel Services: Overview and I/O Kernel Services in AIX Version 4.3 Kernel Extensions and Device Support Programming Concepts.


[ Previous | Next | Contents | Home | Search ]