Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
0bb05da2
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0bb05da2
编写于
6月 22, 2017
作者:
I
Ilya Dryomov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
libceph: osd_state is 32 bits wide in luminous
Signed-off-by:
N
Ilya Dryomov
<
idryomov@gmail.com
>
上级
9eebe45c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
23 addition
and
12 deletion
+23
-12
include/linux/ceph/osdmap.h
include/linux/ceph/osdmap.h
+2
-2
net/ceph/debugfs.c
net/ceph/debugfs.c
+1
-1
net/ceph/osdmap.c
net/ceph/osdmap.c
+20
-9
未找到文件。
include/linux/ceph/osdmap.h
浏览文件 @
0bb05da2
...
...
@@ -162,7 +162,7 @@ struct ceph_osdmap {
u32
flags
;
/* CEPH_OSDMAP_* */
u32
max_osd
;
/* size of osd_state, _offload, _addr arrays */
u
8
*
osd_state
;
/* CEPH_OSD_* */
u
32
*
osd_state
;
/* CEPH_OSD_* */
u32
*
osd_weight
;
/* 0 = failed, 0x10000 = 100% normal */
struct
ceph_entity_addr
*
osd_addr
;
...
...
@@ -203,7 +203,7 @@ static inline bool ceph_osd_is_down(struct ceph_osdmap *map, int osd)
return
!
ceph_osd_is_up
(
map
,
osd
);
}
extern
char
*
ceph_osdmap_state_str
(
char
*
str
,
int
len
,
int
state
);
char
*
ceph_osdmap_state_str
(
char
*
str
,
int
len
,
u32
state
);
extern
u32
ceph_get_primary_affinity
(
struct
ceph_osdmap
*
map
,
int
osd
);
static
inline
struct
ceph_entity_addr
*
ceph_osd_addr
(
struct
ceph_osdmap
*
map
,
...
...
net/ceph/debugfs.c
浏览文件 @
0bb05da2
...
...
@@ -77,7 +77,7 @@ static int osdmap_show(struct seq_file *s, void *p)
}
for
(
i
=
0
;
i
<
map
->
max_osd
;
i
++
)
{
struct
ceph_entity_addr
*
addr
=
&
map
->
osd_addr
[
i
];
int
state
=
map
->
osd_state
[
i
];
u32
state
=
map
->
osd_state
[
i
];
char
sb
[
64
];
seq_printf
(
s
,
"osd%d
\t
%s
\t
%3d%%
\t
(%s)
\t
%3d%%
\n
"
,
...
...
net/ceph/osdmap.c
浏览文件 @
0bb05da2
...
...
@@ -11,7 +11,7 @@
#include <linux/crush/hash.h>
#include <linux/crush/mapper.h>
char
*
ceph_osdmap_state_str
(
char
*
str
,
int
len
,
int
state
)
char
*
ceph_osdmap_state_str
(
char
*
str
,
int
len
,
u32
state
)
{
if
(
!
len
)
return
str
;
...
...
@@ -984,7 +984,7 @@ void ceph_osdmap_destroy(struct ceph_osdmap *map)
*/
static
int
osdmap_set_max_osd
(
struct
ceph_osdmap
*
map
,
int
max
)
{
u
8
*
state
;
u
32
*
state
;
u32
*
weight
;
struct
ceph_entity_addr
*
addr
;
int
i
;
...
...
@@ -1484,13 +1484,21 @@ static int osdmap_decode(void **p, void *end, struct ceph_osdmap *map)
/* osd_state, osd_weight, osd_addrs->client_addr */
ceph_decode_need
(
p
,
end
,
3
*
sizeof
(
u32
)
+
map
->
max_osd
*
(
1
+
sizeof
(
*
map
->
osd_weight
)
+
map
->
max_osd
*
((
struct_v
>=
5
?
sizeof
(
u32
)
:
sizeof
(
u8
))
+
sizeof
(
*
map
->
osd_weight
)
+
sizeof
(
*
map
->
osd_addr
)),
e_inval
);
if
(
ceph_decode_32
(
p
)
!=
map
->
max_osd
)
goto
e_inval
;
ceph_decode_copy
(
p
,
map
->
osd_state
,
map
->
max_osd
);
if
(
struct_v
>=
5
)
{
for
(
i
=
0
;
i
<
map
->
max_osd
;
i
++
)
map
->
osd_state
[
i
]
=
ceph_decode_32
(
p
);
}
else
{
for
(
i
=
0
;
i
<
map
->
max_osd
;
i
++
)
map
->
osd_state
[
i
]
=
ceph_decode_8
(
p
);
}
if
(
ceph_decode_32
(
p
)
!=
map
->
max_osd
)
goto
e_inval
;
...
...
@@ -1598,7 +1606,7 @@ struct ceph_osdmap *ceph_osdmap_decode(void **p, void *end)
* new_up_client: { osd=6, addr=... } # set osd_state and addr
* new_state: { osd=6, xorstate=EXISTS } # clear osd_state
*/
static
int
decode_new_up_state_weight
(
void
**
p
,
void
*
end
,
static
int
decode_new_up_state_weight
(
void
**
p
,
void
*
end
,
u8
struct_v
,
struct
ceph_osdmap
*
map
)
{
void
*
new_up_client
;
...
...
@@ -1614,7 +1622,7 @@ static int decode_new_up_state_weight(void **p, void *end,
new_state
=
*
p
;
ceph_decode_32_safe
(
p
,
end
,
len
,
e_inval
);
len
*=
sizeof
(
u32
)
+
sizeof
(
u8
);
len
*=
sizeof
(
u32
)
+
(
struct_v
>=
5
?
sizeof
(
u32
)
:
sizeof
(
u8
)
);
ceph_decode_need
(
p
,
end
,
len
,
e_inval
);
*
p
+=
len
;
...
...
@@ -1650,11 +1658,14 @@ static int decode_new_up_state_weight(void **p, void *end,
len
=
ceph_decode_32
(
p
);
while
(
len
--
)
{
s32
osd
;
u
8
xorstate
;
u
32
xorstate
;
int
ret
;
osd
=
ceph_decode_32
(
p
);
xorstate
=
ceph_decode_8
(
p
);
if
(
struct_v
>=
5
)
xorstate
=
ceph_decode_32
(
p
);
else
xorstate
=
ceph_decode_8
(
p
);
if
(
xorstate
==
0
)
xorstate
=
CEPH_OSD_UP
;
BUG_ON
(
osd
>=
map
->
max_osd
);
...
...
@@ -1788,7 +1799,7 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end,
}
/* new_up_client, new_state, new_weight */
err
=
decode_new_up_state_weight
(
p
,
end
,
map
);
err
=
decode_new_up_state_weight
(
p
,
end
,
struct_v
,
map
);
if
(
err
)
goto
bad
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录