Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
okll00
rt-thread
提交
38931765
R
rt-thread
项目概览
okll00
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
38931765
编写于
9月 26, 2020
作者:
B
Bernard Xiong
提交者:
GitHub
9月 26, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3931 from enkiller/0926
[add] DFS file system supports device types
上级
8ffe2422
50dc4146
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
4 addition
and
0 deletion
+4
-0
components/dfs/filesystems/devfs/devfs.c
components/dfs/filesystems/devfs/devfs.c
+2
-0
components/dfs/include/dfs.h
components/dfs/include/dfs.h
+1
-0
components/dfs/src/dfs.c
components/dfs/src/dfs.c
+1
-0
未找到文件。
components/dfs/filesystems/devfs/devfs.c
浏览文件 @
38931765
...
...
@@ -186,6 +186,7 @@ int dfs_device_fs_open(struct dfs_fd *file)
result
=
file
->
fops
->
open
(
file
);
if
(
result
==
RT_EOK
||
result
==
-
RT_ENOSYS
)
{
file
->
type
=
FT_DEVICE
;
return
0
;
}
}
...
...
@@ -197,6 +198,7 @@ int dfs_device_fs_open(struct dfs_fd *file)
if
(
result
==
RT_EOK
||
result
==
-
RT_ENOSYS
)
{
file
->
data
=
device
;
file
->
type
=
FT_DEVICE
;
return
RT_EOK
;
}
}
...
...
components/dfs/include/dfs.h
浏览文件 @
38931765
...
...
@@ -55,6 +55,7 @@
#define FT_SOCKET 1
/* socket file */
#define FT_DIRECTORY 2
/* directory */
#define FT_USER 3
/* user defined */
#define FT_DEVICE 4
/* device */
/* File flags */
#define DFS_F_OPEN 0x01000000
...
...
components/dfs/src/dfs.c
浏览文件 @
38931765
...
...
@@ -542,6 +542,7 @@ int list_fd(void)
else
if
(
fd
->
type
==
FT_REGULAR
)
rt_kprintf
(
"%-7.7s "
,
"file"
);
else
if
(
fd
->
type
==
FT_SOCKET
)
rt_kprintf
(
"%-7.7s "
,
"socket"
);
else
if
(
fd
->
type
==
FT_USER
)
rt_kprintf
(
"%-7.7s "
,
"user"
);
else
if
(
fd
->
type
==
FT_DEVICE
)
rt_kprintf
(
"%-7.7s "
,
"device"
);
else
rt_kprintf
(
"%-8.8s "
,
"unknown"
);
rt_kprintf
(
"%3d "
,
fd
->
ref_count
);
rt_kprintf
(
"%04x "
,
fd
->
magic
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录