Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
1ecacc15
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
大约 2 年 前同步成功
通知
475
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看板
提交
1ecacc15
编写于
9月 08, 2021
作者:
O
openharmony_ci
提交者:
Gitee
9月 08, 2021
浏览文件
操作
浏览文件
下载
差异文件
!593 feat: add sync() to vfs
Merge pull request !593 from MGY917/sync
上级
e095e876
f67c4dae
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
29 addition
and
27 deletion
+29
-27
fs/fat/os_adapt/fatfs.c
fs/fat/os_adapt/fatfs.c
+25
-0
fs/include/fs/mount.h
fs/include/fs/mount.h
+1
-0
fs/vfs/BUILD.gn
fs/vfs/BUILD.gn
+1
-0
fs/vfs/Makefile
fs/vfs/Makefile
+1
-0
fs/vfs/bcache/src/bcache.c
fs/vfs/bcache/src/bcache.c
+0
-2
fs/vfs/operation/vfs_other.c
fs/vfs/operation/vfs_other.c
+0
-22
fs/vfs/vfs_cmd/vfs_shellcmd.c
fs/vfs/vfs_cmd/vfs_shellcmd.c
+1
-3
未找到文件。
fs/fat/os_adapt/fatfs.c
浏览文件 @
1ecacc15
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
#include "ff.h"
#include "ff.h"
#include "disk_pri.h"
#include "disk_pri.h"
#include "diskio.h"
#include "diskio.h"
#include "fs/file.h"
#include "fs/fs.h"
#include "fs/fs.h"
#include "fs/dirent_fs.h"
#include "fs/dirent_fs.h"
#include "fs/mount.h"
#include "fs/mount.h"
...
@@ -1297,6 +1298,29 @@ int fatfs_umount(struct Mount *mnt, struct Vnode **blkdriver)
...
@@ -1297,6 +1298,29 @@ int fatfs_umount(struct Mount *mnt, struct Vnode **blkdriver)
return
0
;
return
0
;
}
}
int
fatfs_sync_adapt
(
struct
Mount
*
mnt
)
{
(
void
)
mnt
;
int
ret
=
0
;
#ifdef LOSCFG_FS_FAT_CACHE
struct
Vnode
*
dev
=
NULL
;
los_part
*
part
=
NULL
;
if
(
mnt
==
NULL
)
{
return
-
EINVAL
;
}
dev
=
mnt
->
vnodeDev
;
part
=
los_part_find
(
dev
);
if
(
part
==
NULL
)
{
return
-
EINVAL
;
}
ret
=
OsSdSync
(
part
->
disk_id
);
#endif
return
ret
;
}
int
fatfs_statfs
(
struct
Mount
*
mnt
,
struct
statfs
*
info
)
int
fatfs_statfs
(
struct
Mount
*
mnt
,
struct
statfs
*
info
)
{
{
FATFS
*
fs
=
(
FATFS
*
)
mnt
->
data
;
FATFS
*
fs
=
(
FATFS
*
)
mnt
->
data
;
...
@@ -2207,6 +2231,7 @@ struct MountOps fatfs_mops = {
...
@@ -2207,6 +2231,7 @@ struct MountOps fatfs_mops = {
.
Mount
=
fatfs_mount
,
.
Mount
=
fatfs_mount
,
.
Unmount
=
fatfs_umount
,
.
Unmount
=
fatfs_umount
,
.
Statfs
=
fatfs_statfs
,
.
Statfs
=
fatfs_statfs
,
.
Sync
=
fatfs_sync_adapt
,
};
};
struct
file_operations_vfs
fatfs_fops
=
{
struct
file_operations_vfs
fatfs_fops
=
{
...
...
fs/include/fs/mount.h
浏览文件 @
1ecacc15
...
@@ -61,6 +61,7 @@ struct MountOps {
...
@@ -61,6 +61,7 @@ struct MountOps {
int
(
*
Mount
)(
struct
Mount
*
mount
,
struct
Vnode
*
vnode
,
const
void
*
data
);
int
(
*
Mount
)(
struct
Mount
*
mount
,
struct
Vnode
*
vnode
,
const
void
*
data
);
int
(
*
Unmount
)(
struct
Mount
*
mount
,
struct
Vnode
**
blkdriver
);
int
(
*
Unmount
)(
struct
Mount
*
mount
,
struct
Vnode
**
blkdriver
);
int
(
*
Statfs
)(
struct
Mount
*
mount
,
struct
statfs
*
sbp
);
int
(
*
Statfs
)(
struct
Mount
*
mount
,
struct
statfs
*
sbp
);
int
(
*
Sync
)(
struct
Mount
*
mount
);
};
};
typedef
int
(
*
foreach_mountpoint_t
)(
const
char
*
devpoint
,
typedef
int
(
*
foreach_mountpoint_t
)(
const
char
*
devpoint
,
...
...
fs/vfs/BUILD.gn
浏览文件 @
1ecacc15
...
@@ -71,6 +71,7 @@ kernel_module(module_name) {
...
@@ -71,6 +71,7 @@ kernel_module(module_name) {
"$LITEOSTHIRDPARTY/NuttX/fs/inode/fs_files.c",
"$LITEOSTHIRDPARTY/NuttX/fs/inode/fs_files.c",
"$LITEOSTHIRDPARTY/NuttX/fs/mount/fs_foreachmountpoint.c",
"$LITEOSTHIRDPARTY/NuttX/fs/mount/fs_foreachmountpoint.c",
"$LITEOSTHIRDPARTY/NuttX/fs/mount/fs_mount.c",
"$LITEOSTHIRDPARTY/NuttX/fs/mount/fs_mount.c",
"$LITEOSTHIRDPARTY/NuttX/fs/mount/fs_sync.c",
"$LITEOSTHIRDPARTY/NuttX/fs/mount/fs_umount.c",
"$LITEOSTHIRDPARTY/NuttX/fs/mount/fs_umount.c",
"$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_close.c",
"$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_close.c",
"$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_dup.c",
"$LITEOSTHIRDPARTY/NuttX/fs/vfs/fs_dup.c",
...
...
fs/vfs/Makefile
浏览文件 @
1ecacc15
...
@@ -80,6 +80,7 @@ $(LITEOSTHIRDPARTY)/NuttX/fs/dirent/fs_telldir.c \
...
@@ -80,6 +80,7 @@ $(LITEOSTHIRDPARTY)/NuttX/fs/dirent/fs_telldir.c \
\
\
$(LITEOSTHIRDPARTY)
/NuttX/fs/mount/fs_mount.c
\
$(LITEOSTHIRDPARTY)
/NuttX/fs/mount/fs_mount.c
\
$(LITEOSTHIRDPARTY)
/NuttX/fs/mount/fs_umount.c
\
$(LITEOSTHIRDPARTY)
/NuttX/fs/mount/fs_umount.c
\
$(LITEOSTHIRDPARTY)
/NuttX/fs/mount/fs_sync.c
\
\
\
$(LITEOSTHIRDPARTY)
/NuttX/fs/driver/fs_blockproxy.c
\
$(LITEOSTHIRDPARTY)
/NuttX/fs/driver/fs_blockproxy.c
\
$(LITEOSTHIRDPARTY)
/NuttX/fs/mount/fs_foreachmountpoint.c
\
$(LITEOSTHIRDPARTY)
/NuttX/fs/mount/fs_foreachmountpoint.c
\
...
...
fs/vfs/bcache/src/bcache.c
浏览文件 @
1ecacc15
...
@@ -1087,8 +1087,6 @@ OsBcache *BlockCacheInit(struct Vnode *devNode, UINT32 sectorSize, UINT32 sector
...
@@ -1087,8 +1087,6 @@ OsBcache *BlockCacheInit(struct Vnode *devNode, UINT32 sectorSize, UINT32 sector
return
NULL
;
return
NULL
;
}
}
set_sd_sync_fn
(
OsSdSync
);
bcacheMem
=
(
UINT8
*
)
zalloc
(
memSize
);
bcacheMem
=
(
UINT8
*
)
zalloc
(
memSize
);
if
(
bcacheMem
==
NULL
)
{
if
(
bcacheMem
==
NULL
)
{
PRINT_ERR
(
"bcache_init : malloc %u Bytes failed!
\n
"
,
memSize
);
PRINT_ERR
(
"bcache_init : malloc %u Bytes failed!
\n
"
,
memSize
);
...
...
fs/vfs/operation/vfs_other.c
浏览文件 @
1ecacc15
...
@@ -444,28 +444,6 @@ char *rindex(const char *s, int c)
...
@@ -444,28 +444,6 @@ char *rindex(const char *s, int c)
return
(
char
*
)
strrchr
(
s
,
c
);
return
(
char
*
)
strrchr
(
s
,
c
);
}
}
int
(
*
sd_sync_fn
)(
int
)
=
NULL
;
int
(
*
nand_sync_fn
)(
void
)
=
NULL
;
void
set_sd_sync_fn
(
int
(
*
sync_fn
)(
int
))
{
sd_sync_fn
=
sync_fn
;
}
void
sync
(
void
)
{
#ifdef LOSCFG_FS_FAT_CACHE
if
(
sd_sync_fn
!=
NULL
)
{
(
void
)
sd_sync_fn
(
0
);
(
void
)
sd_sync_fn
(
1
);
return
;
}
#endif
PRINT_ERR
(
"Unsupport syscall %s
\n
"
,
__FUNCTION__
);
}
static
char
*
ls_get_fullpath
(
const
char
*
path
,
struct
dirent
*
pdirent
)
static
char
*
ls_get_fullpath
(
const
char
*
path
,
struct
dirent
*
pdirent
)
{
{
char
*
fullpath
=
NULL
;
char
*
fullpath
=
NULL
;
...
...
fs/vfs/vfs_cmd/vfs_shellcmd.c
浏览文件 @
1ecacc15
...
@@ -1569,13 +1569,11 @@ int osShellCmdChgrp(int argc, const char **argv)
...
@@ -1569,13 +1569,11 @@ int osShellCmdChgrp(int argc, const char **argv)
SHELLCMD_ENTRY
(
lsfd_shellcmd
,
CMD_TYPE_EX
,
"lsfd"
,
XARGS
,
(
CmdCallBackFunc
)
osShellCmdLsfd
);
SHELLCMD_ENTRY
(
lsfd_shellcmd
,
CMD_TYPE_EX
,
"lsfd"
,
XARGS
,
(
CmdCallBackFunc
)
osShellCmdLsfd
);
SHELLCMD_ENTRY
(
statfs_shellcmd
,
CMD_TYPE_EX
,
"statfs"
,
XARGS
,
(
CmdCallBackFunc
)
osShellCmdStatfs
);
SHELLCMD_ENTRY
(
statfs_shellcmd
,
CMD_TYPE_EX
,
"statfs"
,
XARGS
,
(
CmdCallBackFunc
)
osShellCmdStatfs
);
SHELLCMD_ENTRY
(
touch_shellcmd
,
CMD_TYPE_EX
,
"touch"
,
XARGS
,
(
CmdCallBackFunc
)
osShellCmdTouch
);
SHELLCMD_ENTRY
(
touch_shellcmd
,
CMD_TYPE_EX
,
"touch"
,
XARGS
,
(
CmdCallBackFunc
)
osShellCmdTouch
);
#if (defined(LOSCFG_FS_FAT))
SHELLCMD_ENTRY
(
sync_shellcmd
,
CMD_TYPE_EX
,
"sync"
,
XARGS
,
(
CmdCallBackFunc
)
osShellCmdSync
);
#endif
#ifdef LOSCFG_KERNEL_SYSCALL
#ifdef LOSCFG_KERNEL_SYSCALL
SHELLCMD_ENTRY
(
su_shellcmd
,
CMD_TYPE_EX
,
"su"
,
XARGS
,
(
CmdCallBackFunc
)
osShellCmdSu
);
SHELLCMD_ENTRY
(
su_shellcmd
,
CMD_TYPE_EX
,
"su"
,
XARGS
,
(
CmdCallBackFunc
)
osShellCmdSu
);
#endif
#endif
#endif
#endif
SHELLCMD_ENTRY
(
sync_shellcmd
,
CMD_TYPE_EX
,
"sync"
,
XARGS
,
(
CmdCallBackFunc
)
osShellCmdSync
);
SHELLCMD_ENTRY
(
ls_shellcmd
,
CMD_TYPE_EX
,
"ls"
,
XARGS
,
(
CmdCallBackFunc
)
osShellCmdLs
);
SHELLCMD_ENTRY
(
ls_shellcmd
,
CMD_TYPE_EX
,
"ls"
,
XARGS
,
(
CmdCallBackFunc
)
osShellCmdLs
);
SHELLCMD_ENTRY
(
pwd_shellcmd
,
CMD_TYPE_EX
,
"pwd"
,
XARGS
,
(
CmdCallBackFunc
)
osShellCmdPwd
);
SHELLCMD_ENTRY
(
pwd_shellcmd
,
CMD_TYPE_EX
,
"pwd"
,
XARGS
,
(
CmdCallBackFunc
)
osShellCmdPwd
);
SHELLCMD_ENTRY
(
cd_shellcmd
,
CMD_TYPE_EX
,
"cd"
,
XARGS
,
(
CmdCallBackFunc
)
osShellCmdCd
);
SHELLCMD_ENTRY
(
cd_shellcmd
,
CMD_TYPE_EX
,
"cd"
,
XARGS
,
(
CmdCallBackFunc
)
osShellCmdCd
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录