make remount work

This commit is contained in:
Glenn Maynard
2005-01-27 03:54:49 +00:00
parent 67d5bfd6d5
commit 7df474b776
4 changed files with 15 additions and 5 deletions
+1
View File
@@ -176,6 +176,7 @@ bool RageFileDriverDirect::Remount( const CString &sPath )
root = sPath;
if( root.Right(1) != "/" )
root += '/';
((DirectFilenameDB *) FDB)->SetRoot( sPath );
/* If the root path doesn't exist, create it. */
CreateDirectories( root );
@@ -226,6 +226,12 @@ bool CreateDirectories( CString Path )
DirectFilenameDB::DirectFilenameDB( CString root_ )
{
ExpireSeconds = 30;
SetRoot( root_ );
}
void DirectFilenameDB::SetRoot( CString root_ )
{
root = root_;
if( root.Right(1) != "/" )
root += '/';
+4 -3
View File
@@ -35,12 +35,13 @@ bool PathReady( CString path );
#include "RageUtil_FileDB.h"
class DirectFilenameDB: public FilenameDB
{
public:
DirectFilenameDB( CString root );
void SetRoot( CString root );
protected:
virtual void PopulateFileSet( FileSet &fs, const CString &sPath );
CString root;
public:
DirectFilenameDB( CString root_ );
};
#endif
+4 -2
View File
@@ -503,13 +503,15 @@ void RageFileManager::Remount( CString sMountpoint, CString sPath )
RageFileDriver *pDriver = FILEMAN->GetFileDriver( sMountpoint );
if( pDriver == NULL )
{
LOG->Warn( "Remount(%s,%s): mountpoint not found",
sMountpoint.c_str(), sPath.c_str() );
if( LOG )
LOG->Warn( "Remount(%s,%s): mountpoint not found", sMountpoint.c_str(), sPath.c_str() );
return;
}
if( !pDriver->Remount(sPath) )
LOG->Warn( "Remount(%s,%s): remount failed (does the driver support remounting?)" );
else
pDriver->FlushDirCache( "" );
FILEMAN->ReleaseFileDriver( pDriver );
}