| 13 | |
| 14 | namespace fs::Ext2{ |
| 15 | int Identify(PartitionDevice* part){ |
| 16 | ext2_superblock_t* superblock = (ext2_superblock_t*)kmalloc(sizeof(ext2_superblock_t)); |
| 17 | |
| 18 | if(part->ReadBlock(EXT2_SUPERBLOCK_LOCATION / part->parentDisk->blocksize, sizeof(ext2_superblock_t), superblock)){ |
| 19 | return -1; // Disk Error |
| 20 | } |
| 21 | |
| 22 | int isExt2 = 0; |
| 23 | |
| 24 | if(superblock->magic == EXT2_SUPER_MAGIC){ |
| 25 | isExt2 = 1; |
| 26 | } |
| 27 | |
| 28 | kfree(superblock); |
| 29 | |
| 30 | return isExt2; |
| 31 | } |
| 32 | |
| 33 | Ext2Volume::Ext2Volume(PartitionDevice* part, const char* name){ |
| 34 | this->part = part; |
no test coverage detected