static disk_partition_t fs_partition;
static int fs_type = FS_TYPE_ANY;
-static inline int fs_probe_unsupported(void)
+static inline int fs_probe_unsupported(block_dev_desc_t *fs_dev_desc,
+ disk_partition_t *fs_partition)
{
printf("** Unrecognized filesystem type **\n");
return -1;
}
#ifdef CONFIG_FS_FAT
-static int fs_probe_fat(void)
+static int fs_probe_fat(block_dev_desc_t *fs_dev_desc,
+ disk_partition_t *fs_partition)
{
- return fat_set_blk_dev(fs_dev_desc, &fs_partition);
+ return fat_set_blk_dev(fs_dev_desc, fs_partition);
}
static void fs_close_fat(void)
#endif
#ifdef CONFIG_FS_EXT4
-static int fs_probe_ext(void)
+static int fs_probe_ext(block_dev_desc_t *fs_dev_desc,
+ disk_partition_t *fs_partition)
{
- ext4fs_set_blk_dev(fs_dev_desc, &fs_partition);
+ ext4fs_set_blk_dev(fs_dev_desc, fs_partition);
- if (!ext4fs_mount(fs_partition.size)) {
+ if (!ext4fs_mount(fs_partition->size)) {
ext4fs_close();
return -1;
}
struct fstype_info {
int fstype;
- int (*probe)(void);
+ int (*probe)(block_dev_desc_t *fs_dev_desc,
+ disk_partition_t *fs_partition);
int (*ls)(const char *dirname);
int (*read)(const char *filename, ulong addr, int offset, int len);
void (*close)(void);
fstype != info->fstype)
continue;
- if (!info->probe()) {
+ if (!info->probe(fs_dev_desc, &fs_partition)) {
fs_type = info->fstype;
return 0;
}