summaryrefslogtreecommitdiffstats
path: root/firmware/export
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2007-01-29 22:26:16 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2007-01-29 22:26:16 +0000
commit0f03e3af3104a78d60f13e7eeb5b9ace12cc0bb3 (patch)
treeb094fd1115f3377d4a28a633c36533a55e5d4d3c /firmware/export
parent1bb3d2601f6198f945f6a8b5852579881f63072a (diff)
downloadrockbox-0f03e3af3104a78d60f13e7eeb5b9ace12cc0bb3.tar.gz
rockbox-0f03e3af3104a78d60f13e7eeb5b9ace12cc0bb3.zip
Changed fat_getnext():
1) Fixed a bug where really long filenames could be messed up if they spanned 3 sectors 2) Now uses 2 buffers instead of 3, without copying the buffers with memcpy() 3) Can now use aligned sector reads, first step towards iPod 5.5G 80GB git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12151 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/fat.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/firmware/export/fat.h b/firmware/export/fat.h
index 2680fdf751..93b60e6dc0 100644
--- a/firmware/export/fat.h
+++ b/firmware/export/fat.h
@@ -73,13 +73,19 @@ struct fat_file
#endif
};
+#define FAT_DIR_BUFSECTORS 2 /* Needs to be an even number, at least 2 */
+#define FAT_DIR_BUFSIZE (SECTOR_SIZE*FAT_DIR_BUFSECTORS)
+
struct fat_dir
{
unsigned int entry;
unsigned int entrycount;
long sector;
struct fat_file file;
- unsigned char sectorcache[3][SECTOR_SIZE];
+ /* The buffer needs to be at least 3 sectors, so we make it 2*2 and
+ alternate between them */
+ unsigned char sectorcache[2][FAT_DIR_BUFSIZE];
+ unsigned int bufindex; /* Which buffer to be loaded next */
};