diff options
Diffstat (limited to 'dev/Kernel/src')
| -rw-r--r-- | dev/Kernel/src/DriveMgr.cc | 6 | ||||
| -rw-r--r-- | dev/Kernel/src/FS/NeFS.cc | 19 |
2 files changed, 17 insertions, 8 deletions
diff --git a/dev/Kernel/src/DriveMgr.cc b/dev/Kernel/src/DriveMgr.cc index 6202ffbb..f6e995c8 100644 --- a/dev/Kernel/src/DriveMgr.cc +++ b/dev/Kernel/src/DriveMgr.cc @@ -66,6 +66,12 @@ namespace Kernel return; } + if (pckt->fPacketReadOnly) + { + pckt->fPacketGood = NO; + return; + } + if (!StringBuilder::Equals("fs/detect-packet", pckt->fPacketMime) && pckt->fPacketDrive->fLbaStart > 0 && pckt->fPacketDrive->fLbaEnd > 0) { diff --git a/dev/Kernel/src/FS/NeFS.cc b/dev/Kernel/src/FS/NeFS.cc index 10bcad02..5df4daca 100644 --- a/dev/Kernel/src/FS/NeFS.cc +++ b/dev/Kernel/src/FS/NeFS.cc @@ -64,7 +64,7 @@ _Output BOOL NeFileSystemParser::CreateFork(_Input const Char* catalog_name, _Input NFS_FORK_STRUCT& the_fork) { if (the_fork.DataSize > 0) - { + { auto catalog = this->GetCatalog(catalog_name); if (!catalog) @@ -75,9 +75,10 @@ _Output BOOL NeFileSystemParser::CreateFork(_Input const Char* catalog_name, auto drv = kDiskMountpoint.A(); - NFS_FORK_STRUCT cur_fork; - Lba lba_prev_fork = lba; - Lba lba_next_fork = lba; + NFS_FORK_STRUCT cur_fork{}; + + Lba lba_prev_fork = lba; + Lba lba_next_fork = lba; if (the_fork.Kind == kNeFSDataForkKind) catalog->DataForkSize += the_fork.DataSize; @@ -85,7 +86,7 @@ _Output BOOL NeFileSystemParser::CreateFork(_Input const Char* catalog_name, catalog->ResourceForkSize += the_fork.DataSize; /// do not check for anything. Loop until we get what we want, that is a free fork zone. - while (lba_next_fork >= kNeFSCatalogStartAddress) + do { drv.fPacket.fPacketLba = lba_next_fork; drv.fPacket.fPacketSize = sizeof(NFS_FORK_STRUCT); @@ -93,6 +94,8 @@ _Output BOOL NeFileSystemParser::CreateFork(_Input const Char* catalog_name, drv.fInput(&drv.fPacket); + kcout << "LBA: " << hex_number(lba_next_fork) << endl; + if (cur_fork.Flags & kNeFSFlagCreated) { /// sanity check. @@ -116,17 +119,17 @@ _Output BOOL NeFileSystemParser::CreateFork(_Input const Char* catalog_name, drv.fPacket.fPacketSize = sizeof(NFS_FORK_STRUCT); drv.fPacket.fPacketContent = &the_fork; - drv.fOutput(&drv.fPacket); - /// log what we have now. kcout << "Wrote fork data at: " << hex_number(the_fork.DataOffset) << endl; kcout << "Wrote fork at: " << hex_number(lba) << endl; + drv.fOutput(&drv.fPacket); + return YES; } - } + } while (drv.fPacket.fPacketGood); } return NO; |
