From 753bd2635b90aa43a70313e671c8bfda661ffc12 Mon Sep 17 00:00:00 2001 From: zhang Date: Thu, 17 Mar 2022 08:42:03 +0800 Subject: [PATCH] fix: modify riscv compile error that get_fs/set_fs is undefined Signed-off-by: zhang --- osal/src/osal_file.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/osal/src/osal_file.c b/osal/src/osal_file.c index 49d429f..e459206 100644 --- a/osal/src/osal_file.c +++ b/osal/src/osal_file.c @@ -49,7 +49,6 @@ ssize_t OsalFileWrite(OsalFile *file, const void *string, uint32_t length) { ssize_t ret; loff_t pos; - mm_segment_t org_fs; struct file *fp = NULL; if (file == NULL || IS_ERR_OR_NULL(file->realFile) || string == NULL) { @@ -58,11 +57,7 @@ ssize_t OsalFileWrite(OsalFile *file, const void *string, uint32_t length) } fp = (struct file *)file->realFile; pos = fp->f_pos; - org_fs = get_fs(); - set_fs(KERNEL_DS); - - ret = vfs_write(fp, string, length, &pos); - set_fs(org_fs); + ret = kernel_write(fp, string, length, &pos); if (ret < 0) { HDF_LOGE("%s write file length %u fail %d", __func__, length, ret); return HDF_FAILURE; @@ -89,7 +84,6 @@ EXPORT_SYMBOL(OsalFileClose); ssize_t OsalFileRead(OsalFile *file, void *buf, uint32_t length) { ssize_t ret; - mm_segment_t org_fs; loff_t pos; struct file *fp = NULL; @@ -98,12 +92,8 @@ ssize_t OsalFileRead(OsalFile *file, void *buf, uint32_t length) return HDF_ERR_INVALID_PARAM; } fp = (struct file *)file->realFile; - org_fs = get_fs(); - set_fs(KERNEL_DS); pos = fp->f_pos; - - ret = vfs_read(fp, buf, length, &pos); - set_fs(org_fs); + ret = kernel_read(fp, buf, length, &pos); if (ret < 0) { HDF_LOGE("%s read file length %u fail %d", __func__, length, ret); return HDF_FAILURE; -- Gitee