block_request Struct Reference

A block device request. More...

#include <device.h>

Collaboration diagram for block_request:

Collaboration graph
[legend]

Data Fields

struct slist buf_list
void(* req_done )(struct block_device *bdev, struct block_request *req)
void * context
int status
struct block_devicebdev

Detailed Description

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 69 of file device.h.


Field Documentation

List of buffers associated with this request

Definition at line 71 of file device.h.

Referenced by blk_req_add_buffer(), and blk_req_add_buffer_list().

Arbitrary data pointer associated with this request, for use by the submitter.

Definition at line 94 of file device.h.

Referenced by aesblk_prepare_req(), block_copy_set_dest(), block_copy_set_source(), and 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.

Parameters:
bdev The Block Device that handled the request
req The request that was completed.

Referenced by aesblk_prepare_req(), block_copy_set_dest(), block_copy_set_source(), and 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 105 of file device.h.

Referenced by aesblk_prepare_req(), msc_read_worker(), and msc_write_worker().


The documentation for this struct was generated from the following file:

Generated on Tue Sep 15 10:22:17 2009 for libavr32 by  doxygen 1.5.8