Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
2c3f3dc3
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看板
提交
2c3f3dc3
编写于
12月 20, 2019
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
switch rbd and libceph to p_log-based primitives
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
3fbb8d55
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
20 deletion
+20
-20
drivers/block/rbd.c
drivers/block/rbd.c
+6
-8
net/ceph/ceph_common.c
net/ceph/ceph_common.c
+14
-12
未找到文件。
drivers/block/rbd.c
浏览文件 @
2c3f3dc3
...
...
@@ -6363,10 +6363,9 @@ static int rbd_parse_param(struct fs_parameter *param,
token
=
fs_parse
(
NULL
,
&
rbd_parameters
,
param
,
&
result
);
dout
(
"%s fs_parse '%s' token %d
\n
"
,
__func__
,
param
->
key
,
token
);
if
(
token
<
0
)
{
if
(
token
==
-
ENOPARAM
)
{
return
invalf
(
NULL
,
"rbd: Unknown parameter '%s'"
,
param
->
key
);
}
if
(
token
==
-
ENOPARAM
)
return
inval_plog
(
&
log
,
"Unknown parameter '%s'"
,
param
->
key
);
return
token
;
}
...
...
@@ -6379,9 +6378,8 @@ static int rbd_parse_param(struct fs_parameter *param,
case
Opt_alloc_size
:
if
(
result
.
uint_32
<
SECTOR_SIZE
)
goto
out_of_range
;
if
(
!
is_power_of_2
(
result
.
uint_32
))
{
return
invalf
(
NULL
,
"rbd: alloc_size must be a power of 2"
);
}
if
(
!
is_power_of_2
(
result
.
uint_32
))
return
inval_plog
(
&
log
,
"alloc_size must be a power of 2"
);
opt
->
alloc_size
=
result
.
uint_32
;
break
;
case
Opt_lock_timeout
:
...
...
@@ -6417,7 +6415,7 @@ static int rbd_parse_param(struct fs_parameter *param,
return
0
;
out_of_range:
return
inval
f
(
NULL
,
"rbd:
%s out of range"
,
param
->
key
);
return
inval
_plog
(
&
log
,
"
%s out of range"
,
param
->
key
);
}
/*
...
...
net/ceph/ceph_common.c
浏览文件 @
2c3f3dc3
...
...
@@ -337,7 +337,7 @@ EXPORT_SYMBOL(ceph_destroy_options);
/* get secret from key store */
static
int
get_secret
(
struct
ceph_crypto_key
*
dst
,
const
char
*
name
,
struct
fs_context
*
fc
)
struct
p_log
*
log
)
{
struct
key
*
ukey
;
int
key_err
;
...
...
@@ -351,19 +351,19 @@ static int get_secret(struct ceph_crypto_key *dst, const char *name,
key_err
=
PTR_ERR
(
ukey
);
switch
(
key_err
)
{
case
-
ENOKEY
:
error
f
(
fc
,
"libceph:
Failed due to key not found: %s"
,
error
_plog
(
log
,
"
Failed due to key not found: %s"
,
name
);
break
;
case
-
EKEYEXPIRED
:
error
f
(
fc
,
"libceph:
Failed due to expired key: %s"
,
error
_plog
(
log
,
"
Failed due to expired key: %s"
,
name
);
break
;
case
-
EKEYREVOKED
:
error
f
(
fc
,
"libceph:
Failed due to revoked key: %s"
,
error
_plog
(
log
,
"
Failed due to revoked key: %s"
,
name
);
break
;
default:
error
f
(
fc
,
"libceph:
Failed due to key error %d: %s"
,
error
_plog
(
log
,
"
Failed due to key error %d: %s"
,
key_err
,
name
);
}
err
=
-
EPERM
;
...
...
@@ -385,13 +385,14 @@ static int get_secret(struct ceph_crypto_key *dst, const char *name,
int
ceph_parse_mon_ips
(
const
char
*
buf
,
size_t
len
,
struct
ceph_options
*
opt
,
struct
fs_context
*
fc
)
{
struct
p_log
log
=
{.
prefix
=
"libceph"
,
.
log
=
fc
?
fc
->
log
:
NULL
};
int
ret
;
/* ip1[:port1][,ip2[:port2]...] */
ret
=
ceph_parse_ips
(
buf
,
buf
+
len
,
opt
->
mon_addr
,
CEPH_MAX_MON
,
&
opt
->
num_mon
);
if
(
ret
)
{
error
f
(
fc
,
"libceph:
Failed to parse monitor IPs: %d"
,
ret
);
error
_plog
(
&
log
,
"
Failed to parse monitor IPs: %d"
,
ret
);
return
ret
;
}
...
...
@@ -404,6 +405,7 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
{
struct
fs_parse_result
result
;
int
token
,
err
;
struct
p_log
log
=
{.
prefix
=
"libceph"
,
.
log
=
fc
?
fc
->
log
:
NULL
};
token
=
fs_parse
(
fc
,
&
ceph_parameters
,
param
,
&
result
);
dout
(
"%s fs_parse '%s' token %d
\n
"
,
__func__
,
param
->
key
,
token
);
...
...
@@ -417,7 +419,7 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
&
opt
->
my_addr
,
1
,
NULL
);
if
(
err
)
{
error
f
(
fc
,
"libceph:
Failed to parse ip: %d"
,
err
);
error
_plog
(
&
log
,
"
Failed to parse ip: %d"
,
err
);
return
err
;
}
opt
->
flags
|=
CEPH_OPT_MYIP
;
...
...
@@ -426,7 +428,7 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
case
Opt_fsid
:
err
=
parse_fsid
(
param
->
string
,
&
opt
->
fsid
);
if
(
err
)
{
error
f
(
fc
,
"libceph:
Failed to parse fsid: %d"
,
err
);
error
_plog
(
&
log
,
"
Failed to parse fsid: %d"
,
err
);
return
err
;
}
opt
->
flags
|=
CEPH_OPT_FSID
;
...
...
@@ -445,7 +447,7 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
return
-
ENOMEM
;
err
=
ceph_crypto_key_unarmor
(
opt
->
key
,
param
->
string
);
if
(
err
)
{
error
f
(
fc
,
"libceph:
Failed to parse secret: %d"
,
err
);
error
_plog
(
&
log
,
"
Failed to parse secret: %d"
,
err
);
return
err
;
}
break
;
...
...
@@ -456,10 +458,10 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
opt
->
key
=
kzalloc
(
sizeof
(
*
opt
->
key
),
GFP_KERNEL
);
if
(
!
opt
->
key
)
return
-
ENOMEM
;
return
get_secret
(
opt
->
key
,
param
->
string
,
fc
);
return
get_secret
(
opt
->
key
,
param
->
string
,
&
log
);
case
Opt_osdtimeout
:
warn
f
(
fc
,
"libceph:
Ignoring osdtimeout"
);
warn
_plog
(
&
log
,
"
Ignoring osdtimeout"
);
break
;
case
Opt_osdkeepalivetimeout
:
/* 0 isn't well defined right now, reject it */
...
...
@@ -530,7 +532,7 @@ int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
return
0
;
out_of_range:
return
inval
f
(
fc
,
"libceph:
%s out of range"
,
param
->
key
);
return
inval
_plog
(
&
log
,
"
%s out of range"
,
param
->
key
);
}
EXPORT_SYMBOL
(
ceph_parse_param
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录