Go to the documentation of this file.
18 #ifndef __LIB_LIBFS_FILESYSTEMSERVER_H
19 #define __LIB_LIBFS_FILESYSTEMSERVER_H
Simple filesystem path parser.
List< FileSystemRequest * > * m_requests
Contains ongoing requests.
bool redirectRequest(const char *path, FileSystemMessage *msg)
Try to forward the given FileSystemMessage to a mount file system.
FileCache * findFileCache(const char *path) const
Search the cache for an entry.
void setRoot(Directory *newRoot)
Change the filesystem root directory.
u32 getNextInode()
Get next unused inode.
FileType
All possible filetypes.
FileCache * lookupFile(const FileSystemPath &path)
Retrieve a File from storage.
Represents a mounted filesystem.
virtual bool retryRequests()
Retry any pending requests.
Directory File functionality.
u32 ProcessID
Process Identification Number.
void sendResponse(FileSystemMessage *msg) const
Send response for a FileSystemMessage.
FileSystem::Result unregisterFile(const char *path)
Remove a File from the FileSystemServer.
Abstract filesystem class.
Represents a file present on a FileSystem.
void removeFileFromCache(FileCache *cache, File *file)
Remove a File from the cache.
void mountHandler(FileSystemMessage *msg)
Process a filesystem mount request message.
FileCache * insertFileCache(File *file, const char *pathFormat)
Inserts a file into the in-memory filesystem tree.
Encapsulates a pending FileSystemMessage.
FileSystem::Result waitFileHandler(FileSystemRequest &req)
Handle a WaitFile request.
FileSystemMount * m_mounts
Table with mounted file systems (only used by the root file system).
FileSystemServer(Directory *root, const char *path)
Constructor function.
HashTable< u32, File * > m_inodeMap
Contains a mapping of inode number to file of all cached files.
const char * m_mountPath
Mount point path.
void pathHandler(FileSystemMessage *msg)
Process an incoming filesystem request using a path.
unsigned int u32
Unsigned 32-bit number.
FileSystem::Result inodeHandler(FileSystemRequest &req)
Handle a request for a File specified by its inode.
unsigned int Size
Any sane size indicator cannot go negative.
virtual File * createFile(const FileSystem::FileType type)
Create a new file.
FileSystem::Result processRequest(FileSystemRequest &req)
Process a FileSystemRequest.
FileSystem::Result registerDirectory(Directory *dir, const char *path)
Register a new Directory.
Template class which serves incoming messages from Channels using MessageHandlers.
FileSystem::Result mount()
Mount the FileSystem.
static const Size MaximumFileSystemMounts
Maximum number of supported file system mount entries.
const char * getMountPath() const
Get mount path.
const ProcessID m_pid
Process identifier.
virtual ~FileSystemServer()
Destructor function.
Result
Result code for filesystem Actions.
static const Size MaximumWaitSetCount
Maximum number of WaitSet entries supported.
void clearFileCache(FileCache *cache=ZERO)
Cleans up the entire file cache (except opened file caches and root).
FileCache * m_root
Root entry of the filesystem tree.
Directory * getParentDirectory(const char *path)
Retrieve parent Directory for a file.
void getFileSystemsHandler(FileSystemMessage *msg)
Read the file system mounts table.
FileSystem::Result registerFile(File *file, const char *path)
Register a new File.