Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
01f46658
L
linux
项目概览
xiphi1978
/
linux
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
01f46658
编写于
12月 21, 2007
作者:
C
Chris Mason
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Btrfs: Less aggressive readahead on deletes
Signed-off-by:
N
Chris Mason
<
chris.mason@oracle.com
>
上级
879c1cfc
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
9 deletion
+11
-9
fs/btrfs/ctree.c
fs/btrfs/ctree.c
+11
-9
未找到文件。
fs/btrfs/ctree.c
浏览文件 @
01f46658
...
@@ -987,9 +987,10 @@ static int push_nodes_for_insert(struct btrfs_trans_handle *trans,
...
@@ -987,9 +987,10 @@ static int push_nodes_for_insert(struct btrfs_trans_handle *trans,
* readahead one full node of leaves
* readahead one full node of leaves
*/
*/
static
void
reada_for_search
(
struct
btrfs_root
*
root
,
struct
btrfs_path
*
path
,
static
void
reada_for_search
(
struct
btrfs_root
*
root
,
struct
btrfs_path
*
path
,
int
level
,
int
slot
)
int
level
,
int
slot
,
u64
objectid
)
{
{
struct
extent_buffer
*
node
;
struct
extent_buffer
*
node
;
struct
btrfs_disk_key
disk_key
;
u32
nritems
;
u32
nritems
;
u64
search
;
u64
search
;
u64
lowest_read
;
u64
lowest_read
;
...
@@ -1031,6 +1032,11 @@ static void reada_for_search(struct btrfs_root *root, struct btrfs_path *path,
...
@@ -1031,6 +1032,11 @@ static void reada_for_search(struct btrfs_root *root, struct btrfs_path *path,
if
(
nr
>=
nritems
)
if
(
nr
>=
nritems
)
break
;
break
;
}
}
if
(
path
->
reada
<
0
&&
objectid
)
{
btrfs_node_key
(
node
,
&
disk_key
,
nr
);
if
(
btrfs_disk_key_objectid
(
&
disk_key
)
!=
objectid
)
break
;
}
search
=
btrfs_node_blockptr
(
node
,
nr
);
search
=
btrfs_node_blockptr
(
node
,
nr
);
if
((
search
>=
lowest_read
&&
search
<=
highest_read
)
||
if
((
search
>=
lowest_read
&&
search
<=
highest_read
)
||
(
search
<
lowest_read
&&
lowest_read
-
search
<=
32768
)
||
(
search
<
lowest_read
&&
lowest_read
-
search
<=
32768
)
||
...
@@ -1136,7 +1142,8 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root
...
@@ -1136,7 +1142,8 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root
bytenr
=
btrfs_node_blockptr
(
b
,
slot
);
bytenr
=
btrfs_node_blockptr
(
b
,
slot
);
ptr_gen
=
btrfs_node_ptr_generation
(
b
,
slot
);
ptr_gen
=
btrfs_node_ptr_generation
(
b
,
slot
);
if
(
should_reada
)
if
(
should_reada
)
reada_for_search
(
root
,
p
,
level
,
slot
);
reada_for_search
(
root
,
p
,
level
,
slot
,
key
->
objectid
);
b
=
read_tree_block
(
root
,
bytenr
,
b
=
read_tree_block
(
root
,
bytenr
,
btrfs_level_size
(
root
,
level
-
1
));
btrfs_level_size
(
root
,
level
-
1
));
if
(
ptr_gen
!=
btrfs_header_generation
(
b
))
{
if
(
ptr_gen
!=
btrfs_header_generation
(
b
))
{
...
@@ -2671,9 +2678,6 @@ int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path)
...
@@ -2671,9 +2678,6 @@ int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path)
if
(
next
)
if
(
next
)
free_extent_buffer
(
next
);
free_extent_buffer
(
next
);
if
(
path
->
reada
<
0
)
reada_for_search
(
root
,
path
,
level
,
slot
);
next
=
read_tree_block
(
root
,
bytenr
,
next
=
read_tree_block
(
root
,
bytenr
,
btrfs_level_size
(
root
,
level
-
1
));
btrfs_level_size
(
root
,
level
-
1
));
break
;
break
;
...
@@ -2687,8 +2691,6 @@ int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path)
...
@@ -2687,8 +2691,6 @@ int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path)
path
->
slots
[
level
]
=
0
;
path
->
slots
[
level
]
=
0
;
if
(
!
level
)
if
(
!
level
)
break
;
break
;
if
(
path
->
reada
)
reada_for_search
(
root
,
path
,
level
,
0
);
next
=
read_tree_block
(
root
,
btrfs_node_blockptr
(
next
,
0
),
next
=
read_tree_block
(
root
,
btrfs_node_blockptr
(
next
,
0
),
btrfs_level_size
(
root
,
level
-
1
));
btrfs_level_size
(
root
,
level
-
1
));
}
}
...
@@ -2726,7 +2728,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
...
@@ -2726,7 +2728,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
free_extent_buffer
(
next
);
free_extent_buffer
(
next
);
if
(
path
->
reada
)
if
(
path
->
reada
)
reada_for_search
(
root
,
path
,
level
,
slot
);
reada_for_search
(
root
,
path
,
level
,
slot
,
0
);
next
=
read_tree_block
(
root
,
bytenr
,
next
=
read_tree_block
(
root
,
bytenr
,
btrfs_level_size
(
root
,
level
-
1
));
btrfs_level_size
(
root
,
level
-
1
));
...
@@ -2742,7 +2744,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
...
@@ -2742,7 +2744,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
if
(
!
level
)
if
(
!
level
)
break
;
break
;
if
(
path
->
reada
)
if
(
path
->
reada
)
reada_for_search
(
root
,
path
,
level
,
0
);
reada_for_search
(
root
,
path
,
level
,
0
,
0
);
next
=
read_tree_block
(
root
,
btrfs_node_blockptr
(
next
,
0
),
next
=
read_tree_block
(
root
,
btrfs_node_blockptr
(
next
,
0
),
btrfs_level_size
(
root
,
level
-
1
));
btrfs_level_size
(
root
,
level
-
1
));
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录