Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
f78e41e3
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f78e41e3
编写于
7月 19, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
don't pass superblock to hypfs_vm_create_files()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
2b2fee80
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
35 addition
and
36 deletion
+35
-36
arch/s390/hypfs/hypfs.h
arch/s390/hypfs/hypfs.h
+1
-1
arch/s390/hypfs/hypfs_vm.c
arch/s390/hypfs/hypfs_vm.c
+32
-33
arch/s390/hypfs/inode.c
arch/s390/hypfs/inode.c
+2
-2
未找到文件。
arch/s390/hypfs/hypfs.h
浏览文件 @
f78e41e3
...
...
@@ -37,7 +37,7 @@ extern int hypfs_diag_create_files(struct super_block *sb, struct dentry *root);
/* VM Hypervisor */
extern
int
hypfs_vm_init
(
void
);
extern
void
hypfs_vm_exit
(
void
);
extern
int
hypfs_vm_create_files
(
struct
super_block
*
sb
,
struct
dentry
*
root
);
extern
int
hypfs_vm_create_files
(
struct
dentry
*
root
);
/* debugfs interface */
struct
hypfs_dbfs_file
;
...
...
arch/s390/hypfs/hypfs_vm.c
浏览文件 @
f78e41e3
...
...
@@ -107,16 +107,15 @@ static void diag2fc_free(const void *data)
vfree
(
data
);
}
#define ATTRIBUTE(
sb,
dir, name, member) \
#define ATTRIBUTE(dir, name, member) \
do { \
void *rc; \
rc = hypfs_create_u64(sb, dir, name, member); \
rc = hypfs_create_u64(
dir->d_
sb, dir, name, member); \
if (IS_ERR(rc)) \
return PTR_ERR(rc); \
} while(0)
static
int
hpyfs_vm_create_guest
(
struct
super_block
*
sb
,
struct
dentry
*
systems_dir
,
static
int
hpyfs_vm_create_guest
(
struct
dentry
*
systems_dir
,
struct
diag2fc_data
*
data
)
{
char
guest_name
[
NAME_LEN
+
1
]
=
{};
...
...
@@ -130,46 +129,46 @@ static int hpyfs_vm_create_guest(struct super_block *sb,
memcpy
(
guest_name
,
data
->
guest_name
,
NAME_LEN
);
EBCASC
(
guest_name
,
NAME_LEN
);
strim
(
guest_name
);
guest_dir
=
hypfs_mkdir
(
sb
,
systems_dir
,
guest_name
);
guest_dir
=
hypfs_mkdir
(
s
ystems_dir
->
d_s
b
,
systems_dir
,
guest_name
);
if
(
IS_ERR
(
guest_dir
))
return
PTR_ERR
(
guest_dir
);
ATTRIBUTE
(
sb
,
guest_dir
,
"onlinetime_us"
,
data
->
el_time
);
ATTRIBUTE
(
guest_dir
,
"onlinetime_us"
,
data
->
el_time
);
/* logical cpu information */
cpus_dir
=
hypfs_mkdir
(
sb
,
guest_dir
,
"cpus"
);
cpus_dir
=
hypfs_mkdir
(
guest_dir
->
d_
sb
,
guest_dir
,
"cpus"
);
if
(
IS_ERR
(
cpus_dir
))
return
PTR_ERR
(
cpus_dir
);
ATTRIBUTE
(
sb
,
cpus_dir
,
"cputime_us"
,
data
->
used_cpu
);
ATTRIBUTE
(
sb
,
cpus_dir
,
"capped"
,
capped_value
);
ATTRIBUTE
(
sb
,
cpus_dir
,
"dedicated"
,
dedicated_flag
);
ATTRIBUTE
(
sb
,
cpus_dir
,
"count"
,
data
->
vcpus
);
ATTRIBUTE
(
sb
,
cpus_dir
,
"weight_min"
,
data
->
cpu_min
);
ATTRIBUTE
(
sb
,
cpus_dir
,
"weight_max"
,
data
->
cpu_max
);
ATTRIBUTE
(
sb
,
cpus_dir
,
"weight_cur"
,
data
->
cpu_shares
);
ATTRIBUTE
(
cpus_dir
,
"cputime_us"
,
data
->
used_cpu
);
ATTRIBUTE
(
cpus_dir
,
"capped"
,
capped_value
);
ATTRIBUTE
(
cpus_dir
,
"dedicated"
,
dedicated_flag
);
ATTRIBUTE
(
cpus_dir
,
"count"
,
data
->
vcpus
);
ATTRIBUTE
(
cpus_dir
,
"weight_min"
,
data
->
cpu_min
);
ATTRIBUTE
(
cpus_dir
,
"weight_max"
,
data
->
cpu_max
);
ATTRIBUTE
(
cpus_dir
,
"weight_cur"
,
data
->
cpu_shares
);
/* memory information */
mem_dir
=
hypfs_mkdir
(
sb
,
guest_dir
,
"mem"
);
mem_dir
=
hypfs_mkdir
(
guest_dir
->
d_
sb
,
guest_dir
,
"mem"
);
if
(
IS_ERR
(
mem_dir
))
return
PTR_ERR
(
mem_dir
);
ATTRIBUTE
(
sb
,
mem_dir
,
"min_KiB"
,
data
->
mem_min_kb
);
ATTRIBUTE
(
sb
,
mem_dir
,
"max_KiB"
,
data
->
mem_max_kb
);
ATTRIBUTE
(
sb
,
mem_dir
,
"used_KiB"
,
data
->
mem_used_kb
);
ATTRIBUTE
(
sb
,
mem_dir
,
"share_KiB"
,
data
->
mem_share_kb
);
ATTRIBUTE
(
mem_dir
,
"min_KiB"
,
data
->
mem_min_kb
);
ATTRIBUTE
(
mem_dir
,
"max_KiB"
,
data
->
mem_max_kb
);
ATTRIBUTE
(
mem_dir
,
"used_KiB"
,
data
->
mem_used_kb
);
ATTRIBUTE
(
mem_dir
,
"share_KiB"
,
data
->
mem_share_kb
);
/* samples */
samples_dir
=
hypfs_mkdir
(
sb
,
guest_dir
,
"samples"
);
samples_dir
=
hypfs_mkdir
(
guest_dir
->
d_
sb
,
guest_dir
,
"samples"
);
if
(
IS_ERR
(
samples_dir
))
return
PTR_ERR
(
samples_dir
);
ATTRIBUTE
(
s
b
,
s
amples_dir
,
"cpu_using"
,
data
->
cpu_use_samp
);
ATTRIBUTE
(
s
b
,
s
amples_dir
,
"cpu_delay"
,
data
->
cpu_delay_samp
);
ATTRIBUTE
(
s
b
,
s
amples_dir
,
"mem_delay"
,
data
->
page_wait_samp
);
ATTRIBUTE
(
s
b
,
s
amples_dir
,
"idle"
,
data
->
idle_samp
);
ATTRIBUTE
(
s
b
,
s
amples_dir
,
"other"
,
data
->
other_samp
);
ATTRIBUTE
(
s
b
,
s
amples_dir
,
"total"
,
data
->
total_samp
);
ATTRIBUTE
(
samples_dir
,
"cpu_using"
,
data
->
cpu_use_samp
);
ATTRIBUTE
(
samples_dir
,
"cpu_delay"
,
data
->
cpu_delay_samp
);
ATTRIBUTE
(
samples_dir
,
"mem_delay"
,
data
->
page_wait_samp
);
ATTRIBUTE
(
samples_dir
,
"idle"
,
data
->
idle_samp
);
ATTRIBUTE
(
samples_dir
,
"other"
,
data
->
other_samp
);
ATTRIBUTE
(
samples_dir
,
"total"
,
data
->
total_samp
);
return
0
;
}
int
hypfs_vm_create_files
(
struct
super_block
*
sb
,
struct
dentry
*
root
)
int
hypfs_vm_create_files
(
struct
dentry
*
root
)
{
struct
dentry
*
dir
,
*
file
;
struct
diag2fc_data
*
data
;
...
...
@@ -181,38 +180,38 @@ int hypfs_vm_create_files(struct super_block *sb, struct dentry *root)
return
PTR_ERR
(
data
);
/* Hpervisor Info */
dir
=
hypfs_mkdir
(
sb
,
root
,
"hyp"
);
dir
=
hypfs_mkdir
(
root
->
d_
sb
,
root
,
"hyp"
);
if
(
IS_ERR
(
dir
))
{
rc
=
PTR_ERR
(
dir
);
goto
failed
;
}
file
=
hypfs_create_str
(
sb
,
dir
,
"type"
,
"z/VM Hypervisor"
);
file
=
hypfs_create_str
(
root
->
d_
sb
,
dir
,
"type"
,
"z/VM Hypervisor"
);
if
(
IS_ERR
(
file
))
{
rc
=
PTR_ERR
(
file
);
goto
failed
;
}
/* physical cpus */
dir
=
hypfs_mkdir
(
sb
,
root
,
"cpus"
);
dir
=
hypfs_mkdir
(
root
->
d_
sb
,
root
,
"cpus"
);
if
(
IS_ERR
(
dir
))
{
rc
=
PTR_ERR
(
dir
);
goto
failed
;
}
file
=
hypfs_create_u64
(
sb
,
dir
,
"count"
,
data
->
lcpus
);
file
=
hypfs_create_u64
(
root
->
d_
sb
,
dir
,
"count"
,
data
->
lcpus
);
if
(
IS_ERR
(
file
))
{
rc
=
PTR_ERR
(
file
);
goto
failed
;
}
/* guests */
dir
=
hypfs_mkdir
(
sb
,
root
,
"systems"
);
dir
=
hypfs_mkdir
(
root
->
d_
sb
,
root
,
"systems"
);
if
(
IS_ERR
(
dir
))
{
rc
=
PTR_ERR
(
dir
);
goto
failed
;
}
for
(
i
=
0
;
i
<
count
;
i
++
)
{
rc
=
hpyfs_vm_create_guest
(
sb
,
dir
,
&
(
data
[
i
]));
rc
=
hpyfs_vm_create_guest
(
dir
,
&
(
data
[
i
]));
if
(
rc
)
goto
failed
;
}
...
...
arch/s390/hypfs/inode.c
浏览文件 @
f78e41e3
...
...
@@ -193,7 +193,7 @@ static ssize_t hypfs_aio_write(struct kiocb *iocb, const struct iovec *iov,
}
hypfs_delete_tree
(
sb
->
s_root
);
if
(
MACHINE_IS_VM
)
rc
=
hypfs_vm_create_files
(
sb
,
sb
->
s_root
);
rc
=
hypfs_vm_create_files
(
sb
->
s_root
);
else
rc
=
hypfs_diag_create_files
(
sb
,
sb
->
s_root
);
if
(
rc
)
{
...
...
@@ -302,7 +302,7 @@ static int hypfs_fill_super(struct super_block *sb, void *data, int silent)
if
(
!
root_dentry
)
return
-
ENOMEM
;
if
(
MACHINE_IS_VM
)
rc
=
hypfs_vm_create_files
(
sb
,
root_dentry
);
rc
=
hypfs_vm_create_files
(
root_dentry
);
else
rc
=
hypfs_diag_create_files
(
sb
,
root_dentry
);
if
(
rc
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录