Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
iSulad
提交
5646e5f7
I
iSulad
项目概览
openeuler
/
iSulad
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
iSulad
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5646e5f7
编写于
6月 29, 2020
作者:
G
gaohuatao
提交者:
lifeng68
7月 25, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
devmapper: fix cri get fsusage bug to adapt devmapper
Signed-off-by:
N
gaohuatao
<
gaohuatao@huawei.com
>
上级
2ff368ca
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
15 deletion
+28
-15
src/daemon/cri/cri_container.cc
src/daemon/cri/cri_container.cc
+24
-15
src/daemon/image/oci/storage/layer_store/graphdriver/devmapper/deviceset.c
...oci/storage/layer_store/graphdriver/devmapper/deviceset.c
+4
-0
未找到文件。
src/daemon/cri/cri_container.cc
浏览文件 @
5646e5f7
...
@@ -891,6 +891,29 @@ void CRIRuntimeServiceImpl::PackContainerStatsAttributes(
...
@@ -891,6 +891,29 @@ void CRIRuntimeServiceImpl::PackContainerStatsAttributes(
}
}
}
}
static
void
SetFsUsage
(
const
imagetool_fs_info
*
fs_usage
,
std
::
unique_ptr
<
runtime
::
v1alpha2
::
ContainerStats
>
&
container
)
{
if
(
fs_usage
==
nullptr
||
fs_usage
->
image_filesystems
[
0
]
==
nullptr
)
{
container
->
mutable_writable_layer
()
->
mutable_used_bytes
()
->
set_value
(
0
);
container
->
mutable_writable_layer
()
->
mutable_inodes_used
()
->
set_value
(
0
);
return
;
}
if
(
fs_usage
->
image_filesystems
[
0
]
->
used_bytes
==
nullptr
)
{
container
->
mutable_writable_layer
()
->
mutable_used_bytes
()
->
set_value
(
0
);
}
else
{
container
->
mutable_writable_layer
()
->
mutable_used_bytes
()
->
set_value
(
fs_usage
->
image_filesystems
[
0
]
->
used_bytes
->
value
);
}
if
(
fs_usage
->
image_filesystems
[
0
]
->
inodes_used
==
nullptr
)
{
container
->
mutable_writable_layer
()
->
mutable_inodes_used
()
->
set_value
(
0
);
}
else
{
container
->
mutable_writable_layer
()
->
mutable_inodes_used
()
->
set_value
(
fs_usage
->
image_filesystems
[
0
]
->
inodes_used
->
value
);
}
}
void
CRIRuntimeServiceImpl
::
PackContainerStatsFilesystemUsage
(
void
CRIRuntimeServiceImpl
::
PackContainerStatsFilesystemUsage
(
const
char
*
id
,
const
char
*
image_type
,
const
char
*
id
,
const
char
*
image_type
,
std
::
unique_ptr
<
runtime
::
v1alpha2
::
ContainerStats
>
&
container
,
std
::
unique_ptr
<
runtime
::
v1alpha2
::
ContainerStats
>
&
container
,
...
@@ -905,21 +928,7 @@ void CRIRuntimeServiceImpl::PackContainerStatsFilesystemUsage(
...
@@ -905,21 +928,7 @@ void CRIRuntimeServiceImpl::PackContainerStatsFilesystemUsage(
ERROR
(
"Failed to get container filesystem usage"
);
ERROR
(
"Failed to get container filesystem usage"
);
}
}
if
(
fs_usage
==
nullptr
)
{
SetFsUsage
(
fs_usage
,
container
);
container
->
mutable_writable_layer
()
->
mutable_used_bytes
()
->
set_value
(
0
);
container
->
mutable_writable_layer
()
->
mutable_inodes_used
()
->
set_value
(
0
);
}
else
{
if
(
fs_usage
->
image_filesystems
[
0
]
->
used_bytes
->
value
)
{
container
->
mutable_writable_layer
()
->
mutable_used_bytes
()
->
set_value
(
fs_usage
->
image_filesystems
[
0
]
->
used_bytes
->
value
);
}
if
(
fs_usage
->
image_filesystems
[
0
]
->
inodes_used
->
value
)
{
container
->
mutable_writable_layer
()
->
mutable_inodes_used
()
->
set_value
(
fs_usage
->
image_filesystems
[
0
]
->
inodes_used
->
value
);
}
}
free_imagetool_fs_info
(
fs_usage
);
free_imagetool_fs_info
(
fs_usage
);
}
}
...
...
src/daemon/image/oci/storage/layer_store/graphdriver/devmapper/deviceset.c
浏览文件 @
5646e5f7
...
@@ -789,6 +789,7 @@ static void construct_device_id_map(struct device_set *devset)
...
@@ -789,6 +789,7 @@ static void construct_device_id_map(struct device_set *devset)
mark_device_id_used
(
devset
,
device_info
->
info
->
device_id
);
mark_device_id_used
(
devset
,
device_info
->
info
->
device_id
);
devmapper_device_info_ref_dec
(
device_info
);
devmapper_device_info_ref_dec
(
device_info
);
}
}
util_free_array
(
dev_arr
);
}
}
static
void
count_deleted_devices
(
struct
device_set
*
devset
)
static
void
count_deleted_devices
(
struct
device_set
*
devset
)
...
@@ -812,6 +813,7 @@ static void count_deleted_devices(struct device_set *devset)
...
@@ -812,6 +813,7 @@ static void count_deleted_devices(struct device_set *devset)
}
}
devmapper_device_info_ref_dec
(
device_info
);
devmapper_device_info_ref_dec
(
device_info
);
}
}
util_free_array
(
dev_arr
);
}
}
static
int
remove_transaction_metadata
(
struct
device_set
*
devset
)
static
int
remove_transaction_metadata
(
struct
device_set
*
devset
)
...
@@ -2383,6 +2385,8 @@ static int do_check_all_devices(struct device_set *devset)
...
@@ -2383,6 +2385,8 @@ static int do_check_all_devices(struct device_set *devset)
if
(
!
util_has_prefix
(
devices_list
[
i
],
devset
->
device_prefix
))
{
if
(
!
util_has_prefix
(
devices_list
[
i
],
devset
->
device_prefix
))
{
continue
;
continue
;
}
}
UTIL_FREE_AND_SET_NULL
(
target_type
);
UTIL_FREE_AND_SET_NULL
(
params
);
if
(
dev_get_status
(
&
start
,
&
length
,
&
target_type
,
&
params
,
devices_list
[
i
])
!=
0
)
{
if
(
dev_get_status
(
&
start
,
&
length
,
&
target_type
,
&
params
,
devices_list
[
i
])
!=
0
)
{
WARN
(
"devmapper: get device status %s failed"
,
devices_list
[
i
]);
WARN
(
"devmapper: get device status %s failed"
,
devices_list
[
i
]);
continue
;
continue
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录