summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/fat.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/fat.h b/include/fat.h
index 0f58939124..bdeda95e6d 100644
--- a/include/fat.h
+++ b/include/fat.h
@@ -177,12 +177,16 @@ typedef struct {
__u32 root_cluster; /* First cluster of root dir for FAT32 */
} fsdata;
-/* TODO clean up places that are open-coding this: */
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;
+}
+
int file_fat_detectfs(void);
int fat_exists(const char *filename);
int fat_size(const char *filename, loff_t *size);