Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#11118 - Reduce the number of cached sector in the fat driver

Attached to Project: Rockbox
Opened by amaury pouly (pamaury) - Wednesday, 17 March 2010, 14:26 GMT+2
Last edited by amaury pouly (pamaury) - Monday, 22 March 2010, 11:48 GMT+2
Task Type Patches
Category Drivers
Status Closed
Assigned To amaury pouly (pamaury)
Player Type All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

This patch reduces the number of cached sector in the fat_dir structure because it's useless.
It requires a nearly complete rewrite of fat_getnext.
At the same time, I made it check more things about LFN entries:
* last long entry attribute in the first entry
* ordinal are all present and decreasing
I could also implement checkuming but I I fear that not all fat drivers implement it.

Please review and test it !
   fat.diff (13.8 KiB)
 b/firmware/drivers/fat.c |  198 +++++++++++++++++++----------------------------
 b/firmware/export/fat.h  |    6 +
 2 files changed, 89 insertions(+), 115 deletions(-)

This task depends upon

Closed by  amaury pouly (pamaury)
Monday, 22 March 2010, 11:48 GMT+2
Reason for closing:  Accepted
Additional comments about closing:  r25290
Comment by Marc Aarts (topik) - Friday, 19 March 2010, 11:48 GMT+2
Amaury, I have tested it on my Nano2G and Sansa Fuze and I have no noticeable differences.

Rockbox starts fine, playing music and a random selection of plugins work.
Comment by amaury pouly (pamaury) - Friday, 19 March 2010, 23:54 GMT+2
New patch, mostly cosmetics.
   fat.diff (14 KiB)
 b/firmware/drivers/fat.c |  200 +++++++++++++++++++----------------------------
 b/firmware/export/fat.h  |    6 +
 2 files changed, 88 insertions(+), 118 deletions(-)

Comment by Magnus Holmgren (learman) - Saturday, 20 March 2010, 16:40 GMT+2
But why is it useless? A cache ought to be useful for HD-based targets, even if it is useless for flash-based targets...
Comment by Torne Wuff (torne) - Saturday, 20 March 2010, 16:50 GMT+2
Only the most recently read sector in the cache is ever reused (the structure of FAT directories guarantees it). Keeping the other two sectors around has *zero* benefit, on any target.
Comment by amaury pouly (pamaury) - Sunday, 21 March 2010, 00:12 GMT+2
New patch. I fixed a potential buffer overflow and several other things :)
I tested it to the limit and it works correctly.
   fat.diff (14.7 KiB)
 b/firmware/drivers/fat.c |  210 ++++++++++++++++++++---------------------------
 b/firmware/export/fat.h  |    7 +
 2 files changed, 98 insertions(+), 119 deletions(-)

Loading...