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_ */