Added fsdevGetDeviceFileSystem().

This commit is contained in:
yellows8 2018-10-12 22:13:14 -04:00
parent c1b4b95bd7
commit 52686826d1
2 changed files with 14 additions and 0 deletions

View File

@ -36,6 +36,9 @@ int fsdevUnmountDevice(const char *name);
/// This is not used automatically at device unmount.
Result fsdevCommitDevice(const char *name);
/// Returns the FsFileSystem for the specified device. Returns NULL when the specified device isn't found.
FsFileSystem* fsdevGetDeviceFileSystem(const char *name);
/// Returns the FsFileSystem for the default device (SD card), if mounted. Used internally by romfs_dev.
FsFileSystem* fsdevGetDefaultFileSystem(void);

View File

@ -456,6 +456,17 @@ Result fsdevUnmountAll(void)
return 0;
}
FsFileSystem* fsdevGetDeviceFileSystem(const char *name)
{
fsdev_fsdevice *device;
device = fsdevFindDevice(name);
if(device==NULL)
return NULL;
return &device->fs;
}
FsFileSystem* fsdevGetDefaultFileSystem(void)
{
if(!fsdev_initialised) return NULL;