summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2017-02-06 02:25:22 -0500
committerMichael Sevakis <jethead71@rockbox.org>2017-02-06 02:25:22 -0500
commit29c493dd74b52b2bbd9b22f6e24ce75a338bf534 (patch)
tree48625e5b4117010c34e6ce943f0f85113e9e09f3
parentd7871914acd2ed77f43344e36e08944524a67d9e (diff)
downloadrockbox-29c493dd74b52b2bbd9b22f6e24ce75a338bf534.tar.gz
rockbox-29c493dd74b52b2bbd9b22f6e24ce75a338bf534.zip
Fix a bug in disk.c that really wasn't affecting anything.
volume_onmount_internal() was being given the next volume to mount instead of the one just mounted. Only dircache was being notified for now, which always attempts to scan everything that needs to be rebuilt, currently making the volume parameter value immaterial. Put things in the right place and also set the disk sector multiplier before notifying anybody of the new volume. Change-Id: Ibc8f26c1d1eca672c753280b49fd8259fde51047
-rw-r--r--firmware/common/disk.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/firmware/common/disk.c b/firmware/common/disk.c
index 3a2d27e0d7..f32125e8a3 100644
--- a/firmware/common/disk.c
+++ b/firmware/common/disk.c
@@ -199,8 +199,6 @@ int disk_mount(int drive)
sizeof(fat_partition_types)) == NULL)
continue; /* not an accepted partition type */
- bool success = false;
-
#ifdef MAX_LOG_SECTOR_SIZE
for (int j = 1; j <= (MAX_LOG_SECTOR_SIZE/SECTOR_SIZE); j <<= 1)
{
@@ -210,9 +208,9 @@ int disk_mount(int drive)
pinfo[i].size *= j;
mounted++;
vol_drive[volume] = drive; /* remember the drive for this volume */
- volume = get_free_volume(); /* prepare next entry */
disk_sector_multiplier[drive] = j;
- success = true;
+ volume_onmount_internal(IF_MV(volume));
+ volume = get_free_volume(); /* prepare next entry */
break;
}
}
@@ -221,13 +219,10 @@ int disk_mount(int drive)
{
mounted++;
vol_drive[volume] = drive; /* remember the drive for this volume */
+ volume_onmount_internal(IF_MV(volume));
volume = get_free_volume(); /* prepare next entry */
- success = true;
}
#endif /* MAX_LOG_SECTOR_SIZE */
-
- if (success)
- volume_onmount_internal(IF_MV(volume));
}
if (mounted == 0 && volume != -1) /* none of the 4 entries worked? */