path: root/firmware/export/fat.h
diff options
authorMichael Sevakis <>2017-01-08 17:14:10 -0500
committerMichael Sevakis <>2017-01-17 14:35:36 -0500
commita931c76b3a46d1884e985a3bfc82b947521dab97 (patch)
tree1141cf9a9a8c123bde3d76d147ee1e910c7c6045 /firmware/export/fat.h
parent0056ea8a256af0e2daaf451af43c00708a31d4df (diff)
Do some debug and preparatory work for ramcache and playlist
The file system rework introduced incompatibility between dircache and the tagcache ramcache and playlist dircache path caching. This update makes changes to filesystem code to reintegrate all that. It also fixes a couple bugs that were found when vetting all the code. The filestream cache was being reset without regard to the stream even if it was shared in write mode (made work of .playlist_control). Better handling of unmounting gives files a better go at force-closing them without risk to disk integrity. Did some miscellaneous pedantic changes. Improved efficiency of testing a file's existence (a little) since the path parser will be shared between file code and parsing for the sake of finding dircache references, not duplicated as before. This commit doesn't reenable said items just for the sake of keeping changes separate and related. Plan for the next is to enable dircache again for the playlists (easy peasy) and reenable tagcache ramcache but *without* the dircache path caching because it's rather substantial to change in itself. The ramcache will still function without dircache. Change-Id: I7e2a9910b866251fa8333e1275f72fcfc8425d2d
Diffstat (limited to 'firmware/export/fat.h')
1 files changed, 5 insertions, 1 deletions
diff --git a/firmware/export/fat.h b/firmware/export/fat.h
index 3aa1e254dc..963c1fe767 100644
--- a/firmware/export/fat.h
+++ b/firmware/export/fat.h
@@ -97,13 +97,15 @@ struct fat_direntry
/* cursor structure used for scanning directories; holds the last-returned
entry information */
+#define FAT_DIRSCAN_RW_VAL (0u - 1u)
struct fat_dirscan_info
unsigned int entry; /* short dir entry index in parent */
unsigned int entries; /* number of dir entries used */
-#define FAT_RW_VAL (0u - 1)
+#define FAT_FILE_RW_VAL (0ul - 1ul)
/* basic FAT file information about where to find a file and who houses it */
struct fat_file
@@ -156,6 +158,8 @@ long fat_readwrite(struct fat_filestr *filestr, unsigned long sectorcount,
void *buf, bool write);
void fat_rewind(struct fat_filestr *filestr);
int fat_seek(struct fat_filestr *filestr, unsigned long sector);
+void fat_seek_to_stream(struct fat_filestr *filestr,
+ const struct fat_filestr *filestr_seek_to);
int fat_truncate(const struct fat_filestr *filestr);
/** Directory stream functions **/