提交 d23f2fc7 编写于 作者: F Far

feat:适配三方库FatFs升级至r0.14a版本

适配了_mkfs和find_volume接口的修改
Signed-off-by: NFar <yesiyuan2@huawei.com>
上级 5e076633
......@@ -1848,6 +1848,7 @@ int fatfs_mkfs (struct Vnode *device, int sectors, int option)
BYTE *work_buff = NULL;
los_part *part = NULL;
FRESULT result;
MKFS_PARM opt = {0};
int ret;
part = los_part_find(device);
......@@ -1872,7 +1873,9 @@ int fatfs_mkfs (struct Vnode *device, int sectors, int option)
return -ENOMEM;
}
result = _mkfs(part, sectors, option, work_buff, FF_MAX_SS);
opt.n_sect = sectors;
opt.fmt = (BYTE)option;
result = _mkfs(part, &opt, work_buff, FF_MAX_SS);
free(work_buff);
if (result != FR_OK) {
return -fatfs_2_vfs(result);
......
......@@ -146,7 +146,7 @@ int fatfs_fscheck(struct Vnode* vnode, struct fs_dirent_s *dir);
FRESULT find_fat_partition(FATFS *fs, los_part *part, BYTE *format, QWORD *start_sector);
FRESULT init_fatobj(FATFS *fs, BYTE fmt, QWORD start_sector);
FRESULT _mkfs(los_part *partition, int sector, int opt, BYTE *work, UINT len);
FRESULT _mkfs(los_part *partition, const MKFS_PARM *opt, BYTE *work, UINT len);
#ifdef __cplusplus
#if __cplusplus
......
......@@ -525,7 +525,7 @@ FRESULT f_checkvirpart(FATFS *fs, const TCHAR *path, BYTE vol)
}
/* Lock the filesystem object */
res = find_volume(&path, &fs, FA_WRITE); /* Update the filesystem info to the parent fs */
res = mount_volume(&path, &fs, FA_WRITE); /* Update the filesystem info to the parent fs */
if (res != FR_OK) {
LEAVE_FF(fs, res);
}
......@@ -683,7 +683,7 @@ FRESULT f_makevirpart(FATFS *fs, const TCHAR *path, BYTE vol)
}
/* Lock the filesystem object */
res = find_volume(&path, &fs, FA_WRITE); /* Update the filesystem info to the parent fs */
res = mount_volume(&path, &fs, FA_WRITE); /* Update the filesystem info to the parent fs */
if (res != FR_OK) {
LEAVE_FF(fs, res);
}
......@@ -774,7 +774,7 @@ FRESULT f_getvirfree(const TCHAR *path, DWORD *nclst, DWORD *cclst)
DIR dj;
/* Find volume to Update the global FSINFO */
res = find_volume(&path, &fs, 0);
res = mount_volume(&path, &fs, 0);
if (res != FR_OK) {
LEAVE_FF(fs, res);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册