Introduction   Client Library API Reference   IDL Interface   File List   Index  

Requests
[Generic Block Interface Client API]

Deliver block requests. More...

Data Structures

struct  l4blk_sg_phys_elem
struct  l4blk_sg_ds_elem
struct  l4blk_blk_request
struct  l4blk_request

Defines

#define L4BLK_REQUEST_READ   0x00000001
#define L4BLK_REQUEST_WRITE   0x00000002
#define L4BLK_REQUEST_METADATA   0x00000001
#define L4BLK_UNPROCESSED   0x00000000
#define L4BLK_DONE   0x00000001
#define L4BLK_ERROR   0x00000002
#define L4BLK_SKIPPED   0x00000003

Typedefs

typedef struct l4blk_request l4blk_request_t
typedef L4_CV void(* l4blk_callback_fn_t )(l4blk_request_t *request, int status, int error)
typedef struct l4blk_sg_phys_elem l4blk_sg_phys_elem_t
typedef struct l4blk_sg_ds_elem l4blk_sg_ds_elem_t
typedef struct l4blk_blk_request l4blk_blk_request_t

Functions

L4_CV int l4blk_do_request (l4blk_request_t *request)
 Execute request (synchronously).
L4_CV int l4blk_put_request (l4blk_request_t *request)
 Send request to driver.
L4_CV int l4blk_get_status (l4blk_request_t *request)
 Check status of a request.
L4_CV int l4blk_get_error (l4blk_request_t *request)
 Return driver error code.

Detailed Description

Deliver block requests.


Define Documentation

#define L4BLK_REQUEST_READ   0x00000001

Block read request

Definition at line 157 of file types.h.

#define L4BLK_REQUEST_WRITE   0x00000002

Block write request

Definition at line 160 of file types.h.

#define L4BLK_REQUEST_METADATA   0x00000001

Metadata request

Definition at line 168 of file types.h.

#define L4BLK_UNPROCESSED   0x00000000

Not yet proccessed

Definition at line 184 of file types.h.

#define L4BLK_DONE   0x00000001

Successfully done

Definition at line 187 of file types.h.

#define L4BLK_ERROR   0x00000002

I/O error

Definition at line 190 of file types.h.

#define L4BLK_SKIPPED   0x00000003

Skipped

Definition at line 193 of file types.h.


Typedef Documentation

Request type

Definition at line 52 of file types.h.

typedef L4_CV void(* l4blk_callback_fn_t)(l4blk_request_t *request, int status, int error)

Request done callback function prototype.

Parameters:
request Request descriptor
status Request status
error Error code

Definition at line 62 of file types.h.

Scatter-gather list element (phys. buffer address)

Scatter-gather list element (dataspace region)

Server request structure, it contains all information which are transfered to a block device server


Function Documentation

L4_CV int l4blk_do_request ( l4blk_request_t request  ) 

Execute request (synchronously).

Parameters:
request Request structure
Returns:
0 on success (executed request), error code otherwise.
Send the request to the driver an block until it is finished.

L4_CV int l4blk_put_request ( l4blk_request_t request  ) 

Send request to driver.

Parameters:
request Request structure, it describes the block request
Returns:
0 on succcess (sent requests to the driver), error code otherwise.
Send the request to the driver and return immediately. There are several ways to check the status of the requests:
  • a semaphore can be specified for each request (wait element of the request structure) which is incremented if the request is finished
  • a callback function can be specified in the request structure (done) which will be called if the request is finished. Note that this function is be called in the context of a different thread
  • the status of a request can be checked at any time using the l4blk_get_status() function

L4_CV int l4blk_get_status ( l4blk_request_t request  ) 

Check status of a request.

Parameters:
request Request structure
Returns:
Request status (>= 0):

L4_CV int l4blk_get_error ( l4blk_request_t request  ) 

Return driver error code.

Parameters:
request Request structure
Returns:
Error code returned by ther device driver, -L4_EINVAL if invalid request structure.
Return the error code returned by the driver, it can be used to check the error reason if the request status was set to L4BLK_ERROR.


Generic Block Interface Reference Manual, written by Lars Reuther  © 2000-2003