< The Linux Kernel
__bread
SYNOPSIS
struct buffer_head * __bread(struct block_device * bdev, sector_t block, unsigned size);
- bdev: the block device to read from
- block: the block number of the first block to be read
- size: the number of bytes to read.
SHORT DESCRIPTION
Reads the specified block(s) and returns a buffer head to the data just read. On error, NULL will be returned.
FULL DESCRIPTION
The function obtains the buffer head by a call to the function __getblk(bdev,block,size) FIXME: Implications?. It then checks whether the data pointed to by the returned buffer head is up to date by a call to buffer_uptodate. If not, a call to __bread_slow(bh returned by __getblk) will bring the data up to date and return the bh on success. This call will suspend the calling thread putting it into the task state TASK_UNINTERRUPTIBLE.
RETURN
The buffer head to the data, which was just read or already cached, or NULL on any error (i.e. I/O error).
This article is issued from
Wikibooks.
The text is licensed under Creative
Commons - Attribution - Sharealike.
Additional terms may apply for the media files.