+
+/**
+ * \brief Gets a mount point given the identifier
+ */
+tVFS_Mount *VFS_GetMountByIdent(Uint32 MountID)
+{
+ tVFS_Mount *mnt;
+ for(mnt = gVFS_Mounts; mnt; mnt = mnt->Next)
+ {
+ if(mnt->Identifier == MountID)
+ return mnt;
+ }
+ return NULL;
+}
+
+/**
+ * \brief Updates the mount file buffer
+ *
+ * Updates the ProcFS mounts file buffer to match the current mounts list.
+ */
+void VFS_UpdateMountFile(void)
+{
+ int len = 0;
+ char *buf;
+ tVFS_Mount *mnt;
+
+ // Format:
+ // <device>\t<location>\t<type>\t<options>\n
+
+ for(mnt = gVFS_Mounts; mnt; mnt = mnt->Next)
+ {
+ len += 4 + strlen(mnt->Device) + strlen(mnt->MountPoint)
+ + strlen(mnt->Filesystem->Name) + strlen(mnt->Options);
+ }
+
+ buf = malloc( len + 1 );
+ len = 0;
+ for(mnt = gVFS_Mounts; mnt; mnt = mnt->Next)
+ {
+ strcpy( &buf[len], mnt->Device );
+ len += strlen(mnt->Device);
+ buf[len++] = '\t';
+
+ strcpy( &buf[len], mnt->MountPoint );
+ len += strlen(mnt->MountPoint);
+ buf[len++] = '\t';
+
+ strcpy( &buf[len], mnt->Filesystem->Name );
+ len += strlen(mnt->Filesystem->Name);
+ buf[len++] = '\t';
+
+ strcpy( &buf[len], mnt->Options );
+ len += strlen(mnt->Options);
+ buf[len++] = '\n';
+ }
+ buf[len] = 0;
+
+ SysFS_UpdateFile( giVFS_MountFileID, buf, len );
+ if( gsVFS_MountFile ) free( gsVFS_MountFile );
+ gsVFS_MountFile = buf;
+}