Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
213d9417
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
213d9417
编写于
16年前
作者:
J
Jens Axboe
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
block: seperate bio/request unplug and sync bits
Signed-off-by:
N
Jens Axboe
<
jens.axboe@oracle.com
>
上级
1308835f
无相关合并请求
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
8 deletion
+17
-8
block/blk-core.c
block/blk-core.c
+4
-1
include/linux/bio.h
include/linux/bio.h
+11
-7
include/linux/blkdev.h
include/linux/blkdev.h
+2
-0
未找到文件。
block/blk-core.c
浏览文件 @
213d9417
...
...
@@ -1125,6 +1125,8 @@ void init_request_from_bio(struct request *req, struct bio *bio)
if
(
bio_sync
(
bio
))
req
->
cmd_flags
|=
REQ_RW_SYNC
;
if
(
bio_unplug
(
bio
))
req
->
cmd_flags
|=
REQ_UNPLUG
;
if
(
bio_rw_meta
(
bio
))
req
->
cmd_flags
|=
REQ_RW_META
;
...
...
@@ -1141,6 +1143,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
int
el_ret
,
nr_sectors
;
const
unsigned
short
prio
=
bio_prio
(
bio
);
const
int
sync
=
bio_sync
(
bio
);
const
int
unplug
=
bio_unplug
(
bio
);
int
rw_flags
;
nr_sectors
=
bio_sectors
(
bio
);
...
...
@@ -1244,7 +1247,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
blk_plug_device
(
q
);
add_request
(
q
,
req
);
out:
if
(
sync
||
blk_queue_nonrot
(
q
))
if
(
unplug
||
blk_queue_nonrot
(
q
))
__generic_unplug_device
(
q
);
spin_unlock_irq
(
q
->
queue_lock
);
return
0
;
...
...
This diff is collapsed.
Click to expand it.
include/linux/bio.h
浏览文件 @
213d9417
...
...
@@ -163,12 +163,15 @@ struct bio {
#define BIO_RW 0
/* Must match RW in req flags (blkdev.h) */
#define BIO_RW_AHEAD 1
/* Must match FAILFAST in req flags */
#define BIO_RW_BARRIER 2
#define BIO_RW_SYNC 3
#define BIO_RW_META 4
#define BIO_RW_DISCARD 5
#define BIO_RW_FAILFAST_DEV 6
#define BIO_RW_FAILFAST_TRANSPORT 7
#define BIO_RW_FAILFAST_DRIVER 8
#define BIO_RW_SYNCIO 3
#define BIO_RW_UNPLUG 4
#define BIO_RW_META 5
#define BIO_RW_DISCARD 6
#define BIO_RW_FAILFAST_DEV 7
#define BIO_RW_FAILFAST_TRANSPORT 8
#define BIO_RW_FAILFAST_DRIVER 9
#define BIO_RW_SYNC (BIO_RW_SYNCIO | BIO_RW_UNPLUG)
/*
* upper 16 bits of bi_rw define the io priority of this bio
...
...
@@ -194,7 +197,8 @@ struct bio {
#define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx)
#define bio_sectors(bio) ((bio)->bi_size >> 9)
#define bio_barrier(bio) ((bio)->bi_rw & (1 << BIO_RW_BARRIER))
#define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC))
#define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNCIO))
#define bio_unplug(bio) ((bio)->bi_rw & (1 << BIO_RW_UNPLUG))
#define bio_failfast_dev(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST_DEV))
#define bio_failfast_transport(bio) \
((bio)->bi_rw & (1 << BIO_RW_FAILFAST_TRANSPORT))
...
...
This diff is collapsed.
Click to expand it.
include/linux/blkdev.h
浏览文件 @
213d9417
...
...
@@ -108,6 +108,7 @@ enum rq_flag_bits {
__REQ_RW_META
,
/* metadata io request */
__REQ_COPY_USER
,
/* contains copies of user pages */
__REQ_INTEGRITY
,
/* integrity metadata has been remapped */
__REQ_UNPLUG
,
/* unplug queue on submission */
__REQ_NR_BITS
,
/* stops here */
};
...
...
@@ -134,6 +135,7 @@ enum rq_flag_bits {
#define REQ_RW_META (1 << __REQ_RW_META)
#define REQ_COPY_USER (1 << __REQ_COPY_USER)
#define REQ_INTEGRITY (1 << __REQ_INTEGRITY)
#define REQ_UNPLUG (1 << __REQ_UNPLUG)
#define BLK_MAX_CDB 16
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
反馈
建议
客服
返回
顶部