Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos M
提交
66f242f8
K
Kernel Liteos M
项目概览
OpenHarmony
/
Kernel Liteos M
大约 1 年 前同步成功
通知
20
Star
28
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel Liteos M
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
66f242f8
编写于
6月 28, 2021
作者:
O
openharmony_ci
提交者:
Gitee
6月 28, 2021
浏览文件
操作
浏览文件
下载
差异文件
!201 littlefs编译告警消除
Merge pull request !201 from LeonChan/lc-compile-warnings
上级
80f02595
75f61870
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
15 deletion
+16
-15
components/fs/littlefs/lfs_api.c
components/fs/littlefs/lfs_api.c
+13
-12
components/fs/littlefs/lfs_api.h
components/fs/littlefs/lfs_api.h
+3
-3
未找到文件。
components/fs/littlefs/lfs_api.c
浏览文件 @
66f242f8
...
...
@@ -32,6 +32,7 @@
#define _GNU_SOURCE 1
#include "lfs_api.h"
#include "los_config.h"
#include "securec.h"
lfs_t
g_lfs
;
FileDirInfo
g_lfsDir
[
LFS_MAX_OPEN_DIRS
]
=
{
0
};
...
...
@@ -64,7 +65,7 @@ static void LfsFreeFd(int fd)
pthread_mutex_lock
(
&
g_FslocalMutex
);
g_handle
[
fd
].
useFlag
=
0
;
if
(
g_handle
[
fd
].
pathName
!=
NULL
)
{
free
(
g_handle
[
fd
].
pathName
);
free
(
(
void
*
)
g_handle
[
fd
].
pathName
);
g_handle
[
fd
].
pathName
=
NULL
;
}
...
...
@@ -104,7 +105,7 @@ FileDirInfo *GetFreeDir(const char *dirName)
return
NULL
;
}
void
FreeDirInfo
(
const
char
*
dirName
)
void
FreeDirInfo
(
const
char
*
dirName
)
{
pthread_mutex_lock
(
&
g_FslocalMutex
);
for
(
int
i
=
0
;
i
<
LFS_MAX_OPEN_DIRS
;
i
++
)
{
...
...
@@ -168,7 +169,7 @@ BOOL CheckPathIsMounted(const char *pathName, struct FileOpInfo **fileOpInfo)
return
FALSE
;
}
struct
FileOpInfo
*
AllocMountRes
(
const
char
*
target
,
struct
FileOps
*
fileOps
)
struct
FileOpInfo
*
AllocMountRes
(
const
char
*
target
,
const
struct
FileOps
*
fileOps
)
{
pthread_mutex_lock
(
&
g_FslocalMutex
);
for
(
int
i
=
0
;
i
<
LOSCFG_LFS_MAX_MOUNT_SIZE
;
i
++
)
{
...
...
@@ -190,8 +191,8 @@ int SetDefaultMountPath(int pathNameIndex, const char* target)
if
(
pathNameIndex
>=
LOSCFG_LFS_MAX_MOUNT_SIZE
)
{
return
VFS_ERROR
;
}
pthread_mutex_lock
(
&
g_FslocalMutex
);
pthread_mutex_lock
(
&
g_FslocalMutex
);
g_littlefsMntName
[
pathNameIndex
]
=
strdup
(
target
);
pthread_mutex_unlock
(
&
g_FslocalMutex
);
return
VFS_OK
;
...
...
@@ -381,7 +382,7 @@ int LfsMount(const char *source, const char *target, const char *fileSystemType,
ret
=
VFS_ERROR
;
goto
errout
;
}
ret
=
lfs_mount
(
&
(
fileOpInfo
->
lfsInfo
),
(
struct
lfs_config
*
)
data
);
if
(
ret
!=
0
)
{
ret
=
lfs_format
(
&
(
fileOpInfo
->
lfsInfo
),
(
struct
lfs_config
*
)
data
);
...
...
@@ -572,7 +573,7 @@ struct dirent *LfsReaddir(DIR *dir)
return
NULL
;
}
int
LfsClosedir
(
const
DIR
*
dir
)
int
LfsClosedir
(
DIR
*
dir
)
{
int
ret
;
FileDirInfo
*
dirInfo
=
(
FileDirInfo
*
)
dir
;
...
...
@@ -675,9 +676,9 @@ int LfsWrite(int fd, const void *buf, unsigned int len)
return
ret
;
}
in
t
LfsSeek
(
int
fd
,
off_t
offset
,
int
whence
)
off_
t
LfsSeek
(
int
fd
,
off_t
offset
,
int
whence
)
{
in
t
ret
;
off_
t
ret
;
if
(
fd
>=
LITTLE_FS_MAX_OPEN_FILES
||
fd
<
0
)
{
errno
=
EFAULT
;
return
VFS_ERROR
;
...
...
@@ -688,7 +689,7 @@ int LfsSeek(int fd, off_t offset, int whence)
return
VFS_ERROR
;
}
ret
=
lfs_file_seek
(
g_handle
[
fd
].
lfsHandle
,
&
(
g_handle
[
fd
].
file
),
offset
,
whence
);
ret
=
(
off_t
)
lfs_file_seek
(
g_handle
[
fd
].
lfsHandle
,
&
(
g_handle
[
fd
].
file
),
offset
,
whence
);
if
(
ret
!=
0
)
{
errno
=
LittlefsErrno
(
ret
);
}
...
...
@@ -720,7 +721,7 @@ int LfsClose(int fd)
errno
=
LittlefsErrno
(
ret
);
}
return
ret
;
return
ret
;
}
int
LfsRename
(
const
char
*
oldName
,
const
char
*
newName
)
...
...
@@ -769,7 +770,7 @@ int LfsStat(const char *path, struct stat *buf)
errno
=
LittlefsErrno
(
ret
);
}
return
ret
;
return
ret
;
}
int
LfsFsync
(
int
fd
)
...
...
components/fs/littlefs/lfs_api.h
浏览文件 @
66f242f8
...
...
@@ -65,7 +65,7 @@ typedef struct {
struct
FileOpInfo
{
uint8_t
useFlag
;
struct
FileOps
*
fsVops
;
const
struct
FileOps
*
fsVops
;
char
*
dirName
;
lfs_t
lfsInfo
;
};
...
...
@@ -103,11 +103,11 @@ int LfsMkdir(const char *dirName, mode_t mode);
int
LfsRmdir
(
const
char
*
dirName
);
DIR
*
LfsOpendir
(
const
char
*
dirName
);
struct
dirent
*
LfsReaddir
(
DIR
*
dir
);
int
LfsClosedir
(
const
DIR
*
dir
);
int
LfsClosedir
(
DIR
*
dir
);
int
LfsOpen
(
const
char
*
pathName
,
int
openFlag
,
int
mode
);
int
LfsRead
(
int
fd
,
void
*
buf
,
unsigned
int
len
);
int
LfsWrite
(
int
fd
,
const
void
*
buf
,
unsigned
int
len
);
in
t
LfsSeek
(
int
fd
,
off_t
offset
,
int
whence
);
off_
t
LfsSeek
(
int
fd
,
off_t
offset
,
int
whence
);
int
LfsClose
(
int
fd
);
int
LfsRename
(
const
char
*
oldName
,
const
char
*
newName
);
int
LfsStat
(
const
char
*
path
,
struct
stat
*
buf
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录