Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
iSulad
提交
91f6a548
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,发现更多精彩内容 >>
提交
91f6a548
编写于
4月 10, 2020
作者:
L
LiFeng
提交者:
lifeng68
7月 25, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
storage: API add implement add names
Signed-off-by:
N
LiFeng
<
lifeng68@huawei.com
>
上级
201a7576
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
35 addition
and
4 deletion
+35
-4
src/image/oci/storage/storage.c
src/image/oci/storage/storage.c
+31
-2
src/image/oci/storage/storage.h
src/image/oci/storage/storage.h
+4
-2
未找到文件。
src/image/oci/storage/storage.c
浏览文件 @
91f6a548
...
@@ -130,7 +130,7 @@ out:
...
@@ -130,7 +130,7 @@ out:
return
ret
;
return
ret
;
}
}
struct
layer
*
storage_layer_get
(
const
char
*
id
)
struct
layer
*
storage_layer_get
(
const
char
*
layer_
id
)
{
{
// TODO call layer_store functions to get layer info
// TODO call layer_store functions to get layer info
return
NULL
;
return
NULL
;
...
@@ -154,7 +154,7 @@ void free_layer(struct layer *ptr)
...
@@ -154,7 +154,7 @@ void free_layer(struct layer *ptr)
free
(
ptr
);
free
(
ptr
);
}
}
int
storage_layer_try_repair_lowers
(
const
char
*
id
,
const
char
*
last_layer_id
)
int
storage_layer_try_repair_lowers
(
const
char
*
layer_
id
,
const
char
*
last_layer_id
)
{
{
// TODO layer_store_try_repair_lowers
// TODO layer_store_try_repair_lowers
int
ret
=
0
;
int
ret
=
0
;
...
@@ -162,6 +162,35 @@ int storage_layer_try_repair_lowers(const char *id, const char *last_layer_id)
...
@@ -162,6 +162,35 @@ int storage_layer_try_repair_lowers(const char *id, const char *last_layer_id)
return
ret
;
return
ret
;
}
}
int
storage_layer_set_names
(
const
char
*
layer_id
,
const
char
**
names
,
size_t
names_len
)
{
int
ret
=
0
;
char
**
unique_names
=
NULL
;
size_t
unique_names_len
=
0
;
if
(
layer_id
==
NULL
||
names
==
NULL
||
names_len
==
0
)
{
ERROR
(
"Invalid arguments"
);
ret
=
-
1
;
goto
out
;
}
if
(
util_string_array_unique
(
names
,
names_len
,
&
unique_names
,
&
unique_names_len
)
!=
0
)
{
ERROR
(
"Failed to unique names"
);
ret
=
-
1
;
goto
out
;
}
if
(
layer_store_set_names
(
layer_id
,
(
const
char
**
)
unique_names
,
unique_names_len
)
!=
0
)
{
ERROR
(
"Failed to set layer %s names"
,
layer_id
);
ret
=
-
1
;
goto
out
;
}
out:
return
ret
;
}
int
storage_img_create
(
const
char
*
id
,
const
char
*
parent_id
,
const
char
*
metadata
,
int
storage_img_create
(
const
char
*
id
,
const
char
*
parent_id
,
const
char
*
metadata
,
struct
storage_img_create_options
*
opts
)
struct
storage_img_create_options
*
opts
)
{
{
...
...
src/image/oci/storage/storage.h
浏览文件 @
91f6a548
...
@@ -85,9 +85,11 @@ int storage_img_set_names(const char *img_id, const char **names, size_t names_l
...
@@ -85,9 +85,11 @@ int storage_img_set_names(const char *img_id, const char **names, size_t names_l
/* layer operations */
/* layer operations */
int
storage_layer_create
(
const
char
*
layer_id
,
const
char
*
parent_id
,
bool
writeable
,
const
char
*
layer_data_path
);
int
storage_layer_create
(
const
char
*
layer_id
,
const
char
*
parent_id
,
bool
writeable
,
const
char
*
layer_data_path
);
struct
layer
*
storage_layer_get
(
const
char
*
id
);
struct
layer
*
storage_layer_get
(
const
char
*
layer_
id
);
int
storage_layer_try_repair_lowers
(
const
char
*
id
,
const
char
*
last_layer_id
);
int
storage_layer_try_repair_lowers
(
const
char
*
layer_id
,
const
char
*
last_layer_id
);
int
storage_layer_set_names
(
const
char
*
layer_id
,
const
char
**
names
,
size_t
names_len
);
void
free_layer
(
struct
layer
*
l
);
void
free_layer
(
struct
layer
*
l
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录