CardSight 0.1.0
C API reference for the CardSight firmware and application
Loading...
Searching...
No Matches
block_device_operations Struct Reference

Operations a disk driver provides to the block layer. More...

#include <blkdev.h>

Data Fields

int(* read )(struct gendisk *disk, uint64_t sector, void *buffer, uint32_t count)
 Read sectors.
int(* write )(struct gendisk *disk, uint64_t sector, const void *buffer, uint32_t count)
 Write sectors; may be NULL on a disk with GENHD_FL_RDONLY.
int(* flush )(struct gendisk *disk)
 Write out what the disk holds back; NULL when it writes through.
void(* free_disk )(struct gendisk *disk)
 Release driver state when the last reference is gone.

Detailed Description

Operations a disk driver provides to the block layer.

Field Documentation

◆ free_disk

void(* block_device_operations::free_disk) (struct gendisk *disk)

Release driver state when the last reference is gone.

The disk was deleted and nobody has it open; free private_data here.

◆ read

int(* block_device_operations::read) (struct gendisk *disk, uint64_t sector, void *buffer, uint32_t count)

Read sectors.

Sector numbers are relative to the disk, the range was checked, and the buffer is 64-byte aligned.


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