Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
ea825345
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
1 年多 前同步成功
通知
460
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看板
未验证
提交
ea825345
编写于
2月 11, 2023
作者:
O
openharmony_ci
提交者:
Gitee
2月 11, 2023
浏览文件
操作
浏览文件
下载
差异文件
!1115 修复xts用例失败的问题
Merge pull request !1115 from zhangdengyu/fixXtsTestCase
上级
c0f5d437
fe6ab18c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
29 deletion
+0
-29
fs/proc/os_adapt/proc_vfs.c
fs/proc/os_adapt/proc_vfs.c
+0
-23
fs/proc/src/proc_file.c
fs/proc/src/proc_file.c
+0
-6
未找到文件。
fs/proc/os_adapt/proc_vfs.c
浏览文件 @
ea825345
...
...
@@ -132,10 +132,8 @@ int VfsProcfsRead(struct file *filep, char *buffer, size_t buflen)
return
-
EPERM
;
}
spin_lock
(
&
entry
->
pdeUnloadLock
);
size
=
(
ssize_t
)
ReadProcFile
(
entry
,
(
void
*
)
buffer
,
buflen
);
filep
->
f_pos
=
entry
->
pf
->
fPos
;
spin_unlock
(
&
entry
->
pdeUnloadLock
);
VnodeDrop
();
return
size
;
}
...
...
@@ -155,10 +153,8 @@ int VfsProcfsWrite(struct file *filep, const char *buffer, size_t buflen)
return
-
EPERM
;
}
spin_lock
(
&
entry
->
pdeUnloadLock
);
size
=
(
ssize_t
)
WriteProcFile
(
entry
,
(
void
*
)
buffer
,
buflen
);
filep
->
f_pos
=
entry
->
pf
->
fPos
;
spin_unlock
(
&
entry
->
pdeUnloadLock
);
VnodeDrop
();
return
size
;
}
...
...
@@ -173,11 +169,9 @@ int VfsProcfsLookup(struct Vnode *parent, const char *name, int len, struct Vnod
return
-
ENODATA
;
}
spin_lock
(
&
procfsLock
);
entry
=
entry
->
subdir
;
while
(
1
)
{
if
(
entry
==
NULL
)
{
spin_unlock
(
&
procfsLock
);
return
-
ENOENT
;
}
if
(
EntryMatch
(
name
,
len
,
entry
))
{
...
...
@@ -185,7 +179,6 @@ int VfsProcfsLookup(struct Vnode *parent, const char *name, int len, struct Vnod
}
entry
=
entry
->
next
;
}
spin_unlock
(
&
procfsLock
);
*
vpp
=
EntryToVnode
(
entry
);
if
((
*
vpp
)
==
NULL
)
{
...
...
@@ -241,9 +234,7 @@ int VfsProcfsStat(struct Vnode *node, struct stat *buf)
return
-
EPERM
;
}
(
void
)
memset_s
(
buf
,
sizeof
(
struct
stat
),
0
,
sizeof
(
struct
stat
));
spin_lock
(
&
entry
->
pdeUnloadLock
);
buf
->
st_mode
=
entry
->
mode
;
spin_unlock
(
&
entry
->
pdeUnloadLock
);
VnodeDrop
();
return
LOS_OK
;
}
...
...
@@ -269,11 +260,9 @@ int VfsProcfsReaddir(struct Vnode *node, struct fs_dirent_s *dir)
return
-
EPERM
;
}
spin_lock
(
&
pde
->
pdeUnloadLock
);
while
(
i
<
dir
->
read_cnt
)
{
buffer
=
(
char
*
)
zalloc
(
sizeof
(
char
)
*
NAME_MAX
);
if
(
buffer
==
NULL
)
{
spin_unlock
(
&
pde
->
pdeUnloadLock
);
VnodeDrop
();
PRINT_ERR
(
"malloc failed
\n
"
);
return
-
ENOMEM
;
...
...
@@ -288,7 +277,6 @@ int VfsProcfsReaddir(struct Vnode *node, struct fs_dirent_s *dir)
minSize
=
(
dstNameSize
<
NAME_MAX
)
?
dstNameSize
:
NAME_MAX
;
result
=
strncpy_s
(
dir
->
fd_dir
[
i
].
d_name
,
dstNameSize
,
buffer
,
minSize
);
if
(
result
!=
EOK
)
{
spin_unlock
(
&
pde
->
pdeUnloadLock
);
VnodeDrop
();
free
(
buffer
);
return
-
ENAMETOOLONG
;
...
...
@@ -301,7 +289,6 @@ int VfsProcfsReaddir(struct Vnode *node, struct fs_dirent_s *dir)
i
++
;
free
(
buffer
);
}
spin_unlock
(
&
pde
->
pdeUnloadLock
);
VnodeDrop
();
return
i
;
}
...
...
@@ -315,15 +302,12 @@ int VfsProcfsOpendir(struct Vnode *node, struct fs_dirent_s *dir)
return
-
EINVAL
;
}
spin_lock
(
&
pde
->
pdeUnloadLock
);
pde
->
pdirCurrent
=
pde
->
subdir
;
if
(
pde
->
pf
==
NULL
)
{
spin_unlock
(
&
pde
->
pdeUnloadLock
);
VnodeDrop
();
return
-
EINVAL
;
}
pde
->
pf
->
fPos
=
0
;
spin_unlock
(
&
pde
->
pdeUnloadLock
);
VnodeDrop
();
return
LOS_OK
;
}
...
...
@@ -341,9 +325,7 @@ int VfsProcfsOpen(struct file *filep)
return
-
EPERM
;
}
spin_lock
(
&
pde
->
pdeUnloadLock
);
if
(
ProcOpen
(
pde
->
pf
)
!=
OK
)
{
spin_unlock
(
&
pde
->
pdeUnloadLock
);
return
-
ENOMEM
;
}
if
(
S_ISREG
(
pde
->
mode
)
&&
(
pde
->
procFileOps
!=
NULL
)
&&
(
pde
->
procFileOps
->
open
!=
NULL
))
{
...
...
@@ -354,7 +336,6 @@ int VfsProcfsOpen(struct file *filep)
pde
->
pf
->
fPos
=
0
;
}
filep
->
f_priv
=
(
void
*
)
pde
;
spin_unlock
(
&
pde
->
pdeUnloadLock
);
VnodeDrop
();
return
LOS_OK
;
}
...
...
@@ -374,14 +355,12 @@ int VfsProcfsClose(struct file *filep)
return
-
EPERM
;
}
spin_lock
(
&
pde
->
pdeUnloadLock
);
pde
->
pf
->
fPos
=
0
;
if
((
pde
->
procFileOps
!=
NULL
)
&&
(
pde
->
procFileOps
->
release
!=
NULL
))
{
result
=
pde
->
procFileOps
->
release
((
struct
Vnode
*
)
pde
,
pde
->
pf
);
}
LosBufRelease
(
pde
->
pf
->
sbuf
);
pde
->
pf
->
sbuf
=
NULL
;
spin_unlock
(
&
pde
->
pdeUnloadLock
);
VnodeDrop
();
return
result
;
}
...
...
@@ -411,11 +390,9 @@ ssize_t VfsProcfsReadlink(struct Vnode *vnode, char *buffer, size_t bufLen)
return
-
EPERM
;
}
spin_lock
(
&
pde
->
pdeUnloadLock
);
if
((
pde
->
procFileOps
!=
NULL
)
&&
(
pde
->
procFileOps
->
readLink
!=
NULL
))
{
result
=
pde
->
procFileOps
->
readLink
(
pde
,
buffer
,
bufLen
);
}
spin_unlock
(
&
pde
->
pdeUnloadLock
);
return
result
;
}
...
...
fs/proc/src/proc_file.c
浏览文件 @
ea825345
...
...
@@ -406,7 +406,6 @@ static void FreeProcEntry(struct ProcDirEntry *entry)
ProcEntryClearVnode
(
entry
);
spin_lock
(
&
entry
->
pdeUnloadLock
);
if
(
entry
->
pf
!=
NULL
)
{
free
(
entry
->
pf
);
entry
->
pf
=
NULL
;
...
...
@@ -415,7 +414,6 @@ static void FreeProcEntry(struct ProcDirEntry *entry)
free
(
entry
->
data
);
entry
->
data
=
NULL
;
}
spin_unlock
(
&
entry
->
pdeUnloadLock
);
free
(
entry
);
}
...
...
@@ -592,16 +590,13 @@ struct ProcDirEntry *OpenProcFile(const char *fileName, int flags, ...)
return
NULL
;
}
spin_lock
(
&
pn
->
pdeUnloadLock
);
if
(
S_ISREG
(
pn
->
mode
)
&&
(
pn
->
count
!=
1
))
{
spin_unlock
(
&
pn
->
pdeUnloadLock
);
return
NULL
;
}
pn
->
flags
=
(
unsigned
int
)(
pn
->
flags
)
|
(
unsigned
int
)
flags
;
atomic_set
(
&
pn
->
count
,
PROC_INUSE
);
if
(
ProcOpen
(
pn
->
pf
)
!=
OK
)
{
spin_unlock
(
&
pn
->
pdeUnloadLock
);
return
NULL
;
}
if
(
S_ISREG
(
pn
->
mode
)
&&
(
pn
->
procFileOps
!=
NULL
)
&&
(
pn
->
procFileOps
->
open
!=
NULL
))
{
...
...
@@ -611,7 +606,6 @@ struct ProcDirEntry *OpenProcFile(const char *fileName, int flags, ...)
pn
->
pdirCurrent
=
pn
->
subdir
;
pn
->
pf
->
fPos
=
0
;
}
spin_unlock
(
&
pn
->
pdeUnloadLock
);
return
pn
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录