Skip to content

Block Devices

struct partition {
struct block_device *disk;
uint64_t start_lba;
uint64_t sector_count;
enum fs_type fs_type;
void *fs_data;
char name[16];
bool mounted;
struct vfs_node *(*mount)(struct partition *);
};

struct partition referenced types:

struct block_device {
enum bdev_flags flags;
enum bdev_type type;
enum fs_type fs_type;
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);
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);
struct bio_scheduler_ops *ops;
struct bio_scheduler *scheduler;
struct bcache *cache;
uint64_t partition_count;
struct partition *partitions;
};

struct block_device referenced types:

enum bdev_type {
BDEV_IDE_DRIVE,
BDEV_NVME_DRIVE,
BDEV_AHCI_DRIVE,
BDEV_ATAPI_DRIVE,
};
enum bdev_flags {
BDEV_FLAG_NO_REORDER = 1,
BDEV_FLAG_NO_COALESCE = 1 << 1,
BDEV_FLAG_NO_SCHED = 1 << 2,
};
char get_block_device_str(enum bdev_type type);

get_block_device_str referenced types:

bool bdev_skip_coalesce(struct block_device *disk);

bdev_skip_coalesce referenced types:

bool bdev_skip_sched(struct block_device *disk);

bdev_skip_sched referenced types:

bool bdev_skip_reorder(struct block_device *disk);

bdev_skip_reorder referenced types: