Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
09e71a32
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看板
提交
09e71a32
编写于
10月 15, 2007
作者:
C
Chris Mason
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Btrfs: Use an array of pages in the extent buffers to reduce the cost of find_get_page
Signed-off-by:
N
Chris Mason
<
chris.mason@oracle.com
>
上级
14048ed0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
19 deletion
+13
-19
fs/btrfs/disk-io.c
fs/btrfs/disk-io.c
+3
-3
fs/btrfs/extent_map.c
fs/btrfs/extent_map.c
+8
-14
fs/btrfs/extent_map.h
fs/btrfs/extent_map.h
+2
-2
未找到文件。
fs/btrfs/disk-io.c
浏览文件 @
09e71a32
...
...
@@ -647,20 +647,20 @@ int close_ctree(struct btrfs_root *root)
int
btrfs_buffer_uptodate
(
struct
extent_buffer
*
buf
)
{
struct
inode
*
btree_inode
=
buf
->
first_page
->
mapping
->
host
;
struct
inode
*
btree_inode
=
buf
->
pages
[
0
]
->
mapping
->
host
;
return
extent_buffer_uptodate
(
&
BTRFS_I
(
btree_inode
)
->
extent_tree
,
buf
);
}
int
btrfs_set_buffer_uptodate
(
struct
extent_buffer
*
buf
)
{
struct
inode
*
btree_inode
=
buf
->
first_page
->
mapping
->
host
;
struct
inode
*
btree_inode
=
buf
->
pages
[
0
]
->
mapping
->
host
;
return
set_extent_buffer_uptodate
(
&
BTRFS_I
(
btree_inode
)
->
extent_tree
,
buf
);
}
void
btrfs_mark_buffer_dirty
(
struct
extent_buffer
*
buf
)
{
struct
btrfs_root
*
root
=
BTRFS_I
(
buf
->
first_page
->
mapping
->
host
)
->
root
;
struct
btrfs_root
*
root
=
BTRFS_I
(
buf
->
pages
[
0
]
->
mapping
->
host
)
->
root
;
u64
transid
=
btrfs_header_generation
(
buf
);
struct
inode
*
btree_inode
=
root
->
fs_info
->
btree_inode
;
...
...
fs/btrfs/extent_map.c
浏览文件 @
09e71a32
...
...
@@ -1961,16 +1961,12 @@ static void __free_extent_buffer(struct extent_buffer *eb)
static
inline
struct
page
*
extent_buffer_page
(
struct
extent_buffer
*
eb
,
int
i
)
{
struct
page
*
p
;
if
(
i
==
0
)
return
eb
->
first_page
;
if
(
i
<
EXTENT_INLINE_PAGES
)
return
eb
->
pages
[
i
];
i
+=
eb
->
start
>>
PAGE_CACHE_SHIFT
;
if
(
eb
->
last_page
&&
eb
->
last_page
->
index
==
i
)
return
eb
->
last_page
;
p
=
find_get_page
(
eb
->
first_page
->
mapping
,
i
);
p
=
find_get_page
(
eb
->
pages
[
0
]
->
mapping
,
i
);
page_cache_release
(
p
);
eb
->
last_page
=
p
;
return
p
;
}
...
...
@@ -2012,8 +2008,8 @@ struct extent_buffer *alloc_extent_buffer(struct extent_map_tree *tree,
goto
fail
;
}
set_page_extent_mapped
(
p
);
if
(
i
==
0
)
eb
->
first_page
=
p
;
if
(
i
<
EXTENT_INLINE_PAGES
)
eb
->
pages
[
i
]
=
p
;
if
(
!
PageUptodate
(
p
))
uptodate
=
0
;
unlock_page
(
p
);
...
...
@@ -2059,8 +2055,8 @@ struct extent_buffer *find_extent_buffer(struct extent_map_tree *tree,
goto
fail
;
}
set_page_extent_mapped
(
p
);
if
(
i
==
0
)
eb
->
first_page
=
p
;
if
(
i
<
EXTENT_INLINE_PAGES
)
eb
->
pages
[
i
]
=
p
;
if
(
!
PageUptodate
(
p
))
uptodate
=
0
;
unlock_page
(
p
);
...
...
@@ -2087,9 +2083,7 @@ void free_extent_buffer(struct extent_buffer *eb)
num_pages
=
num_extent_pages
(
eb
->
start
,
eb
->
len
);
if
(
eb
->
first_page
)
page_cache_release
(
eb
->
first_page
);
for
(
i
=
1
;
i
<
num_pages
;
i
++
)
{
for
(
i
=
0
;
i
<
num_pages
;
i
++
)
{
page_cache_release
(
extent_buffer_page
(
eb
,
i
));
}
__free_extent_buffer
(
eb
);
...
...
fs/btrfs/extent_map.h
浏览文件 @
09e71a32
...
...
@@ -62,6 +62,7 @@ struct extent_state {
struct
list_head
list
;
};
#define EXTENT_INLINE_PAGES 32
struct
extent_buffer
{
u64
start
;
unsigned
long
len
;
...
...
@@ -69,13 +70,12 @@ struct extent_buffer {
int
flags
;
struct
list_head
list
;
struct
list_head
leak_list
;
struct
page
*
first_page
;
struct
page
*
last_page
;
unsigned
long
alloc_addr
;
char
*
map_token
;
char
*
kaddr
;
unsigned
long
map_start
;
unsigned
long
map_len
;
struct
page
*
pages
[
EXTENT_INLINE_PAGES
];
};
typedef
struct
extent_map
*
(
get_extent_t
)(
struct
inode
*
inode
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录