do not shut down the interface on unmount. other partitons (fat, ntfs, etc) may still be mounted on the device!

This commit is contained in:
tantricity 2009-10-16 21:38:51 +00:00
parent bf2d7d1130
commit 3b6561d4ca

View File

@ -73,13 +73,11 @@ bool fatMount (const char* name, const DISC_INTERFACE* interface, sec_t startSec
return false; return false;
if(!interface->isInserted()) { if(!interface->isInserted()) {
interface->shutdown();
return false; return false;
} }
devops = _FAT_mem_allocate (sizeof(devoptab_t) + strlen(name) + 1); devops = _FAT_mem_allocate (sizeof(devoptab_t) + strlen(name) + 1);
if (!devops) { if (!devops) {
interface->shutdown();
return false; return false;
} }
// Use the space allocated at the end of the devoptab struct for storing the name // Use the space allocated at the end of the devoptab struct for storing the name
@ -89,7 +87,6 @@ bool fatMount (const char* name, const DISC_INTERFACE* interface, sec_t startSec
partition = _FAT_partition_constructor (interface, cacheSize, SectorsPerPage, startSector); partition = _FAT_partition_constructor (interface, cacheSize, SectorsPerPage, startSector);
if (!partition) { if (!partition) {
_FAT_mem_free (devops); _FAT_mem_free (devops);
interface->shutdown();
return false; return false;
} }
@ -111,7 +108,6 @@ bool fatMountSimple (const char* name, const DISC_INTERFACE* interface) {
void fatUnmount (const char* name) { void fatUnmount (const char* name) {
devoptab_t *devops; devoptab_t *devops;
PARTITION* partition; PARTITION* partition;
const DISC_INTERFACE *disc;
devops = (devoptab_t*)GetDeviceOpTab (name); devops = (devoptab_t*)GetDeviceOpTab (name);
if (!devops) { if (!devops) {
@ -128,10 +124,8 @@ void fatUnmount (const char* name) {
} }
partition = (PARTITION*)devops->deviceData; partition = (PARTITION*)devops->deviceData;
disc = partition->disc;
_FAT_partition_destructor (partition); _FAT_partition_destructor (partition);
_FAT_mem_free (devops); _FAT_mem_free (devops);
disc->shutdown();
} }
bool fatInit (uint32_t cacheSize, bool setAsDefaultDevice) { bool fatInit (uint32_t cacheSize, bool setAsDefaultDevice) {