Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
3de9d6b6
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看板
提交
3de9d6b6
编写于
8月 04, 2008
作者:
C
Chris Mason
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
btrfs_lookup_bio_sums seems broken, go back to the readpage_io_hook for now
Signed-off-by:
N
Chris Mason
<
chris.mason@oracle.com
>
上级
ea8c2819
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
56 addition
and
7 deletion
+56
-7
fs/btrfs/file-item.c
fs/btrfs/file-item.c
+3
-1
fs/btrfs/inode.c
fs/btrfs/inode.c
+53
-6
未找到文件。
fs/btrfs/file-item.c
浏览文件 @
3de9d6b6
...
...
@@ -134,6 +134,7 @@ int btrfs_lookup_file_extent(struct btrfs_trans_handle *trans,
return
ret
;
}
#if 0 /* broken */
int btrfs_lookup_bio_sums(struct btrfs_root *root, struct inode *inode,
struct bio *bio)
{
...
...
@@ -200,7 +201,7 @@ int btrfs_lookup_bio_sums(struct btrfs_root *root, struct inode *inode,
diff = diff * BTRFS_CRC32_SIZE;
read_extent_buffer(path->nodes[0], &sum,
(
unsigned
long
)
item
+
diff
,
(
(unsigned long)item)
+ diff,
BTRFS_CRC32_SIZE);
found:
set_state_private(io_tree, offset, sum);
...
...
@@ -210,6 +211,7 @@ int btrfs_lookup_bio_sums(struct btrfs_root *root, struct inode *inode,
btrfs_free_path(path);
return 0;
}
#endif
int
btrfs_csum_one_bio
(
struct
btrfs_root
*
root
,
struct
inode
*
inode
,
struct
bio
*
bio
)
...
...
fs/btrfs/inode.c
浏览文件 @
3de9d6b6
...
...
@@ -382,12 +382,6 @@ int btrfs_submit_bio_hook(struct inode *inode, int rw, struct bio *bio,
BUG_ON
(
ret
);
if
(
!
(
rw
&
(
1
<<
BIO_RW
)))
{
if
(
!
btrfs_test_opt
(
root
,
NODATASUM
)
&&
!
btrfs_test_flag
(
inode
,
NODATASUM
))
{
mutex_lock
(
&
BTRFS_I
(
inode
)
->
csum_mutex
);
btrfs_lookup_bio_sums
(
root
,
inode
,
bio
);
mutex_unlock
(
&
BTRFS_I
(
inode
)
->
csum_mutex
);
}
goto
mapit
;
}
...
...
@@ -595,6 +589,58 @@ int btrfs_writepage_end_io_hook(struct page *page, u64 start, u64 end,
return
btrfs_finish_ordered_io
(
page
->
mapping
->
host
,
start
,
end
);
}
int
btrfs_readpage_io_hook
(
struct
page
*
page
,
u64
start
,
u64
end
)
{
int
ret
=
0
;
struct
inode
*
inode
=
page
->
mapping
->
host
;
struct
btrfs_root
*
root
=
BTRFS_I
(
inode
)
->
root
;
struct
extent_io_tree
*
io_tree
=
&
BTRFS_I
(
inode
)
->
io_tree
;
struct
btrfs_csum_item
*
item
;
struct
btrfs_path
*
path
=
NULL
;
u32
csum
;
if
(
btrfs_test_opt
(
root
,
NODATASUM
)
||
btrfs_test_flag
(
inode
,
NODATASUM
))
return
0
;
/*
* It is possible there is an ordered extent that has
* not yet finished for this range in the file. If so,
* that extent will have a csum cached, and it will insert
* the sum after all the blocks in the extent are fully
* on disk. So, look for an ordered extent and use the
* sum if found. We have to do this before looking in the
* btree because csum items are pre-inserted based on
* the file size. btrfs_lookup_csum might find an item
* that still hasn't been fully filled.
*/
ret
=
btrfs_find_ordered_sum
(
inode
,
start
,
&
csum
);
if
(
ret
==
0
)
goto
found
;
ret
=
0
;
path
=
btrfs_alloc_path
();
item
=
btrfs_lookup_csum
(
NULL
,
root
,
path
,
inode
->
i_ino
,
start
,
0
);
if
(
IS_ERR
(
item
))
{
ret
=
PTR_ERR
(
item
);
/* a csum that isn't present is a preallocated region. */
if
(
ret
==
-
ENOENT
||
ret
==
-
EFBIG
)
ret
=
0
;
csum
=
0
;
printk
(
"no csum found for inode %lu start %Lu
\n
"
,
inode
->
i_ino
,
start
);
goto
out
;
}
read_extent_buffer
(
path
->
nodes
[
0
],
&
csum
,
(
unsigned
long
)
item
,
BTRFS_CRC32_SIZE
);
found:
set_state_private
(
io_tree
,
start
,
csum
);
out:
if
(
path
)
btrfs_free_path
(
path
);
return
ret
;
}
struct
io_failure_record
{
struct
page
*
page
;
u64
start
;
...
...
@@ -3580,6 +3626,7 @@ static struct extent_io_ops btrfs_extent_io_ops = {
.
fill_delalloc
=
run_delalloc_range
,
.
submit_bio_hook
=
btrfs_submit_bio_hook
,
.
merge_bio_hook
=
btrfs_merge_bio_hook
,
.
readpage_io_hook
=
btrfs_readpage_io_hook
,
.
readpage_end_io_hook
=
btrfs_readpage_end_io_hook
,
.
writepage_end_io_hook
=
btrfs_writepage_end_io_hook
,
.
writepage_start_hook
=
btrfs_writepage_start_hook
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录