extern char *gsVFS_MountFile;
// === PROTOTYPES ===
- int VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *ArgString);
-void VFS_UpdateMountFile();
+ int VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *Options);
+void VFS_UpdateMountFile(void);
// === GLOBALS ===
- int glVFS_MountList = 0;
+tMutex glVFS_MountList;
tVFS_Mount *gVFS_Mounts;
tVFS_Mount *gVFS_RootMount = NULL;
// === CODE ===
/**
- * \fn int VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *Options)
* \brief Mount a device
* \param Device Device string to mount
* \param MountPoint Destination for the mount
* \param Filesystem Filesystem to use for the mount
* \param Options Options to be passed to the filesystem
* \return -1 on Invalid FS, -2 on No Mem, 0 on success
+ *
+ * Mounts the filesystem on \a Device at \a MountPoint using the driver
+ * \a Filesystem. The options in the string \a Options is passed to the
+ * driver's mount.
*/
int VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *Options)
{
// Get the filesystem
fs = VFS_GetFSByName(Filesystem);
if(!fs) {
- Warning("VFS_Mount - Unknown FS Type '%s'", Filesystem);
+ Log_Warning("VFS", "VFS_Mount - Unknown FS Type '%s'", Filesystem);
return -1;
}
if(!gVFS_RootMount) gVFS_RootMount = mnt;
// Add to mount list
- LOCK( &glVFS_MountList );
+ Mutex_Acquire( &glVFS_MountList );
{
tVFS_Mount *tmp;
mnt->Next = NULL;
gVFS_Mounts = mnt;
}
}
- RELEASE( &glVFS_MountList );
+ Mutex_Release( &glVFS_MountList );
- Log("VFS_Mount: Mounted '%s' to '%s' ('%s')", Device, MountPoint, Filesystem);
+ Log_Log("VFS", "Mounted '%s' to '%s' ('%s')", Device, MountPoint, Filesystem);
VFS_UpdateMountFile();
}
/**
- * \fn void VFS_UpdateMountFile()
* \brief Updates the mount file buffer
+ *
+ * Updates the ProcFS mounts file buffer to match the current mounts list.
*/
-void VFS_UpdateMountFile()
+void VFS_UpdateMountFile(void)
{
int len = 0;
char *buf;