Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
d0e46f88
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d0e46f88
编写于
7月 26, 2010
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
convert sysfs
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
f7e83571
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
13 addition
and
19 deletion
+13
-19
fs/sysfs/mount.c
fs/sysfs/mount.c
+13
-19
未找到文件。
fs/sysfs/mount.c
浏览文件 @
d0e46f88
...
...
@@ -23,7 +23,7 @@
#include "sysfs.h"
static
struct
vfsmount
*
sysfs_m
ou
nt
;
static
struct
vfsmount
*
sysfs_mnt
;
struct
kmem_cache
*
sysfs_dir_cachep
;
static
const
struct
super_operations
sysfs_ops
=
{
...
...
@@ -95,18 +95,17 @@ static int sysfs_set_super(struct super_block *sb, void *data)
return
error
;
}
static
int
sysfs_get_sb
(
struct
file_system_type
*
fs_type
,
int
flags
,
const
char
*
dev_name
,
void
*
data
,
struct
vfsmount
*
mnt
)
static
struct
dentry
*
sysfs_mount
(
struct
file_system_type
*
fs_type
,
int
flags
,
const
char
*
dev_name
,
void
*
data
)
{
struct
sysfs_super_info
*
info
;
enum
kobj_ns_type
type
;
struct
super_block
*
sb
;
int
error
;
error
=
-
ENOMEM
;
info
=
kzalloc
(
sizeof
(
*
info
),
GFP_KERNEL
);
if
(
!
info
)
goto
out
;
return
ERR_PTR
(
-
ENOMEM
)
;
for
(
type
=
KOBJ_NS_TYPE_NONE
;
type
<
KOBJ_NS_TYPES
;
type
++
)
info
->
ns
[
type
]
=
kobj_ns_current
(
type
);
...
...
@@ -114,24 +113,19 @@ static int sysfs_get_sb(struct file_system_type *fs_type,
sb
=
sget
(
fs_type
,
sysfs_test_super
,
sysfs_set_super
,
info
);
if
(
IS_ERR
(
sb
)
||
sb
->
s_fs_info
!=
info
)
kfree
(
info
);
if
(
IS_ERR
(
sb
))
{
error
=
PTR_ERR
(
sb
);
goto
out
;
}
if
(
IS_ERR
(
sb
))
return
ERR_CAST
(
sb
);
if
(
!
sb
->
s_root
)
{
sb
->
s_flags
=
flags
;
error
=
sysfs_fill_super
(
sb
,
data
,
flags
&
MS_SILENT
?
1
:
0
);
if
(
error
)
{
deactivate_locked_super
(
sb
);
goto
out
;
return
ERR_PTR
(
error
)
;
}
sb
->
s_flags
|=
MS_ACTIVE
;
}
simple_set_mnt
(
mnt
,
sb
);
error
=
0
;
out:
return
error
;
return
dget
(
sb
->
s_root
);
}
static
void
sysfs_kill_sb
(
struct
super_block
*
sb
)
...
...
@@ -147,7 +141,7 @@ static void sysfs_kill_sb(struct super_block *sb)
static
struct
file_system_type
sysfs_fs_type
=
{
.
name
=
"sysfs"
,
.
get_sb
=
sysfs_get_sb
,
.
mount
=
sysfs_mount
,
.
kill_sb
=
sysfs_kill_sb
,
};
...
...
@@ -189,11 +183,11 @@ int __init sysfs_init(void)
err
=
register_filesystem
(
&
sysfs_fs_type
);
if
(
!
err
)
{
sysfs_m
ou
nt
=
kern_mount
(
&
sysfs_fs_type
);
if
(
IS_ERR
(
sysfs_m
ou
nt
))
{
sysfs_mnt
=
kern_mount
(
&
sysfs_fs_type
);
if
(
IS_ERR
(
sysfs_mnt
))
{
printk
(
KERN_ERR
"sysfs: could not mount!
\n
"
);
err
=
PTR_ERR
(
sysfs_m
ou
nt
);
sysfs_m
ou
nt
=
NULL
;
err
=
PTR_ERR
(
sysfs_mnt
);
sysfs_mnt
=
NULL
;
unregister_filesystem
(
&
sysfs_fs_type
);
goto
out_err
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录