From d77828e206f3324424c3b1372332828a0afb84c2 Mon Sep 17 00:00:00 2001 From: li_zan <371442490@qq.com> Date: Thu, 10 Jun 2021 17:21:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DM=E6=A0=B8littlefs=20G?= =?UTF-8?q?N=E7=BC=96=E8=AF=91=E7=9A=84=E8=8B=A5=E5=B9=B2=E9=94=99?= =?UTF-8?q?=E8=AF=AF=20close=EF=BC=9AI3V7ZH?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li_zan <371442490@qq.com> --- components/fs/BUILD.gn | 2 +- components/fs/littlefs/BUILD.gn | 3 ++- components/fs/littlefs/lfs_api.c | 6 +----- components/fs/littlefs/lfs_api.h | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/components/fs/BUILD.gn b/components/fs/BUILD.gn index 1173aa9f..2b78b81f 100644 --- a/components/fs/BUILD.gn +++ b/components/fs/BUILD.gn @@ -35,7 +35,7 @@ static_library("fs_operations") { declare_args() { enable_ohos_kernel_liteos_m_fatfs = true - enable_ohos_kernel_liteos_m_littlefs = false + enable_ohos_kernel_liteos_m_littlefs = true } group("fs") { diff --git a/components/fs/littlefs/BUILD.gn b/components/fs/littlefs/BUILD.gn index fbd76cc6..02230191 100644 --- a/components/fs/littlefs/BUILD.gn +++ b/components/fs/littlefs/BUILD.gn @@ -40,6 +40,7 @@ static_library("littlefs") { "../../../kal", "../../../kal/posix/include", "./", - "//third_party/littlefs/include", + "../", + "//third_party/littlefs", ] } diff --git a/components/fs/littlefs/lfs_api.c b/components/fs/littlefs/lfs_api.c index f5e34c3f..4388109f 100644 --- a/components/fs/littlefs/lfs_api.c +++ b/components/fs/littlefs/lfs_api.c @@ -29,6 +29,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#define _GNU_SOURCE 1 #include "lfs_api.h" lfs_t g_lfs; @@ -40,11 +41,6 @@ struct dirent g_nameValue; static pthread_mutex_t g_FslocalMutex = PTHREAD_MUTEX_INITIALIZER; static const char *const g_littlefsMntName[LFS_MAX_MOUNT_SIZE] = {"/a","/b","/c"}; -FileOpInfo GetFsOpInfo(void) -{ - return g_fsOp; -} - LittleFsHandleStruct *LfsAllocFd(const char *fileName, int *fd) { pthread_mutex_lock(&g_FslocalMutex); diff --git a/components/fs/littlefs/lfs_api.h b/components/fs/littlefs/lfs_api.h index fdbf582c..0222cf93 100644 --- a/components/fs/littlefs/lfs_api.h +++ b/components/fs/littlefs/lfs_api.h @@ -38,6 +38,7 @@ #include "dirent.h" #include "errno.h" +#include "fs_operations.h" #include "lfs.h" #include "lfs_util.h" #include "memory.h" @@ -117,7 +118,6 @@ int LfsRename(const char *oldName, const char *newName); int LfsStat(const char *path, struct stat *buf); int LfsFsync(int fd); -FileOpInfo GetFsOpInfo(void); const struct FsMap *MountFindfs(const char *filesystemtype); #endif /* _LFS_API_H_ */