Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
9dd6358a
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看板
提交
9dd6358a
编写于
12月 17, 2013
作者:
K
Kent Overstreet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bcache: Fix auxiliary search trees for key size > cacheline size
Signed-off-by:
N
Kent Overstreet
<
kmo@daterainc.com
>
上级
3b3e9e50
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
14 addition
and
14 deletion
+14
-14
drivers/md/bcache/bset.c
drivers/md/bcache/bset.c
+14
-14
未找到文件。
drivers/md/bcache/bset.c
浏览文件 @
9dd6358a
...
...
@@ -511,9 +511,11 @@ static unsigned bkey_to_cacheline(struct bset_tree *t, struct bkey *k)
return
((
void
*
)
k
-
(
void
*
)
t
->
data
)
/
BSET_CACHELINE
;
}
static
unsigned
bkey_to_cacheline_offset
(
struct
bkey
*
k
)
static
unsigned
bkey_to_cacheline_offset
(
struct
bset_tree
*
t
,
unsigned
cacheline
,
struct
bkey
*
k
)
{
return
(
(
size_t
)
k
&
(
BSET_CACHELINE
-
1
))
/
sizeof
(
uint64_t
);
return
(
u64
*
)
k
-
(
u64
*
)
cacheline_to_bkey
(
t
,
cacheline
,
0
);
}
static
struct
bkey
*
tree_to_bkey
(
struct
bset_tree
*
t
,
unsigned
j
)
...
...
@@ -608,7 +610,7 @@ static void bch_bset_build_unwritten_tree(struct btree_keys *b)
bset_alloc_tree
(
b
,
t
);
if
(
t
->
tree
!=
b
->
set
->
tree
+
btree_keys_cachelines
(
b
))
{
t
->
prev
[
0
]
=
bkey_to_cacheline_offset
(
t
->
data
->
start
);
t
->
prev
[
0
]
=
bkey_to_cacheline_offset
(
t
,
0
,
t
->
data
->
start
);
t
->
size
=
1
;
}
}
...
...
@@ -632,7 +634,7 @@ EXPORT_SYMBOL(bch_bset_init_next);
void
bch_bset_build_written_tree
(
struct
btree_keys
*
b
)
{
struct
bset_tree
*
t
=
bset_tree_last
(
b
);
struct
bkey
*
k
=
t
->
data
->
start
;
struct
bkey
*
prev
=
NULL
,
*
k
=
t
->
data
->
start
;
unsigned
j
,
cacheline
=
1
;
b
->
last_set_unwritten
=
0
;
...
...
@@ -654,13 +656,11 @@ void bch_bset_build_written_tree(struct btree_keys *b)
for
(
j
=
inorder_next
(
0
,
t
->
size
);
j
;
j
=
inorder_next
(
j
,
t
->
size
))
{
while
(
bkey_to_cacheline
(
t
,
k
)
!=
cacheline
)
k
=
bkey_next
(
k
);
while
(
bkey_to_cacheline
(
t
,
k
)
<
cacheline
)
prev
=
k
,
k
=
bkey_next
(
k
);
t
->
prev
[
j
]
=
bkey_u64s
(
k
);
k
=
bkey_next
(
k
);
cacheline
++
;
t
->
tree
[
j
].
m
=
bkey_to_cacheline_offset
(
k
);
t
->
prev
[
j
]
=
bkey_u64s
(
prev
);
t
->
tree
[
j
].
m
=
bkey_to_cacheline_offset
(
t
,
cacheline
++
,
k
);
}
while
(
bkey_next
(
k
)
!=
bset_bkey_last
(
t
->
data
))
...
...
@@ -739,8 +739,8 @@ static void bch_bset_fix_lookup_table(struct btree_keys *b,
* lookup table for the first key that is strictly greater than k:
* it's either k's cacheline or the next one
*/
if
(
j
<
t
->
size
&&
table_to_bkey
(
t
,
j
)
<=
k
)
while
(
j
<
t
->
size
&&
table_to_bkey
(
t
,
j
)
<=
k
)
j
++
;
/* Adjust all the lookup table entries, and find a new key for any that
...
...
@@ -755,7 +755,7 @@ static void bch_bset_fix_lookup_table(struct btree_keys *b,
while
(
k
<
cacheline_to_bkey
(
t
,
j
,
0
))
k
=
bkey_next
(
k
);
t
->
prev
[
j
]
=
bkey_to_cacheline_offset
(
k
);
t
->
prev
[
j
]
=
bkey_to_cacheline_offset
(
t
,
j
,
k
);
}
}
...
...
@@ -768,7 +768,7 @@ static void bch_bset_fix_lookup_table(struct btree_keys *b,
k
!=
bset_bkey_last
(
t
->
data
);
k
=
bkey_next
(
k
))
if
(
t
->
size
==
bkey_to_cacheline
(
t
,
k
))
{
t
->
prev
[
t
->
size
]
=
bkey_to_cacheline_offset
(
k
);
t
->
prev
[
t
->
size
]
=
bkey_to_cacheline_offset
(
t
,
t
->
size
,
k
);
t
->
size
++
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录