#define EXTENDED_INTERNAL_PATH "/run/extended-internal-sd"
#define PATH_LEN 55
-#define EXTENDED_SD_PATH "/opt/media/extendedsd"
+#define EXTENDED_SD_PATH "/opt/extendedsd"
#define EXTENDED_SD_STRING "ExtendedInternalSD"
+#define EXT4_NAME "ext4"
+
/* Minimum value of block id */
#define BLOCK_ID_MIN 10
/* For 2.4 Backward Compatibility */
BLOCK_FLAG_CLEAR_ALL(data);
/* for 2.4 backward compatibility */
+ // What if storage id 1 is existed? (multi sdcard case)
if (data->primary == true && data->block_type == BLOCK_MMC_DEV)
data->id = EXT_PRIMARY_SD_FIXID;
else
{
const struct block_fs_ops *fs;
dd_list *elem;
+ const char *fstype;
int len;
int r;
if (!data || !data->devnode || !data->mount_point)
return -EINVAL;
- if (!fs_type)
- fs_type = data->fs_type;
+ if (data->block_type == BLOCK_MMC_EXTENDED_INTERNAL_DEV)
+ fstype = EXT4_STRING;
+ else {
+ if (!fs_type)
+ fstype = data->fs_type;
+ else
+ fstype = fs_type;
+ }
fs = NULL;
- len = strlen(fs_type);
+ len = strlen(fstype);
DD_LIST_FOREACH(fs_head, elem, fs) {
- if (!strncmp(fs->name, fs_type, len))
+ if (!strncmp(fs->name, fstype, len))
break;
}
if (!fs) {
BLOCK_FLAG_SET(data, FS_NOT_SUPPORTED);
- _E("not supported file system(%s)", fs_type);
+ _E("not supported file system(%s)", fstype);
return -ENOTSUP;
}
static void release_format_data(struct format_data *data)
{
if (data) {
- free(data->fs_type);
+ if (data->fs_type)
+ free(data->fs_type);
free(data);
}
}