fix(kernel/vfs): support multiple roots

This commit is contained in:
2025-04-08 05:04:04 +00:00
parent a1b58bacd8
commit 3315d79742
10 changed files with 118 additions and 39 deletions

View File

@ -132,7 +132,7 @@ namespace vfs
FileNode *CacheSearchReturnLast(FileNode *Parent, const char **Path);
FileNode *CacheRecursiveSearch(FileNode *Root, const char *NameOrPath, bool IsName);
FileNode *CacheLookup(const char *Path);
FileNode *CacheLookup(FileNode *Parent, const char *Path);
FileNode *CreateCacheNode(FileNode *Parent, Inode *Node, const char *Name, mode_t Mode);
int RemoveCacheNode(FileNode *Node);

View File

@ -131,6 +131,7 @@ namespace vfs
public:
dev_t DeviceID = -1;
ino_t NextInode = 0;
std::string RootName;
int Lookup(struct Inode *Parent, const char *Name, struct Inode **Result);
int Create(struct Inode *Parent, const char *Name, mode_t Mode, struct Inode **Result);
@ -146,4 +147,4 @@ namespace vfs
};
}
bool MountRAMFS(Inode *Parent, const char *Name, size_t Index);
bool MountRAMFS(FileNode *Parent, const char *Name, size_t Index);

View File

@ -0,0 +1,31 @@
/*
This file is part of Fennix Kernel.
Fennix Kernel is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
Fennix Kernel is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
namespace Subsystem
{
namespace Linux
{
void InitializeSubSystem();
}
namespace Windows
{
void InitializeSubSystem();
}
}