MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / Read

Method Read

Kernel/src/fs/fat32.cpp:142–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140 }
141
142 ssize_t Fat32Volume::Read(Fat32Node* node, size_t offset, size_t size, uint8_t *buffer){
143 if(!node->inode || node->flags & FS_NODE_DIRECTORY) return -1;
144
145 int count;
146 void* _buf = ReadClusterChain(node->inode, &count, size);
147
148 if(static_cast<unsigned>(count) * bootRecord->bpb.sectorsPerCluster * part->parentDisk->blocksize < size) return 0;
149
150 memcpy(buffer, _buf, size);
151 return size;
152 }
153
154 ssize_t Fat32Volume::Write(Fat32Node* node, size_t offset, size_t size, uint8_t *buffer){
155 return -EROFS;

Callers

nothing calls this directly

Calls 1

memcpyFunction · 0.85

Tested by

no test coverage detected