This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#7598 - Dircache support for multivolume targets.
Attached to Project:
Rockbox
Opened by Phil Light (phillight) - Monday, 13 August 2007, 23:57 GMT+2
Last edited by Miika Pekkarinen (miipekk) - Tuesday, 11 March 2008, 20:39 GMT+2
Opened by Phil Light (phillight) - Monday, 13 August 2007, 23:57 GMT+2
Last edited by Miika Pekkarinen (miipekk) - Tuesday, 11 March 2008, 20:39 GMT+2
|
DetailsThis patch add support for dircache on targets with multivolume support. Additional volumes are appended to the root directory of the cache with filenames such as <microSD1> in the same way as for the uncached multivolume support.
At the moment I think this only affects the e200 as the only multivolume target with sufficient RAM for dircache to be enabled(?) For targets with hotswap, the cache is rebuilt on insertion/removal of the card. |
This task depends upon
Closed by Miika Pekkarinen (miipekk)
Tuesday, 11 March 2008, 20:39 GMT+2
Reason for closing: Accepted
Tuesday, 11 March 2008, 20:39 GMT+2
Reason for closing: Accepted
This version also no longer increases the dircache stack size, as this should be unnecessary.
...
memset(ce, 0, sizeof(struct dircache_entry));
#if defined(HAVE_MULTIVOLUME) && !defined(SIMULATOR)
if (volume > 0)
{
snprintf(ce->d_name, VOL_ENUM_POS + 3, VOL_NAMES, volume);
ce->name_len = VOL_ENUM_POS + 3;
...
You are trying to write to a memory location that is just a null pointer reference (ce->d_name). You have to allocate ce->d_name first before using it. And the second parameter "size" for snprintf (i.e., VOL_ENUM_POS+3) should be the maximum allocated size of the buffer (ce->d_name) to prevent buffer overflows, not the length of the data to be written.
But I will look again once that problem is solved, no time now to fix it:/
I've also fixed compilation for non-multivolume targets.