Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
bf661be1
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bf661be1
编写于
5月 24, 2016
作者:
M
Mike Snitzer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
dm mpath: remove bio-based bloat from struct dm_mpath_io
Signed-off-by:
N
Mike Snitzer
<
snitzer@redhat.com
>
上级
76e33fe4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
31 addition
and
12 deletion
+31
-12
drivers/md/dm-mpath.c
drivers/md/dm-mpath.c
+31
-12
未找到文件。
drivers/md/dm-mpath.c
浏览文件 @
bf661be1
...
...
@@ -109,11 +109,6 @@ struct multipath {
struct
dm_mpath_io
{
struct
pgpath
*
pgpath
;
size_t
nr_bytes
;
/*
* FIXME: make request-based code _not_ include this member.
*/
struct
dm_bio_details
bio_details
;
};
typedef
int
(
*
action_fn
)
(
struct
pgpath
*
pgpath
);
...
...
@@ -294,19 +289,39 @@ static void clear_request_fn_mpio(struct multipath *m, union map_info *info)
}
}
static
size_t
multipath_per_bio_data_size
(
void
)
{
return
sizeof
(
struct
dm_mpath_io
)
+
sizeof
(
struct
dm_bio_details
);
}
static
struct
dm_mpath_io
*
get_mpio_from_bio
(
struct
bio
*
bio
)
{
return
dm_per_bio_data
(
bio
,
sizeof
(
struct
dm_mpath_io
));
return
dm_per_bio_data
(
bio
,
multipath_per_bio_data_size
(
));
}
static
struct
dm_
mpath_io
*
set_mpio_bio
(
struct
multipath
*
m
,
struct
bio
*
bio
)
static
struct
dm_
bio_details
*
get_bio_details_from_bio
(
struct
bio
*
bio
)
{
/* dm_bio_details is immediately after the dm_mpath_io in bio's per-bio-data */
struct
dm_mpath_io
*
mpio
=
get_mpio_from_bio
(
bio
);
void
*
bio_details
=
mpio
+
1
;
return
bio_details
;
}
static
void
multipath_init_per_bio_data
(
struct
bio
*
bio
,
struct
dm_mpath_io
**
mpio_p
,
struct
dm_bio_details
**
bio_details_p
)
{
struct
dm_mpath_io
*
mpio
=
get_mpio_from_bio
(
bio
);
struct
dm_bio_details
*
bio_details
=
get_bio_details_from_bio
(
bio
);
memset
(
mpio
,
0
,
sizeof
(
*
mpio
));
dm_bio_record
(
&
mpio
->
bio_details
,
bio
);
memset
(
bio_details
,
0
,
sizeof
(
*
bio_details
));
dm_bio_record
(
bio_details
,
bio
);
return
mpio
;
if
(
mpio_p
)
*
mpio_p
=
mpio
;
if
(
bio_details_p
)
*
bio_details_p
=
bio_details
;
}
/*-----------------------------------------------
...
...
@@ -629,7 +644,9 @@ static int __multipath_map_bio(struct multipath *m, struct bio *bio, struct dm_m
static
int
multipath_map_bio
(
struct
dm_target
*
ti
,
struct
bio
*
bio
)
{
struct
multipath
*
m
=
ti
->
private
;
struct
dm_mpath_io
*
mpio
=
set_mpio_bio
(
m
,
bio
);
struct
dm_mpath_io
*
mpio
=
NULL
;
multipath_init_per_bio_data
(
bio
,
&
mpio
,
NULL
);
return
__multipath_map_bio
(
m
,
bio
,
mpio
);
}
...
...
@@ -1113,7 +1130,9 @@ static int __multipath_ctr(struct dm_target *ti, unsigned int argc,
ti
->
num_flush_bios
=
1
;
ti
->
num_discard_bios
=
1
;
ti
->
num_write_same_bios
=
1
;
if
(
use_blk_mq
||
bio_based
)
if
(
bio_based
)
ti
->
per_io_data_size
=
multipath_per_bio_data_size
();
else
if
(
use_blk_mq
)
ti
->
per_io_data_size
=
sizeof
(
struct
dm_mpath_io
);
return
0
;
...
...
@@ -1576,7 +1595,7 @@ static int do_end_io_bio(struct multipath *m, struct bio *clone,
}
/* Queue for the daemon to resubmit */
dm_bio_restore
(
&
mpio
->
bio_details
,
clone
);
dm_bio_restore
(
get_bio_details_from_bio
(
clone
)
,
clone
);
spin_lock_irqsave
(
&
m
->
lock
,
flags
);
bio_list_add
(
&
m
->
queued_bios
,
clone
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录