Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
7d100571
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
接近 2 年 前同步成功
通知
474
Star
414
Fork
55
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel Liteos A
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7d100571
编写于
6月 08, 2021
作者:
O
openharmony_ci
提交者:
Gitee
6月 08, 2021
浏览文件
操作
浏览文件
下载
差异文件
!300 codex问题修复
Merge pull request !300 from LeonChan/master
上级
a94c6b09
101a55d1
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
40 addition
and
28 deletion
+40
-28
fs/fat/os_adapt/fatfs.c
fs/fat/os_adapt/fatfs.c
+2
-2
fs/fat/os_adapt/fatfs.h
fs/fat/os_adapt/fatfs.h
+2
-2
fs/include/fs/vnode.h
fs/include/fs/vnode.h
+2
-2
fs/jffs2/src/vfs_jffs2.c
fs/jffs2/src/vfs_jffs2.c
+2
-2
fs/vfs/operation/fs_file_mapping.c
fs/vfs/operation/fs_file_mapping.c
+19
-3
fs/vfs/path_cache.c
fs/vfs/path_cache.c
+1
-1
fs/vfs/vnode.c
fs/vfs/vnode.c
+3
-6
syscall/fs_syscall.c
syscall/fs_syscall.c
+9
-10
未找到文件。
fs/fat/os_adapt/fatfs.c
浏览文件 @
7d100571
...
...
@@ -1836,7 +1836,7 @@ ERROR_OUT:
return
-
fatfs_2_vfs
(
result
);
}
int
fatfs_rmdir
(
struct
Vnode
*
parent
,
struct
Vnode
*
vp
,
char
*
name
)
int
fatfs_rmdir
(
struct
Vnode
*
parent
,
struct
Vnode
*
vp
,
c
onst
c
har
*
name
)
{
FATFS
*
fs
=
(
FATFS
*
)
vp
->
originMount
->
data
;
DIR_FILE
*
dfp
=
(
DIR_FILE
*
)
vp
->
data
;
...
...
@@ -1898,7 +1898,7 @@ int fatfs_reclaim(struct Vnode *vp)
return
0
;
}
int
fatfs_unlink
(
struct
Vnode
*
parent
,
struct
Vnode
*
vp
,
char
*
name
)
int
fatfs_unlink
(
struct
Vnode
*
parent
,
struct
Vnode
*
vp
,
c
onst
c
har
*
name
)
{
FATFS
*
fs
=
(
FATFS
*
)
vp
->
originMount
->
data
;
DIR_FILE
*
dfp
=
(
DIR_FILE
*
)
vp
->
data
;
...
...
fs/fat/os_adapt/fatfs.h
浏览文件 @
7d100571
...
...
@@ -131,8 +131,8 @@ int fatfs_closedir(struct Vnode *vnode, struct fs_dirent_s *dir);
int
fatfs_rename
(
struct
Vnode
*
oldvnode
,
struct
Vnode
*
newparent
,
const
char
*
oldname
,
const
char
*
newname
);
int
fatfs_mkfs
(
struct
Vnode
*
device
,
int
sectors
,
int
option
);
int
fatfs_mkdir
(
struct
Vnode
*
parent
,
const
char
*
name
,
mode_t
mode
,
struct
Vnode
**
vpp
);
int
fatfs_rmdir
(
struct
Vnode
*
parent
,
struct
Vnode
*
vp
,
char
*
name
);
int
fatfs_unlink
(
struct
Vnode
*
parent
,
struct
Vnode
*
vp
,
char
*
name
);
int
fatfs_rmdir
(
struct
Vnode
*
parent
,
struct
Vnode
*
vp
,
c
onst
c
har
*
name
);
int
fatfs_unlink
(
struct
Vnode
*
parent
,
struct
Vnode
*
vp
,
c
onst
c
har
*
name
);
int
fatfs_ioctl
(
struct
file
*
filep
,
int
req
,
unsigned
long
arg
);
int
fatfs_fscheck
(
struct
Vnode
*
vnode
,
struct
fs_dirent_s
*
dir
);
...
...
fs/include/fs/vnode.h
浏览文件 @
7d100571
...
...
@@ -85,8 +85,8 @@ struct VnodeOps {
int
(
*
Open
)(
struct
Vnode
*
vnode
,
int
fd
,
int
mode
,
int
flags
);
int
(
*
Close
)(
struct
Vnode
*
vnode
);
int
(
*
Reclaim
)(
struct
Vnode
*
vnode
);
int
(
*
Unlink
)(
struct
Vnode
*
parent
,
struct
Vnode
*
vnode
,
char
*
fileName
);
int
(
*
Rmdir
)(
struct
Vnode
*
parent
,
struct
Vnode
*
vnode
,
char
*
dirName
);
int
(
*
Unlink
)(
struct
Vnode
*
parent
,
struct
Vnode
*
vnode
,
c
onst
c
har
*
fileName
);
int
(
*
Rmdir
)(
struct
Vnode
*
parent
,
struct
Vnode
*
vnode
,
c
onst
c
har
*
dirName
);
int
(
*
Mkdir
)(
struct
Vnode
*
parent
,
const
char
*
dirName
,
mode_t
mode
,
struct
Vnode
**
vnode
);
int
(
*
Readdir
)(
struct
Vnode
*
vnode
,
struct
fs_dirent_s
*
dir
);
int
(
*
Opendir
)(
struct
Vnode
*
vnode
,
struct
fs_dirent_s
*
dir
);
...
...
fs/jffs2/src/vfs_jffs2.c
浏览文件 @
7d100571
...
...
@@ -603,7 +603,7 @@ int VfsJffs2Chattr(struct Vnode *pVnode, struct IATTR *attr)
return
ret
;
}
int
VfsJffs2Rmdir
(
struct
Vnode
*
parentVnode
,
struct
Vnode
*
targetVnode
,
char
*
path
)
int
VfsJffs2Rmdir
(
struct
Vnode
*
parentVnode
,
struct
Vnode
*
targetVnode
,
c
onst
c
har
*
path
)
{
int
ret
;
...
...
@@ -620,7 +620,7 @@ int VfsJffs2Rmdir(struct Vnode *parentVnode, struct Vnode *targetVnode, char *pa
return
ret
;
}
int
VfsJffs2Unlink
(
struct
Vnode
*
parentVnode
,
struct
Vnode
*
targetVnode
,
char
*
path
)
int
VfsJffs2Unlink
(
struct
Vnode
*
parentVnode
,
struct
Vnode
*
targetVnode
,
c
onst
c
har
*
path
)
{
int
ret
;
...
...
fs/vfs/operation/fs_file_mapping.c
浏览文件 @
7d100571
...
...
@@ -270,11 +270,27 @@ int update_file_path(const char *old_path, const char *new_path)
continue
;
}
int
len
=
strlen
(
new_path
)
+
1
;
filp
->
f_path
=
zalloc
(
len
);
strncpy_s
(
filp
->
f_path
,
strlen
(
new_path
)
+
1
,
new_path
,
len
);
char
*
tmp_path
=
LOS_MemAlloc
(
m_aucSysMem0
,
len
);
if
(
tmp_path
==
NULL
)
{
PRINT_ERR
(
"%s-%d: Mem alloc failed, path length(%d)
\n
"
,
__FUNCTION__
,
__LINE__
,
len
);
ret
=
VFS_ERROR
;
goto
out
;
}
ret
=
strncpy_s
(
tmp_path
,
strlen
(
new_path
)
+
1
,
new_path
,
len
);
if
(
ret
!=
0
)
{
(
VOID
)
LOS_MemFree
(
m_aucSysMem0
,
tmp_path
);
PRINT_ERR
(
"%s-%d: strcpy failed.
\n
"
,
__FUNCTION__
,
__LINE__
);
ret
=
VFS_ERROR
;
goto
out
;
}
free
(
filp
->
f_path
);
filp
->
f_path
=
tmp_path
;
}
ret
=
LOS_OK
;
out:
(
VOID
)
LOS_MuxUnlock
(
&
g_file_mapping
.
lock
);
(
void
)
sem_post
(
&
f_list
->
fl_sem
);
return
LOS_OK
;
return
ret
;
}
#endif
fs/vfs/path_cache.c
浏览文件 @
7d100571
...
...
@@ -82,7 +82,7 @@ static uint32_t NameHash(const char *name, int len, struct Vnode *dvp)
{
uint32_t
hash
;
hash
=
fnv_32_buf
(
name
,
len
,
FNV1_32_INIT
);
hash
=
fnv_32_buf
(
&
dvp
,
sizeof
(
dvp
),
hash
);
hash
=
fnv_32_buf
(
&
dvp
,
sizeof
(
struct
Vnode
*
),
hash
);
return
hash
;
}
...
...
fs/vfs/vnode.c
浏览文件 @
7d100571
...
...
@@ -245,9 +245,6 @@ int VnodeDrop()
static
char
*
NextName
(
char
*
pos
,
uint8_t
*
len
)
{
char
*
name
=
NULL
;
if
(
*
pos
==
'\0'
)
{
return
NULL
;
}
while
(
*
pos
!=
0
&&
*
pos
==
'/'
)
{
pos
++
;
}
...
...
@@ -319,6 +316,7 @@ static int Step(char **currentDir, struct Vnode **currentVnode, uint32_t flags)
}
nextDir
=
NextName
(
*
currentDir
,
&
len
);
if
(
nextDir
==
NULL
)
{
// there is '/' at the end of the *currentDir.
*
currentDir
=
NULL
;
return
LOS_OK
;
}
...
...
@@ -361,7 +359,6 @@ int VnodeLookup(const char *path, struct Vnode **result, uint32_t flags)
struct
Vnode
*
startVnode
=
NULL
;
char
*
normalizedPath
=
NULL
;
int
ret
=
PreProcess
(
path
,
&
startVnode
,
&
normalizedPath
);
if
(
ret
!=
LOS_OK
)
{
PRINT_ERR
(
"[VFS]lookup failed, invalid path=%s err = %d
\n
"
,
path
,
ret
);
...
...
@@ -377,9 +374,9 @@ int VnodeLookup(const char *path, struct Vnode **result, uint32_t flags)
char
*
currentDir
=
normalizedPath
;
struct
Vnode
*
currentVnode
=
startVnode
;
while
(
currentDir
&&
*
currentDir
!=
'\0'
)
{
while
(
*
currentDir
!=
'\0'
)
{
ret
=
Step
(
&
currentDir
,
&
currentVnode
,
flags
);
if
(
*
currentDir
==
'\0'
)
{
if
(
currentDir
==
NULL
||
*
currentDir
==
'\0'
)
{
// return target or parent vnode as result
*
result
=
currentVnode
;
}
else
if
(
VfsVnodePermissionCheck
(
currentVnode
,
EXEC_OP
))
{
...
...
syscall/fs_syscall.c
浏览文件 @
7d100571
...
...
@@ -270,13 +270,11 @@ int SysOpen(const char *path, int oflags, ...)
mode_t
mode
=
DEFAULT_FILE_MODE
;
/* 0666: File read-write properties. */
char
*
pathRet
=
NULL
;
if
(
path
==
NULL
&&
*
path
==
0
)
{
return
-
EINVAL
;
}
ret
=
UserPathCopy
(
path
,
&
pathRet
);
if
(
ret
!=
0
)
{
return
ret
;
if
(
path
!=
NULL
)
{
ret
=
UserPathCopy
(
path
,
&
pathRet
);
if
(
ret
!=
0
)
{
goto
ERROUT_PATH_FREE
;
}
}
procFd
=
AllocProcessFd
();
...
...
@@ -310,15 +308,16 @@ int SysOpen(const char *path, int oflags, ...)
return
procFd
;
ERROUT:
if
(
pathRet
!=
NULL
)
{
LOS_MemFree
(
OS_SYS_MEM_ADDR
,
pathRet
);
}
if
(
ret
>=
0
)
{
AssociateSystemFd
(
procFd
,
ret
);
ret
=
procFd
;
}
else
{
FreeProcessFd
(
procFd
);
}
ERROUT_PATH_FREE:
if
(
pathRet
!=
NULL
)
{
LOS_MemFree
(
OS_SYS_MEM_ADDR
,
pathRet
);
}
return
ret
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录