struct FatCtx {
struct BlockDevice dev;
unsigned long partition_lba;
struct FatBpb bpb;
unsigned long fat_lba;
unsigned long data_lba;
unsigned long root_cluster;
unsigned long bytes_per_cluster;
}Fields
LBA of FAT32 partition start
LBA of FAT region
LBA of first data cluster
cluster of root directory
Methods
Initialise this context in place from a block device partition
starting at lba (the device is copied into dev).
Returns 0 on success.
Read a cluster into the first bytes_per_cluster bytes of buf (-1
if it is shorter).
Follow FAT chain to find cluster at position idx from start_cluster.
§
unsigned long read(unsigned long inode, unsigned long offset, []unsigned char buf)source · definition§
generic<T> int readdir(unsigned long inode, fn void(&VfsNode, ?&T) cb, ?&T user)source · definition