Miosix
2.0alpha1
|
#include <file_access.h>
Public Member Functions | |
int | kmount (const char *path, intrusive_ref_ptr< FilesystemBase > fs) |
int | umount (const char *path, bool force=false) |
void | umountAll () |
ResolvedPath | resolvePath (std::string &path, bool followLastSymlink=true) |
Static Public Member Functions | |
static FilesystemManager & | instance () |
This class contains information on all the mounted filesystems
|
static |
int miosix::FilesystemManager::kmount | ( | const char * | path, |
intrusive_ref_ptr< FilesystemBase > | fs | ||
) |
Low level mount operation, meant to be used only inside the kernel, and board support packages. It is the only mount operation that can mount the root filesystem.
path | path where to mount the filesystem |
fs | filesystem to mount. Ownership of the pointer is transferred to the FilesystemManager class |
ResolvedPath miosix::FilesystemManager::resolvePath | ( | std::string & | path, |
bool | followLastSymlink = true |
||
) |
Resolve a path to identify the filesystem it belongs
path | an absolute path name, that must start with '/'. Note that this is an inout parameter, the string is modified so as to return the full resolved path. In particular, the returned string differs from the passed one by not containing useless path components, such as "/./" and "//", by not containing back path componenets ("/../"), and may be entirely different from the passed one if a symlink was encountered during name resolution. The use of an inout parameter is to minimize the number of copies of the path string, optimizing for speed and size in the common case, but also means that a copy of the original string needs to be made if the original has to be used later. |
followLastSymlink | true if the symlink in the last path component (the one that does not end with a /, if it exists, has to be followed) |
int miosix::FilesystemManager::umount | ( | const char * | path, |
bool | force = false |
||
) |
Unmounts a filesystem
path | path to a filesytem |
force | true to umount the filesystem even if busy |
void miosix::FilesystemManager::umountAll | ( | ) |
Umount all filesystems, to be called before system shutdown or reboot