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

Method PartitionDevice

Kernel/src/storage/partitiondevice.cpp:5–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include <string.h>
4
5PartitionDevice::PartitionDevice(uint64_t startLBA, uint64_t endLBA, DiskDevice* disk) : Device(TypePartitionDevice){
6 this->startLBA = startLBA;
7 this->endLBA = endLBA;
8 this->parentDisk = disk;
9
10 flags = FS_NODE_BLKDEVICE;
11
12 char buf[18];
13 strcpy(buf, parentDisk->GetName());
14 strcat(buf, "p");
15 itoa(parentDisk->nextPartitionNumber++, buf + strlen(buf), 10);
16
17 SetName(buf);
18}
19
20int PartitionDevice::ReadAbsolute(uint64_t offset, uint32_t count, void* buffer){
21 if(offset + count > (endLBA - startLBA) * parentDisk->blocksize) return 2;

Callers

nothing calls this directly

Calls 5

strcpyFunction · 0.85
strcatFunction · 0.85
strlenFunction · 0.85
itoaFunction · 0.50
GetNameMethod · 0.45

Tested by

no test coverage detected