Block I/O Requests
include/block/bio.h View source View on GitHubStructs
Section titled “Structs”bio_request
Section titled “bio_request” struct bio_request (19 fields) source
everything WITHOUT the / const / comment next to it can be changed by the scheduler during optimizations
REQUIRED to be set by sender
§
enum bio_request_priority priority starting priority - can get boosted
§
struct block_device *disk §
uint64_t lba §
void *buffer §
uint64_t size buffer size in bytes
§
uint64_t sector_count sectors to read/write
§
bool write OPTIONALLY set by sender
§
void (*on_complete)(struct bio_request *) §
void *user_data §
volatile bool done set upon completion
§
enum bio_request_status status §
void *driver_private §
void *driver_private2 §
bool skip coalescing
§
bool is_aggregate §
struct bio_request *next_coalesced §
uint64_t enqueue_time priority boosted to URGENT after enough waiting around
§
uint8_t boost_count boosts are accelerated if it boosts often
bio_request_priority
Section titled “bio_request_priority” enum bio_request_priority (5 variants) source
bio_request_status
Section titled “bio_request_status” enum bio_request_status : int32_t (13 variants) source
§
BIO_STATUS_OK = 0 §
BIO_STATUS_INFLIGHT = -1 §
BIO_STATUS_INVAL_ARG = -2 §
BIO_STATUS_INVAL_INTERNAL = -3 §
BIO_STATUS_TIMEOUT = -4 §
BIO_STATUS_DEVICE_FAULT = -5 §
BIO_STATUS_UNCORRECTABLE = -6 §
BIO_STATUS_ABRT = -7 §
BIO_STATUS_MEDIA_CHANGE = -8 §
BIO_STATUS_ID_NOT_FOUND = -9 §
BIO_STATUS_BAD_SECTOR = -10 §
BIO_STATUS_WRITE_PROTECT = -11 §
BIO_STATUS_UNKNOWN_ERR = -12 Functions
Section titled “Functions”bio_create_write
Section titled “bio_create_write”struct bio_request * bio_create_write(
struct block_device *d,
uint64_t lba,
uint64_t sectors,
uint64_t size,
void (*cb)(struct bio_request *),
void *user,
void *buf
) source bio_create_read
Section titled “bio_create_read”struct bio_request * bio_create_read(
struct block_device *d,
uint64_t lba,
uint64_t sectors,
uint64_t size,
void (*cb)(struct bio_request *),
void *user,
void *buf
) source bio_request_free
Section titled “bio_request_free”void bio_request_free(struct bio_request *req) source Macros
Section titled “Macros”bio_request_from_list_node
Section titled “bio_request_from_list_node”#define bio_request_from_list_node(ln) source Expansion
#define bio_request_from_list_node(ln) \
(container_of(ln, struct bio_request, list))