Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
iSulad
提交
5182e721
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,发现更多精彩内容 >>
提交
5182e721
编写于
7月 01, 2020
作者:
G
gaohuatao
提交者:
lifeng68
7月 25, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
devmapper: delete function not used
Signed-off-by:
N
gaohuatao
<
gaohuatao@huawei.com
>
上级
bb62a8f5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
131 deletion
+8
-131
src/daemon/modules/image/oci/storage/layer_store/graphdriver/devmapper/deviceset.c
...oci/storage/layer_store/graphdriver/devmapper/deviceset.c
+5
-6
src/daemon/modules/image/oci/storage/layer_store/graphdriver/devmapper/wrapper_devmapper.c
...age/layer_store/graphdriver/devmapper/wrapper_devmapper.c
+3
-119
src/daemon/modules/image/oci/storage/layer_store/graphdriver/devmapper/wrapper_devmapper.h
...age/layer_store/graphdriver/devmapper/wrapper_devmapper.h
+0
-6
未找到文件。
src/daemon/modules/image/oci/storage/layer_store/graphdriver/devmapper/deviceset.c
浏览文件 @
5182e721
...
...
@@ -135,17 +135,12 @@ out:
static
int
enable_deferred_removal_deletion
(
struct
device_set
*
devset
)
{
if
(
devset
->
enable_deferred_removal
)
{
if
(
!
devset
->
driver_deferred_removal_support
)
{
ERROR
(
"devmapper: Deferred removal can not be enabled as kernel does not support it"
);
return
-
1
;
}
devset
->
deferred_remove
=
true
;
}
if
(
devset
->
enable_deferred_deletion
)
{
if
(
!
devset
->
deferred_remove
)
{
ERROR
(
"devmapper: Deferred deletion can not be enabled as deferred removal is not enabled. \
Enable deferred removal using --storage-opt dm.use_deferred_removal=true parameter"
);
ERROR
(
"devmapper: Deferred deletion can not be enabled as deferred removal is not enabled."
);
return
-
1
;
}
devset
->
deferred_delete
=
true
;
...
...
@@ -2623,6 +2618,10 @@ static int devmapper_init_devset(const char *driver_home, const char **options,
driver
->
devset
=
devset
;
devset
->
root
=
util_strdup_s
(
driver_home
);
devset
->
user_base_size
=
false
;
devset
->
driver_deferred_removal_support
=
false
;
devset
->
enable_deferred_removal
=
false
;
devset
->
enable_deferred_deletion
=
false
;
devset
->
base_fs_size
=
default_base_fs_size
;
devset
->
override_udev_sync_check
=
DEFAULT_UDEV_SYNC_OVERRIDE
;
devset
->
do_blk_discard
=
false
;
...
...
src/daemon/modules/image/oci/storage/layer_store/graphdriver/devmapper/wrapper_devmapper.c
浏览文件 @
5182e721
...
...
@@ -72,21 +72,6 @@ struct dm_task *task_create(int type)
return
dmt
;
}
int
set_name
(
struct
dm_task
*
dmt
,
const
char
*
name
)
{
int
ret
=
0
;
if
(
dmt
==
NULL
||
name
==
NULL
)
{
return
-
1
;
}
if
(
dm_task_set_name
(
dmt
,
name
)
!=
1
)
{
ret
=
-
1
;
}
return
ret
;
}
int
set_message
(
struct
dm_task
*
dmt
,
const
char
*
message
)
{
if
(
dmt
==
NULL
||
message
==
NULL
)
{
...
...
@@ -133,21 +118,6 @@ out:
return
ret
;
}
int
set_ro
(
struct
dm_task
*
dmt
)
{
int
ret
=
0
;
if
(
dmt
==
NULL
)
{
return
-
1
;
}
if
(
dm_task_set_ro
(
dmt
)
!=
1
)
{
ret
=
-
1
;
}
return
ret
;
}
static
int
add_target
(
struct
dm_task
*
dmt
,
uint64_t
start
,
uint64_t
size
,
const
char
*
ttype
,
const
char
*
params
)
{
if
(
dmt
==
NULL
||
ttype
==
NULL
||
params
==
NULL
)
{
...
...
@@ -211,61 +181,6 @@ cleanup:
return
NULL
;
}
// GetTable is the programmatic example for "dmsetup table".
// It outputs the current table for the specified device name.
int
dev_get_table
(
uint64_t
*
start
,
uint64_t
*
length
,
char
**
target_type
,
char
**
params
,
const
char
*
name
)
{
int
ret
=
0
;
struct
dm_task
*
dmt
=
NULL
;
struct
dm_info
info
;
uint64_t
dm_length
=
0
;
uint64_t
dm_start
=
0
;
char
*
dm_target_type
=
NULL
;
char
*
dm_params
=
NULL
;
if
(
start
==
NULL
||
length
==
NULL
||
target_type
==
NULL
||
params
==
NULL
||
name
==
NULL
)
{
ERROR
(
"devicemapper: invalid input params to get table"
);
return
-
1
;
}
dmt
=
task_create_named
(
DM_DEVICE_TABLE
,
name
);
if
(
dmt
==
NULL
)
{
ret
=
-
1
;
ERROR
(
"devicemapper:create named task failed"
);
goto
cleanup
;
}
if
(
dm_task_run
(
dmt
)
!=
1
)
{
ret
=
-
1
;
ERROR
(
"devicemapper: task run failed"
);
goto
cleanup
;
}
if
(
dm_task_get_info
(
dmt
,
&
info
)
!=
1
)
{
ret
=
-
1
;
ERROR
(
"devicemapper: get info err"
);
goto
cleanup
;
}
if
(
info
.
exists
==
0
)
{
ERROR
(
"devicemapper: GetTable() Non existing device %s"
,
name
);
ret
=
-
1
;
goto
cleanup
;
}
(
void
)
dm_get_next_target
(
dmt
,
NULL
,
&
dm_start
,
&
dm_length
,
&
dm_target_type
,
&
dm_params
);
*
start
=
dm_start
;
*
length
=
dm_length
;
*
target_type
=
util_strdup_s
(
dm_target_type
);
*
params
=
util_strdup_s
(
dm_params
);
cleanup:
if
(
dmt
!=
NULL
)
{
dm_task_destroy
(
dmt
);
}
return
ret
;
}
char
*
dev_get_driver_version
()
{
struct
dm_task
*
dmt
=
NULL
;
...
...
@@ -359,39 +274,6 @@ cleanup:
return
ret
;
}
struct
dm_deps
*
dev_get_deps
(
const
char
*
name
)
{
struct
dm_task
*
dmt
=
NULL
;
struct
dm_deps
*
deps
=
NULL
;
if
(
name
==
NULL
)
{
return
NULL
;
}
dmt
=
task_create_named
(
DM_DEVICE_DEPS
,
name
);
if
(
dmt
==
NULL
)
{
ERROR
(
"devicemapper: create named task for get deps failed"
);
goto
cleanup
;
}
if
(
dm_task_run
(
dmt
)
!=
1
)
{
ERROR
(
"devicemapper: task run failed"
);
goto
cleanup
;
}
deps
=
dm_task_get_deps
(
dmt
);
if
(
deps
==
NULL
)
{
ERROR
(
"devicemapper: get deps for device:%s err"
,
name
);
goto
cleanup
;
}
cleanup:
if
(
dmt
!=
NULL
)
{
dm_task_destroy
(
dmt
);
}
return
deps
;
}
int
dev_get_info
(
struct
dm_info
*
info
,
const
char
*
name
)
{
int
ret
=
0
;
...
...
@@ -470,7 +352,7 @@ static void *udev_wait_process(void *data)
void
dev_udev_wait
(
uint32_t
cookie
)
{
pthread_t
tid
;
int
thread_result
;
int
thread_result
=
0
;
udev_wait_pth_t
*
uwait
=
NULL
;
float
timeout
=
0
;
struct
timeval
start
,
end
;
...
...
@@ -501,6 +383,7 @@ void dev_udev_wait(uint32_t cookie)
while
(
true
)
{
pthread_mutex_lock
(
&
uwait
->
udev_mutex
);
if
(
uwait
->
state
!=
DEV_INIT
)
{
pthread_mutex_unlock
(
&
uwait
->
udev_mutex
);
goto
free_out
;
}
pthread_mutex_unlock
(
&
uwait
->
udev_mutex
);
...
...
@@ -512,6 +395,7 @@ void dev_udev_wait(uint32_t cookie)
timeout
=
(
end
.
tv_sec
-
start
.
tv_sec
)
+
(
end
.
tv_usec
-
start
.
tv_usec
)
/
1000000
;
// seconds
if
(
timeout
>=
(
float
)
dm_udev_wait_timeout
)
{
if
(
dm_udev_complete
(
cookie
)
!=
1
)
{
ERROR
(
"Failed to complete udev cookie %u on udev wait timeout"
,
cookie
);
goto
free_out
;
}
INFO
(
"devmapper: udev wait join thread start..."
);
...
...
src/daemon/modules/image/oci/storage/layer_store/graphdriver/devmapper/wrapper_devmapper.h
浏览文件 @
5182e721
...
...
@@ -77,16 +77,12 @@ char *dev_strerror(int errnum);
struct
dm_task
*
task_create
(
int
type
);
int
set_name
(
struct
dm_task
*
dmt
,
const
char
*
name
);
int
set_message
(
struct
dm_task
*
dmt
,
const
char
*
message
);
int
set_sector
(
struct
dm_task
*
dmt
,
uint64_t
sector
);
int
set_add_node
(
struct
dm_task
*
dmt
,
dm_add_node_t
add_node
);
int
set_ro
(
struct
dm_task
*
dmt
);
void
set_udev_wait_timeout
(
int64_t
t
);
int
set_dev_dir
(
const
char
*
dir
);
...
...
@@ -95,8 +91,6 @@ struct dm_task* task_create_named(int type, const char *name);
void
log_with_errno_init
();
int
dev_get_table
(
uint64_t
*
start
,
uint64_t
*
length
,
char
**
target_type
,
char
**
params
,
const
char
*
name
);
char
*
dev_get_driver_version
();
int
dev_get_status
(
uint64_t
*
start
,
uint64_t
*
length
,
char
**
target_type
,
char
**
params
,
const
char
*
name
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录