A block device request. More...
#include <device.h>

Data Fields | |
| struct slist | buf_list |
| void(* | req_done )(struct block_device *bdev, struct block_request *req) |
| void * | context |
| enum status_code | status |
| struct block_device * | bdev |
A block device request.
This structure represents an asynchronous request to a block device. It is allocated by calling block_device::prepare_req(). After initializing all the necessary fields, call block_request::req_submit() to submit it for I/O. When it is done, block_request::req_done() will be called by the driver.
Definition at line 73 of file device.h.
| struct block_device* block_request::bdev |
The block request to which this request belongs
Definition at line 112 of file device.h.
Referenced by blk_req_get_blocks_xfered(), blk_req_get_bytes_xfered(), block_alloc_request(), block_free_request(), block_prepare_req(), block_submit_buf_list(), block_submit_req(), dataflash_alloc_req(), and dataflash_get_page_block_shift().
| struct slist block_request::buf_list |
List of buffers associated with this request
Definition at line 75 of file device.h.
Referenced by blk_req_add_buffer(), blk_req_add_buffer_list(), dataflash_alloc_req(), and dataflash_submit_buf_list().
| void* block_request::context |
Arbitrary data pointer associated with this request, for use by the submitter.
Definition at line 98 of file device.h.
Referenced by msc_do_read().
| void(* block_request::req_done)(struct block_device *bdev, struct block_request *req) |
Function provided by the client to be called when this request is completed.
| bdev | The Block Device that handled the request | |
| req | The request that was completed. |
Definition at line 85 of file device.h.
Referenced by msc_do_read().
Status code set by the block device driver upon completion of this request.
This field is always updated before req_done() is called, and before buf_list_done() if an error occurred during transfer of that particular buffer list. While the transfer is still in progress, including during the last buf_list_done() callback, it contains the value -STATUS_IN_PROGRESS.
Definition at line 109 of file device.h.
Referenced by dataflash_prepare_req(), msc_read_worker(), and msc_write_worker().
1.6.3