Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
a118cfdf
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
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看板
提交
a118cfdf
编写于
7月 19, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
don't pass superblock to hypfs_{mkdir,create*}
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
e334cf4f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
39 addition
and
46 deletion
+39
-46
arch/s390/hypfs/hypfs.h
arch/s390/hypfs/hypfs.h
+3
-6
arch/s390/hypfs/hypfs_diag.c
arch/s390/hypfs/hypfs_diag.c
+14
-14
arch/s390/hypfs/hypfs_vm.c
arch/s390/hypfs/hypfs_vm.c
+10
-10
arch/s390/hypfs/inode.c
arch/s390/hypfs/inode.c
+12
-16
未找到文件。
arch/s390/hypfs/hypfs.h
浏览文件 @
a118cfdf
...
...
@@ -18,15 +18,12 @@
#define UPDATE_FILE_MODE 0220
#define DIR_MODE 0550
extern
struct
dentry
*
hypfs_mkdir
(
struct
super_block
*
sb
,
struct
dentry
*
parent
,
const
char
*
name
);
extern
struct
dentry
*
hypfs_mkdir
(
struct
dentry
*
parent
,
const
char
*
name
);
extern
struct
dentry
*
hypfs_create_u64
(
struct
super_block
*
sb
,
struct
dentry
*
dir
,
const
char
*
name
,
extern
struct
dentry
*
hypfs_create_u64
(
struct
dentry
*
dir
,
const
char
*
name
,
__u64
value
);
extern
struct
dentry
*
hypfs_create_str
(
struct
super_block
*
sb
,
struct
dentry
*
dir
,
const
char
*
name
,
extern
struct
dentry
*
hypfs_create_str
(
struct
dentry
*
dir
,
const
char
*
name
,
char
*
string
);
/* LPAR Hypervisor */
...
...
arch/s390/hypfs/hypfs_diag.c
浏览文件 @
a118cfdf
...
...
@@ -631,25 +631,25 @@ static int hypfs_create_cpu_files(struct dentry *cpus_dir, void *cpu_info)
snprintf
(
buffer
,
TMP_SIZE
,
"%d"
,
cpu_info__cpu_addr
(
diag204_info_type
,
cpu_info
));
cpu_dir
=
hypfs_mkdir
(
cpus_dir
->
d_sb
,
cpus_dir
,
buffer
);
rc
=
hypfs_create_u64
(
cpu_dir
->
d_sb
,
cpu_dir
,
"mgmtime"
,
cpu_dir
=
hypfs_mkdir
(
cpus_dir
,
buffer
);
rc
=
hypfs_create_u64
(
cpu_dir
,
"mgmtime"
,
cpu_info__acc_time
(
diag204_info_type
,
cpu_info
)
-
cpu_info__lp_time
(
diag204_info_type
,
cpu_info
));
if
(
IS_ERR
(
rc
))
return
PTR_ERR
(
rc
);
rc
=
hypfs_create_u64
(
cpu_dir
->
d_sb
,
cpu_dir
,
"cputime"
,
rc
=
hypfs_create_u64
(
cpu_dir
,
"cputime"
,
cpu_info__lp_time
(
diag204_info_type
,
cpu_info
));
if
(
IS_ERR
(
rc
))
return
PTR_ERR
(
rc
);
if
(
diag204_info_type
==
INFO_EXT
)
{
rc
=
hypfs_create_u64
(
cpu_dir
->
d_sb
,
cpu_dir
,
"onlinetime"
,
rc
=
hypfs_create_u64
(
cpu_dir
,
"onlinetime"
,
cpu_info__online_time
(
diag204_info_type
,
cpu_info
));
if
(
IS_ERR
(
rc
))
return
PTR_ERR
(
rc
);
}
diag224_idx2name
(
cpu_info__ctidx
(
diag204_info_type
,
cpu_info
),
buffer
);
rc
=
hypfs_create_str
(
cpu_dir
->
d_sb
,
cpu_dir
,
"type"
,
buffer
);
rc
=
hypfs_create_str
(
cpu_dir
,
"type"
,
buffer
);
return
PTR_RET
(
rc
);
}
...
...
@@ -663,10 +663,10 @@ static void *hypfs_create_lpar_files(struct dentry *systems_dir, void *part_hdr)
part_hdr__part_name
(
diag204_info_type
,
part_hdr
,
lpar_name
);
lpar_name
[
LPAR_NAME_LEN
]
=
0
;
lpar_dir
=
hypfs_mkdir
(
systems_dir
->
d_sb
,
systems_dir
,
lpar_name
);
lpar_dir
=
hypfs_mkdir
(
systems_dir
,
lpar_name
);
if
(
IS_ERR
(
lpar_dir
))
return
lpar_dir
;
cpus_dir
=
hypfs_mkdir
(
lpar_dir
->
d_sb
,
lpar_dir
,
"cpus"
);
cpus_dir
=
hypfs_mkdir
(
lpar_dir
,
"cpus"
);
if
(
IS_ERR
(
cpus_dir
))
return
cpus_dir
;
cpu_info
=
part_hdr
+
part_hdr__size
(
diag204_info_type
);
...
...
@@ -688,15 +688,15 @@ static int hypfs_create_phys_cpu_files(struct dentry *cpus_dir, void *cpu_info)
snprintf
(
buffer
,
TMP_SIZE
,
"%i"
,
phys_cpu__cpu_addr
(
diag204_info_type
,
cpu_info
));
cpu_dir
=
hypfs_mkdir
(
cpus_dir
->
d_sb
,
cpus_dir
,
buffer
);
cpu_dir
=
hypfs_mkdir
(
cpus_dir
,
buffer
);
if
(
IS_ERR
(
cpu_dir
))
return
PTR_ERR
(
cpu_dir
);
rc
=
hypfs_create_u64
(
cpu_dir
->
d_sb
,
cpu_dir
,
"mgmtime"
,
rc
=
hypfs_create_u64
(
cpu_dir
,
"mgmtime"
,
phys_cpu__mgm_time
(
diag204_info_type
,
cpu_info
));
if
(
IS_ERR
(
rc
))
return
PTR_ERR
(
rc
);
diag224_idx2name
(
phys_cpu__ctidx
(
diag204_info_type
,
cpu_info
),
buffer
);
rc
=
hypfs_create_str
(
cpu_dir
->
d_sb
,
cpu_dir
,
"type"
,
buffer
);
rc
=
hypfs_create_str
(
cpu_dir
,
"type"
,
buffer
);
return
PTR_RET
(
rc
);
}
...
...
@@ -706,7 +706,7 @@ static void *hypfs_create_phys_files(struct dentry *parent_dir, void *phys_hdr)
void
*
cpu_info
;
struct
dentry
*
cpus_dir
;
cpus_dir
=
hypfs_mkdir
(
parent_dir
->
d_sb
,
parent_dir
,
"cpus"
);
cpus_dir
=
hypfs_mkdir
(
parent_dir
,
"cpus"
);
if
(
IS_ERR
(
cpus_dir
))
return
cpus_dir
;
cpu_info
=
phys_hdr
+
phys_hdr__size
(
diag204_info_type
);
...
...
@@ -731,7 +731,7 @@ int hypfs_diag_create_files(struct dentry *root)
if
(
IS_ERR
(
buffer
))
return
PTR_ERR
(
buffer
);
systems_dir
=
hypfs_mkdir
(
root
->
d_sb
,
root
,
"systems"
);
systems_dir
=
hypfs_mkdir
(
root
,
"systems"
);
if
(
IS_ERR
(
systems_dir
))
{
rc
=
PTR_ERR
(
systems_dir
);
goto
err_out
;
...
...
@@ -752,12 +752,12 @@ int hypfs_diag_create_files(struct dentry *root)
goto
err_out
;
}
}
hyp_dir
=
hypfs_mkdir
(
root
->
d_sb
,
root
,
"hyp"
);
hyp_dir
=
hypfs_mkdir
(
root
,
"hyp"
);
if
(
IS_ERR
(
hyp_dir
))
{
rc
=
PTR_ERR
(
hyp_dir
);
goto
err_out
;
}
ptr
=
hypfs_create_str
(
root
->
d_sb
,
hyp_dir
,
"type"
,
"LPAR Hypervisor"
);
ptr
=
hypfs_create_str
(
hyp_dir
,
"type"
,
"LPAR Hypervisor"
);
if
(
IS_ERR
(
ptr
))
{
rc
=
PTR_ERR
(
ptr
);
goto
err_out
;
...
...
arch/s390/hypfs/hypfs_vm.c
浏览文件 @
a118cfdf
...
...
@@ -110,7 +110,7 @@ static void diag2fc_free(const void *data)
#define ATTRIBUTE(dir, name, member) \
do { \
void *rc; \
rc = hypfs_create_u64(dir
->d_sb, dir
, name, member); \
rc = hypfs_create_u64(dir, name, member); \
if (IS_ERR(rc)) \
return PTR_ERR(rc); \
} while(0)
...
...
@@ -129,13 +129,13 @@ static int hpyfs_vm_create_guest(struct dentry *systems_dir,
memcpy
(
guest_name
,
data
->
guest_name
,
NAME_LEN
);
EBCASC
(
guest_name
,
NAME_LEN
);
strim
(
guest_name
);
guest_dir
=
hypfs_mkdir
(
systems_dir
->
d_sb
,
systems_dir
,
guest_name
);
guest_dir
=
hypfs_mkdir
(
systems_dir
,
guest_name
);
if
(
IS_ERR
(
guest_dir
))
return
PTR_ERR
(
guest_dir
);
ATTRIBUTE
(
guest_dir
,
"onlinetime_us"
,
data
->
el_time
);
/* logical cpu information */
cpus_dir
=
hypfs_mkdir
(
guest_dir
->
d_sb
,
guest_dir
,
"cpus"
);
cpus_dir
=
hypfs_mkdir
(
guest_dir
,
"cpus"
);
if
(
IS_ERR
(
cpus_dir
))
return
PTR_ERR
(
cpus_dir
);
ATTRIBUTE
(
cpus_dir
,
"cputime_us"
,
data
->
used_cpu
);
...
...
@@ -147,7 +147,7 @@ static int hpyfs_vm_create_guest(struct dentry *systems_dir,
ATTRIBUTE
(
cpus_dir
,
"weight_cur"
,
data
->
cpu_shares
);
/* memory information */
mem_dir
=
hypfs_mkdir
(
guest_dir
->
d_sb
,
guest_dir
,
"mem"
);
mem_dir
=
hypfs_mkdir
(
guest_dir
,
"mem"
);
if
(
IS_ERR
(
mem_dir
))
return
PTR_ERR
(
mem_dir
);
ATTRIBUTE
(
mem_dir
,
"min_KiB"
,
data
->
mem_min_kb
);
...
...
@@ -156,7 +156,7 @@ static int hpyfs_vm_create_guest(struct dentry *systems_dir,
ATTRIBUTE
(
mem_dir
,
"share_KiB"
,
data
->
mem_share_kb
);
/* samples */
samples_dir
=
hypfs_mkdir
(
guest_dir
->
d_sb
,
guest_dir
,
"samples"
);
samples_dir
=
hypfs_mkdir
(
guest_dir
,
"samples"
);
if
(
IS_ERR
(
samples_dir
))
return
PTR_ERR
(
samples_dir
);
ATTRIBUTE
(
samples_dir
,
"cpu_using"
,
data
->
cpu_use_samp
);
...
...
@@ -180,31 +180,31 @@ int hypfs_vm_create_files(struct dentry *root)
return
PTR_ERR
(
data
);
/* Hpervisor Info */
dir
=
hypfs_mkdir
(
root
->
d_sb
,
root
,
"hyp"
);
dir
=
hypfs_mkdir
(
root
,
"hyp"
);
if
(
IS_ERR
(
dir
))
{
rc
=
PTR_ERR
(
dir
);
goto
failed
;
}
file
=
hypfs_create_str
(
root
->
d_sb
,
dir
,
"type"
,
"z/VM Hypervisor"
);
file
=
hypfs_create_str
(
dir
,
"type"
,
"z/VM Hypervisor"
);
if
(
IS_ERR
(
file
))
{
rc
=
PTR_ERR
(
file
);
goto
failed
;
}
/* physical cpus */
dir
=
hypfs_mkdir
(
root
->
d_sb
,
root
,
"cpus"
);
dir
=
hypfs_mkdir
(
root
,
"cpus"
);
if
(
IS_ERR
(
dir
))
{
rc
=
PTR_ERR
(
dir
);
goto
failed
;
}
file
=
hypfs_create_u64
(
root
->
d_sb
,
dir
,
"count"
,
data
->
lcpus
);
file
=
hypfs_create_u64
(
dir
,
"count"
,
data
->
lcpus
);
if
(
IS_ERR
(
file
))
{
rc
=
PTR_ERR
(
file
);
goto
failed
;
}
/* guests */
dir
=
hypfs_mkdir
(
root
->
d_sb
,
root
,
"systems"
);
dir
=
hypfs_mkdir
(
root
,
"systems"
);
if
(
IS_ERR
(
dir
))
{
rc
=
PTR_ERR
(
dir
);
goto
failed
;
...
...
arch/s390/hypfs/inode.c
浏览文件 @
a118cfdf
...
...
@@ -28,8 +28,7 @@
#define HYPFS_MAGIC 0x687970
/* ASCII 'hyp' */
#define TMP_SIZE 64
/* size of temporary buffers */
static
struct
dentry
*
hypfs_create_update_file
(
struct
super_block
*
sb
,
struct
dentry
*
dir
);
static
struct
dentry
*
hypfs_create_update_file
(
struct
dentry
*
dir
);
struct
hypfs_sb_info
{
kuid_t
uid
;
/* uid used for files and dirs */
...
...
@@ -307,7 +306,7 @@ static int hypfs_fill_super(struct super_block *sb, void *data, int silent)
rc
=
hypfs_diag_create_files
(
root_dentry
);
if
(
rc
)
return
rc
;
sbi
->
update_file
=
hypfs_create_update_file
(
sb
,
root_dentry
);
sbi
->
update_file
=
hypfs_create_update_file
(
root_dentry
);
if
(
IS_ERR
(
sbi
->
update_file
))
return
PTR_ERR
(
sbi
->
update_file
);
hypfs_update_update
(
sb
);
...
...
@@ -334,8 +333,7 @@ static void hypfs_kill_super(struct super_block *sb)
kill_litter_super
(
sb
);
}
static
struct
dentry
*
hypfs_create_file
(
struct
super_block
*
sb
,
struct
dentry
*
parent
,
const
char
*
name
,
static
struct
dentry
*
hypfs_create_file
(
struct
dentry
*
parent
,
const
char
*
name
,
char
*
data
,
umode_t
mode
)
{
struct
dentry
*
dentry
;
...
...
@@ -347,7 +345,7 @@ static struct dentry *hypfs_create_file(struct super_block *sb,
dentry
=
ERR_PTR
(
-
ENOMEM
);
goto
fail
;
}
inode
=
hypfs_make_inode
(
sb
,
mode
);
inode
=
hypfs_make_inode
(
parent
->
d_
sb
,
mode
);
if
(
!
inode
)
{
dput
(
dentry
);
dentry
=
ERR_PTR
(
-
ENOMEM
);
...
...
@@ -373,24 +371,22 @@ static struct dentry *hypfs_create_file(struct super_block *sb,
return
dentry
;
}
struct
dentry
*
hypfs_mkdir
(
struct
super_block
*
sb
,
struct
dentry
*
parent
,
const
char
*
name
)
struct
dentry
*
hypfs_mkdir
(
struct
dentry
*
parent
,
const
char
*
name
)
{
struct
dentry
*
dentry
;
dentry
=
hypfs_create_file
(
sb
,
parent
,
name
,
NULL
,
S_IFDIR
|
DIR_MODE
);
dentry
=
hypfs_create_file
(
parent
,
name
,
NULL
,
S_IFDIR
|
DIR_MODE
);
if
(
IS_ERR
(
dentry
))
return
dentry
;
hypfs_add_dentry
(
dentry
);
return
dentry
;
}
static
struct
dentry
*
hypfs_create_update_file
(
struct
super_block
*
sb
,
struct
dentry
*
dir
)
static
struct
dentry
*
hypfs_create_update_file
(
struct
dentry
*
dir
)
{
struct
dentry
*
dentry
;
dentry
=
hypfs_create_file
(
sb
,
dir
,
"update"
,
NULL
,
dentry
=
hypfs_create_file
(
dir
,
"update"
,
NULL
,
S_IFREG
|
UPDATE_FILE_MODE
);
/*
* We do not put the update file on the 'delete' list with
...
...
@@ -400,7 +396,7 @@ static struct dentry *hypfs_create_update_file(struct super_block *sb,
return
dentry
;
}
struct
dentry
*
hypfs_create_u64
(
struct
super_block
*
sb
,
struct
dentry
*
dir
,
struct
dentry
*
hypfs_create_u64
(
struct
dentry
*
dir
,
const
char
*
name
,
__u64
value
)
{
char
*
buffer
;
...
...
@@ -412,7 +408,7 @@ struct dentry *hypfs_create_u64(struct super_block *sb, struct dentry *dir,
if
(
!
buffer
)
return
ERR_PTR
(
-
ENOMEM
);
dentry
=
hypfs_create_file
(
sb
,
dir
,
name
,
buffer
,
S_IFREG
|
REG_FILE_MODE
);
hypfs_create_file
(
dir
,
name
,
buffer
,
S_IFREG
|
REG_FILE_MODE
);
if
(
IS_ERR
(
dentry
))
{
kfree
(
buffer
);
return
ERR_PTR
(
-
ENOMEM
);
...
...
@@ -421,7 +417,7 @@ struct dentry *hypfs_create_u64(struct super_block *sb, struct dentry *dir,
return
dentry
;
}
struct
dentry
*
hypfs_create_str
(
struct
super_block
*
sb
,
struct
dentry
*
dir
,
struct
dentry
*
hypfs_create_str
(
struct
dentry
*
dir
,
const
char
*
name
,
char
*
string
)
{
char
*
buffer
;
...
...
@@ -432,7 +428,7 @@ struct dentry *hypfs_create_str(struct super_block *sb, struct dentry *dir,
return
ERR_PTR
(
-
ENOMEM
);
sprintf
(
buffer
,
"%s
\n
"
,
string
);
dentry
=
hypfs_create_file
(
sb
,
dir
,
name
,
buffer
,
S_IFREG
|
REG_FILE_MODE
);
hypfs_create_file
(
dir
,
name
,
buffer
,
S_IFREG
|
REG_FILE_MODE
);
if
(
IS_ERR
(
dentry
))
{
kfree
(
buffer
);
return
ERR_PTR
(
-
ENOMEM
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录