summaryrefslogtreecommitdiffhomepage
path: root/dev/Kernel/src/FS
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-01-05 12:19:58 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2025-01-05 12:19:58 +0100
commite0633b442140d49e08af6759bd07c89e16ef0e2a (patch)
treec83a84f5df6b3f5d486a53e19cc8ad55cd082587 /dev/Kernel/src/FS
parent5903f0c8eca69916c3acffcbe0a20a9af36fdf27 (diff)
ADD: Ran format command and refactors too.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/Kernel/src/FS')
-rw-r--r--dev/Kernel/src/FS/NeFS.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/dev/Kernel/src/FS/NeFS.cc b/dev/Kernel/src/FS/NeFS.cc
index 3dcf13da..b0a7c6c6 100644
--- a/dev/Kernel/src/FS/NeFS.cc
+++ b/dev/Kernel/src/FS/NeFS.cc
@@ -309,7 +309,7 @@ _Output NFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char*
return nullptr;
}
-
+
constexpr SizeT kDefaultForkSize = kNeFSForkSize;
NFS_CATALOG_STRUCT* child_catalog = new NFS_CATALOG_STRUCT();
@@ -460,6 +460,7 @@ _Output NFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char*
/// @return If it was sucessful, see err_global_get().
bool NeFileSystemParser::Format(_Input _Output DriveTrait* drive, _Input const Lba endLba, _Input const Int32 flags, const Char* part_name)
{
+#ifdef ZKA_EPM_SUPPORT
if (*part_name == 0 ||
endLba == 0)
return false;
@@ -490,14 +491,14 @@ bool NeFileSystemParser::Format(_Input _Output DriveTrait* drive, _Input const L
if (flags & kNeFSPartitionTypeBoot)
{
// make it bootable when needed.
- Char bufEpmHdr[kNeFSSectorSz] = {0};
+ Char buf_epm[kNeFSSectorSz] = {0};
- BOOT_BLOCK_STRUCT* epm_boot = (BOOT_BLOCK_STRUCT*)bufEpmHdr;
+ BOOT_BLOCK_STRUCT* epm_boot = (BOOT_BLOCK_STRUCT*)buf_epm;
// Write a new EPM entry.
constexpr auto kFsName = "NeFS";
- constexpr auto kBlockName = "ZKA:";
+ constexpr auto kBlockName = "ZkaOS:";
rt_copy_memory(reinterpret_cast<VoidPtr>(const_cast<Char*>(kFsName)), epm_boot->Fs, rt_string_len(kFsName));
@@ -533,7 +534,7 @@ bool NeFileSystemParser::Format(_Input _Output DriveTrait* drive, _Input const L
epm_boot->LbaEnd = endLba;
epm_boot->NumBlocks = cnt;
- drive->fPacket.fPacketContent = bufEpmHdr;
+ drive->fPacket.fPacketContent = buf_epm;
drive->fPacket.fPacketSize = sizeof(EPM_BOOT_BLOCK);
drive->fPacket.fPacketLba = outEpmLba;
@@ -616,6 +617,7 @@ bool NeFileSystemParser::Format(_Input _Output DriveTrait* drive, _Input const L
drive->fInput(&drive->fPacket);
}
+#endif // ZKA_EPM_SUPPORT
return false;
}
@@ -817,7 +819,6 @@ kNeFSSearchThroughCatalogList:
return nullptr;
}
-
/// ignore unallocated catalog, break
if (!(temporary_catalog.Flags & kNeFSFlagCreated))
{
@@ -846,8 +847,8 @@ kNeFSSearchThroughCatalogList:
if (local_search_first)
{
- local_search_first = false;
- start_catalog_lba = kStartCatalogList;
+ local_search_first = false;
+ start_catalog_lba = kStartCatalogList;
goto kNeFSSearchThroughCatalogList;
}