Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
1884fa05
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
大约 1 年 前同步成功
通知
456
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看板
提交
1884fa05
编写于
3月 24, 2021
作者:
M
mucor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix readdir, rename
Change-Id: Ic443742e125915f0e5332a338dedea5c40348928
上级
a50adf04
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
25 addition
and
10 deletion
+25
-10
fs/fat/os_adapt/fatfs.c
fs/fat/os_adapt/fatfs.c
+1
-1
fs/include/fs/fs_operation.h
fs/include/fs/fs_operation.h
+1
-1
fs/jffs2/src/vfs_jffs2.c
fs/jffs2/src/vfs_jffs2.c
+1
-1
fs/proc/os_adapt/proc_vfs.c
fs/proc/os_adapt/proc_vfs.c
+1
-1
fs/vfs/disk/disk.c
fs/vfs/disk/disk.c
+9
-2
fs/vfs/operation/fs_file_mapping.c
fs/vfs/operation/fs_file_mapping.c
+3
-3
fs/vfs/path_cache.c
fs/vfs/path_cache.c
+5
-1
fs/vfs/vnode.c
fs/vfs/vnode.c
+4
-0
未找到文件。
fs/fat/os_adapt/fatfs.c
浏览文件 @
1884fa05
...
...
@@ -1368,7 +1368,7 @@ int fatfs_readdir(struct Vnode *vp, struct fs_dirent_s *idir)
}
DEF_NAMBUF
;
INIT_NAMBUF
(
fs
);
for
(
i
=
0
;
i
<
DIR_READ_COUNT
&&
i
<
idir
->
read_cnt
;
i
++
)
{
for
(
i
=
0
;
i
<
idir
->
read_cnt
;
i
++
)
{
result
=
dir_read
(
dp
,
0
);
if
(
result
==
FR_NO_FILE
)
{
break
;
...
...
fs/include/fs/fs_operation.h
浏览文件 @
1884fa05
...
...
@@ -113,7 +113,7 @@ extern void dec_mapping_nolock(struct page_mapping *mapping);
*
****************************************************************************/
extern
int
update_file_path
(
c
har
*
old_path
,
char
*
new_path
);
extern
int
update_file_path
(
c
onst
char
*
old_path
,
const
char
*
new_path
);
/**
* @ingroup fs
...
...
fs/jffs2/src/vfs_jffs2.c
浏览文件 @
1884fa05
...
...
@@ -474,7 +474,7 @@ int VfsJffs2Readdir(struct Vnode *pVnode, struct fs_dirent_s *dir)
LOS_MuxLock
(
&
g_jffs2FsLock
,
(
uint32_t
)
JFFS2_WAITING_FOREVER
);
/* set jffs2_d */
while
(
i
<
MAX_DIRENT_NUM
&&
i
<
dir
->
read_cnt
)
{
while
(
i
<
dir
->
read_cnt
)
{
ret
=
jffs2_readdir
((
struct
jffs2_inode
*
)
pVnode
->
data
,
&
dir
->
fd_position
,
&
dir
->
fd_int_offset
,
&
dir
->
fd_dir
[
i
]);
if
(
ret
)
{
...
...
fs/proc/os_adapt/proc_vfs.c
浏览文件 @
1884fa05
...
...
@@ -182,7 +182,7 @@ int VfsProcfsReaddir(struct Vnode *node, struct fs_dirent_s *dir)
}
pde
=
VnodeToEntry
(
node
);
while
(
(
i
<
MAX_DIRENT_NUM
)
||
(
i
<
dir
->
read_cnt
)
)
{
while
(
i
<
dir
->
read_cnt
)
{
buffer
=
(
char
*
)
zalloc
(
sizeof
(
char
)
*
NAME_MAX
);
if
(
buffer
==
NULL
)
{
PRINT_ERR
(
"malloc failed
\n
"
);
...
...
fs/vfs/disk/disk.c
浏览文件 @
1884fa05
...
...
@@ -696,9 +696,13 @@ static INT32 DiskPartitionRecognition(struct Vnode *blkDrv, struct disk_divide_i
CHAR
*
mbrBuf
=
NULL
;
CHAR
*
ebrBuf
=
NULL
;
if
(
blkDrv
==
NULL
)
{
return
-
EINVAL
;
}
struct
block_operations
*
bops
=
(
struct
block_operations
*
)((
struct
drv_data
*
)
blkDrv
->
data
)
->
ops
;
if
((
b
lkDrv
==
NULL
)
||
(
b
ops
==
NULL
)
||
(
bops
->
read
==
NULL
))
{
if
((
bops
==
NULL
)
||
(
bops
->
read
==
NULL
))
{
return
-
EINVAL
;
}
...
...
@@ -832,8 +836,11 @@ INT32 los_disk_read(INT32 drvID, VOID *buf, UINT64 sector, UINT32 count)
}
}
else
{
#endif
if
(
disk
->
dev
==
NULL
)
{
goto
ERROR_HANDLE
;
}
struct
block_operations
*
bops
=
(
struct
block_operations
*
)((
struct
drv_data
*
)
disk
->
dev
->
data
)
->
ops
;
if
((
disk
->
dev
!=
NULL
)
&&
(
bops
!=
NULL
)
&&
(
bops
->
read
!=
NULL
))
{
if
((
bops
!=
NULL
)
&&
(
bops
->
read
!=
NULL
))
{
result
=
bops
->
read
(
disk
->
dev
,
(
UINT8
*
)
buf
,
sector
,
count
);
if
(
result
==
(
INT32
)
count
)
{
result
=
ENOERR
;
...
...
fs/vfs/operation/fs_file_mapping.c
浏览文件 @
1884fa05
...
...
@@ -245,7 +245,7 @@ out:
(
VOID
)
LOS_MuxUnlock
(
&
g_file_mapping
.
lock
);
}
int
update_file_path
(
c
har
*
old_path
,
char
*
new_path
)
int
update_file_path
(
c
onst
char
*
old_path
,
const
char
*
new_path
)
{
unsigned
int
i
=
3
;
struct
filelist
*
f_list
=
NULL
;
...
...
@@ -262,10 +262,10 @@ int update_file_path(char *old_path, char *new_path)
(
VOID
)
LOS_MuxLock
(
&
g_file_mapping
.
lock
,
LOS_WAIT_FOREVER
);
while
(
i
<
CONFIG_NFILE_DESCRIPTORS
)
{
i
++
;
if
(
!
get_bit
(
i
))
{
if
(
!
get_bit
(
i
-
1
))
{
continue
;
}
filp
=
&
tg_filelist
.
fl_files
[
i
];
filp
=
&
tg_filelist
.
fl_files
[
i
-
1
];
if
(
filp
->
f_path
==
NULL
||
strcmp
(
filp
->
f_path
,
old_path
))
{
continue
;
}
...
...
fs/vfs/path_cache.c
浏览文件 @
1884fa05
...
...
@@ -93,6 +93,7 @@ struct PathCache *PathCacheAlloc(struct Vnode *parent, struct Vnode *vnode, cons
{
struct
PathCache
*
nc
=
NULL
;
size_t
pathCacheSize
;
int
ret
;
if
(
name
==
NULL
||
len
>
NAME_MAX
||
parent
==
NULL
||
vnode
==
NULL
)
{
return
NULL
;
...
...
@@ -105,7 +106,10 @@ struct PathCache *PathCacheAlloc(struct Vnode *parent, struct Vnode *vnode, cons
return
NULL
;
}
(
void
)
strncpy_s
(
nc
->
name
,
pathCacheSize
,
name
,
len
);
ret
=
strncpy_s
(
nc
->
name
,
pathCacheSize
,
name
,
len
);
if
(
ret
!=
LOS_OK
)
{
return
NULL
;
}
nc
->
parentVnode
=
parent
;
nc
->
nameLen
=
len
;
...
...
fs/vfs/vnode.c
浏览文件 @
1884fa05
...
...
@@ -573,6 +573,10 @@ int VnodeDevInit()
devNode
->
type
=
VNODE_TYPE_DIR
;
devMount
=
MountAlloc
(
devNode
,
NULL
);
if
(
devMount
==
NULL
)
{
PRINT_ERR
(
"VnodeDevInit failed mount point alloc failed.
\n
"
);
return
-
ENOMEM
;
}
devMount
->
vnodeCovered
=
devNode
;
devMount
->
vnodeBeCovered
->
flag
|=
VNODE_FLAG_MOUNT_NEW
;
return
LOS_OK
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录