Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
f74cd637
cloud-kernel
项目概览
openanolis
/
cloud-kernel
接近 2 年 前同步成功
通知
169
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看板
提交
f74cd637
编写于
11月 24, 2014
作者:
J
Jens Axboe
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'for-3.19/core' into for-3.19/drivers
上级
c78b4713
394ffa50
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
52 addition
and
23 deletion
+52
-23
block/bio.c
block/bio.c
+28
-0
block/blk-mq.c
block/blk-mq.c
+10
-21
block/genhd.c
block/genhd.c
+9
-2
include/linux/bio.h
include/linux/bio.h
+5
-0
未找到文件。
block/bio.c
浏览文件 @
f74cd637
...
@@ -1739,6 +1739,34 @@ void bio_check_pages_dirty(struct bio *bio)
...
@@ -1739,6 +1739,34 @@ void bio_check_pages_dirty(struct bio *bio)
}
}
}
}
void
generic_start_io_acct
(
int
rw
,
unsigned
long
sectors
,
struct
hd_struct
*
part
)
{
int
cpu
=
part_stat_lock
();
part_round_stats
(
cpu
,
part
);
part_stat_inc
(
cpu
,
part
,
ios
[
rw
]);
part_stat_add
(
cpu
,
part
,
sectors
[
rw
],
sectors
);
part_inc_in_flight
(
part
,
rw
);
part_stat_unlock
();
}
EXPORT_SYMBOL
(
generic_start_io_acct
);
void
generic_end_io_acct
(
int
rw
,
struct
hd_struct
*
part
,
unsigned
long
start_time
)
{
unsigned
long
duration
=
jiffies
-
start_time
;
int
cpu
=
part_stat_lock
();
part_stat_add
(
cpu
,
part
,
ticks
[
rw
],
duration
);
part_round_stats
(
cpu
,
part
);
part_dec_in_flight
(
part
,
rw
);
part_stat_unlock
();
}
EXPORT_SYMBOL
(
generic_end_io_acct
);
#if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
#if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
void
bio_flush_dcache_pages
(
struct
bio
*
bi
)
void
bio_flush_dcache_pages
(
struct
bio
*
bi
)
{
{
...
...
block/blk-mq.c
浏览文件 @
f74cd637
...
@@ -798,10 +798,11 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx)
...
@@ -798,10 +798,11 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx)
*/
*/
static
int
blk_mq_hctx_next_cpu
(
struct
blk_mq_hw_ctx
*
hctx
)
static
int
blk_mq_hctx_next_cpu
(
struct
blk_mq_hw_ctx
*
hctx
)
{
{
int
cpu
=
hctx
->
next_cpu
;
if
(
hctx
->
queue
->
nr_hw_queues
==
1
)
return
WORK_CPU_UNBOUND
;
if
(
--
hctx
->
next_cpu_batch
<=
0
)
{
if
(
--
hctx
->
next_cpu_batch
<=
0
)
{
int
next_cpu
;
int
cpu
=
hctx
->
next_cpu
,
next_cpu
;
next_cpu
=
cpumask_next
(
hctx
->
next_cpu
,
hctx
->
cpumask
);
next_cpu
=
cpumask_next
(
hctx
->
next_cpu
,
hctx
->
cpumask
);
if
(
next_cpu
>=
nr_cpu_ids
)
if
(
next_cpu
>=
nr_cpu_ids
)
...
@@ -809,9 +810,11 @@ static int blk_mq_hctx_next_cpu(struct blk_mq_hw_ctx *hctx)
...
@@ -809,9 +810,11 @@ static int blk_mq_hctx_next_cpu(struct blk_mq_hw_ctx *hctx)
hctx
->
next_cpu
=
next_cpu
;
hctx
->
next_cpu
=
next_cpu
;
hctx
->
next_cpu_batch
=
BLK_MQ_CPU_WORK_BATCH
;
hctx
->
next_cpu_batch
=
BLK_MQ_CPU_WORK_BATCH
;
return
cpu
;
}
}
return
cpu
;
return
hctx
->
next_
cpu
;
}
}
void
blk_mq_run_hw_queue
(
struct
blk_mq_hw_ctx
*
hctx
,
bool
async
)
void
blk_mq_run_hw_queue
(
struct
blk_mq_hw_ctx
*
hctx
,
bool
async
)
...
@@ -830,14 +833,8 @@ void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async)
...
@@ -830,14 +833,8 @@ void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async)
put_cpu
();
put_cpu
();
}
}
if
(
hctx
->
queue
->
nr_hw_queues
==
1
)
kblockd_schedule_delayed_work_on
(
blk_mq_hctx_next_cpu
(
hctx
),
kblockd_schedule_delayed_work
(
&
hctx
->
run_work
,
0
);
&
hctx
->
run_work
,
0
);
else
{
unsigned
int
cpu
;
cpu
=
blk_mq_hctx_next_cpu
(
hctx
);
kblockd_schedule_delayed_work_on
(
cpu
,
&
hctx
->
run_work
,
0
);
}
}
}
void
blk_mq_run_queues
(
struct
request_queue
*
q
,
bool
async
)
void
blk_mq_run_queues
(
struct
request_queue
*
q
,
bool
async
)
...
@@ -929,16 +926,8 @@ static void blk_mq_delay_work_fn(struct work_struct *work)
...
@@ -929,16 +926,8 @@ static void blk_mq_delay_work_fn(struct work_struct *work)
void
blk_mq_delay_queue
(
struct
blk_mq_hw_ctx
*
hctx
,
unsigned
long
msecs
)
void
blk_mq_delay_queue
(
struct
blk_mq_hw_ctx
*
hctx
,
unsigned
long
msecs
)
{
{
unsigned
long
tmo
=
msecs_to_jiffies
(
msecs
);
kblockd_schedule_delayed_work_on
(
blk_mq_hctx_next_cpu
(
hctx
),
&
hctx
->
delay_work
,
msecs_to_jiffies
(
msecs
));
if
(
hctx
->
queue
->
nr_hw_queues
==
1
)
kblockd_schedule_delayed_work
(
&
hctx
->
delay_work
,
tmo
);
else
{
unsigned
int
cpu
;
cpu
=
blk_mq_hctx_next_cpu
(
hctx
);
kblockd_schedule_delayed_work_on
(
cpu
,
&
hctx
->
delay_work
,
tmo
);
}
}
}
EXPORT_SYMBOL
(
blk_mq_delay_queue
);
EXPORT_SYMBOL
(
blk_mq_delay_queue
);
...
...
block/genhd.c
浏览文件 @
f74cd637
...
@@ -1070,9 +1070,16 @@ int disk_expand_part_tbl(struct gendisk *disk, int partno)
...
@@ -1070,9 +1070,16 @@ int disk_expand_part_tbl(struct gendisk *disk, int partno)
struct
disk_part_tbl
*
old_ptbl
=
disk
->
part_tbl
;
struct
disk_part_tbl
*
old_ptbl
=
disk
->
part_tbl
;
struct
disk_part_tbl
*
new_ptbl
;
struct
disk_part_tbl
*
new_ptbl
;
int
len
=
old_ptbl
?
old_ptbl
->
len
:
0
;
int
len
=
old_ptbl
?
old_ptbl
->
len
:
0
;
int
target
=
partno
+
1
;
int
i
,
target
;
size_t
size
;
size_t
size
;
int
i
;
/*
* check for int overflow, since we can get here from blkpg_ioctl()
* with a user passed 'partno'.
*/
target
=
partno
+
1
;
if
(
target
<
0
)
return
-
EINVAL
;
/* disk_max_parts() is zero during initialization, ignore if so */
/* disk_max_parts() is zero during initialization, ignore if so */
if
(
disk_max_parts
(
disk
)
&&
target
>
disk_max_parts
(
disk
))
if
(
disk_max_parts
(
disk
)
&&
target
>
disk_max_parts
(
disk
))
...
...
include/linux/bio.h
浏览文件 @
f74cd637
...
@@ -443,6 +443,11 @@ extern struct bio *bio_copy_kern(struct request_queue *, void *, unsigned int,
...
@@ -443,6 +443,11 @@ extern struct bio *bio_copy_kern(struct request_queue *, void *, unsigned int,
extern
void
bio_set_pages_dirty
(
struct
bio
*
bio
);
extern
void
bio_set_pages_dirty
(
struct
bio
*
bio
);
extern
void
bio_check_pages_dirty
(
struct
bio
*
bio
);
extern
void
bio_check_pages_dirty
(
struct
bio
*
bio
);
void
generic_start_io_acct
(
int
rw
,
unsigned
long
sectors
,
struct
hd_struct
*
part
);
void
generic_end_io_acct
(
int
rw
,
struct
hd_struct
*
part
,
unsigned
long
start_time
);
#ifndef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
#ifndef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
# error "You should define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE for your platform"
# error "You should define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE for your platform"
#endif
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录