-typedef int (file_detectfs_func)(void);
-typedef int (file_ls_func)(const char *dir);
-typedef int (file_read_func)(const char *filename, void *buffer,
- int maxsize);
-
-struct filesystem {
- file_detectfs_func *detect;
- file_ls_func *ls;
- file_read_func *read;
- const char name[12];
-};
-
-/* FAT tables */
-file_detectfs_func file_fat_detectfs;
-file_ls_func file_fat_ls;
-file_read_func file_fat_read;
-
-/* Currently this doesn't check if the dir exists or is valid... */
-int file_cd(const char *path);
+static inline u32 clust_to_sect(fsdata *fsdata, u32 clust)
+{
+ return fsdata->data_begin + clust * fsdata->clust_size;
+}
+
+static inline u32 sect_to_clust(fsdata *fsdata, u32 sect)
+{
+ return (sect - fsdata->data_begin) / fsdata->clust_size;
+}
+