diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2017-01-08 17:14:10 -0500 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2017-01-17 14:35:36 -0500 |
commit | a931c76b3a46d1884e985a3bfc82b947521dab97 (patch) | |
tree | 1141cf9a9a8c123bde3d76d147ee1e910c7c6045 /firmware/export/fat.h | |
parent | 0056ea8a256af0e2daaf451af43c00708a31d4df (diff) | |
download | rockbox-a931c76b3a46d1884e985a3bfc82b947521dab97.tar.gz rockbox-a931c76b3a46d1884e985a3bfc82b947521dab97.zip |
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')
-rw-r--r-- | firmware/export/fat.h | 6 |
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 | |||
97 | 97 | ||
98 | /* cursor structure used for scanning directories; holds the last-returned | 98 | /* cursor structure used for scanning directories; holds the last-returned |
99 | entry information */ | 99 | entry information */ |
100 | #define FAT_DIRSCAN_RW_VAL (0u - 1u) | ||
101 | |||
100 | struct fat_dirscan_info | 102 | struct fat_dirscan_info |
101 | { | 103 | { |
102 | unsigned int entry; /* short dir entry index in parent */ | 104 | unsigned int entry; /* short dir entry index in parent */ |
103 | unsigned int entries; /* number of dir entries used */ | 105 | unsigned int entries; /* number of dir entries used */ |
104 | }; | 106 | }; |
105 | 107 | ||
106 | #define FAT_RW_VAL (0u - 1) | 108 | #define FAT_FILE_RW_VAL (0ul - 1ul) |
107 | 109 | ||
108 | /* basic FAT file information about where to find a file and who houses it */ | 110 | /* basic FAT file information about where to find a file and who houses it */ |
109 | struct fat_file | 111 | struct fat_file |
@@ -156,6 +158,8 @@ long fat_readwrite(struct fat_filestr *filestr, unsigned long sectorcount, | |||
156 | void *buf, bool write); | 158 | void *buf, bool write); |
157 | void fat_rewind(struct fat_filestr *filestr); | 159 | void fat_rewind(struct fat_filestr *filestr); |
158 | int fat_seek(struct fat_filestr *filestr, unsigned long sector); | 160 | int fat_seek(struct fat_filestr *filestr, unsigned long sector); |
161 | void fat_seek_to_stream(struct fat_filestr *filestr, | ||
162 | const struct fat_filestr *filestr_seek_to); | ||
159 | int fat_truncate(const struct fat_filestr *filestr); | 163 | int fat_truncate(const struct fat_filestr *filestr); |
160 | 164 | ||
161 | /** Directory stream functions **/ | 165 | /** Directory stream functions **/ |