Block Devices
include/block/block.h View source View on GitHubStructs
Section titled “Structs”partition
Section titled “partition” struct partition (8 fields) source
block_device
Section titled “block_device” struct block_device (17 fields) source
§
enum bdev_flags flags §
void *fs_data §
char name[16] §
uint64_t total_sectors §
bool is_removable §
void *driver_data §
uint32_t sector_size §
bool (*read_sector)(struct block_device *disk, uint64_t lba, uint8_t *buffer, uint64_t sector_count) both of these take full priority over the async operations. do not pass go, do not collect two hundred dollars, submit instantly.
these are sync and blocking
these are not used in many areas though, and such, we can get away with instant submission for the most part
§
bool (*write_sector)(struct block_device *disk, uint64_t lba, const uint8_t *buffer, uint64_t sector_count) §
bool (*submit_bio_async)(struct block_device *disk, struct bio_request *bio) immediate asynchronous submission
§
struct bio_scheduler_ops *ops §
struct bio_scheduler *scheduler §
uint64_t partition_count §
struct partition *partitions cc_counted_by(partition_count) bdev_type
Section titled “bdev_type” enum bdev_type (4 variants) source
bdev_flags
Section titled “bdev_flags” enum bdev_flags (3 variants) source
Functions
Section titled “Functions”get_block_device_str
Section titled “get_block_device_str”bdev_skip_coalesce
Section titled “bdev_skip_coalesce”bool bdev_skip_coalesce(struct block_device *disk) source bdev_skip_sched
Section titled “bdev_skip_sched”bool bdev_skip_sched(struct block_device *disk) source bdev_skip_reorder
Section titled “bdev_skip_reorder”bool bdev_skip_reorder(struct block_device *disk) source