Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
11bd143f
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 3 年多
通知
13
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
11bd143f
编写于
6月 22, 2007
作者:
C
Chris Mason
提交者:
David Woodhouse
6月 22, 2007
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Btrfs: Switch to libcrc32c to avoid problems with cryptomgr on highmem machines
Signed-off-by:
N
Chris Mason
<
chris.mason@oracle.com
>
上级
e011599b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
29 deletion
+8
-29
fs/btrfs/ctree.h
fs/btrfs/ctree.h
+0
-4
fs/btrfs/disk-io.c
fs/btrfs/disk-io.c
+6
-24
fs/btrfs/file.c
fs/btrfs/file.c
+2
-1
未找到文件。
fs/btrfs/ctree.h
浏览文件 @
11bd143f
...
...
@@ -286,10 +286,7 @@ struct btrfs_block_group_cache {
int
cached
;
};
struct
crypto_hash
;
struct
btrfs_fs_info
{
spinlock_t
hash_lock
;
struct
btrfs_root
*
extent_root
;
struct
btrfs_root
*
tree_root
;
struct
radix_tree_root
fs_roots_radix
;
...
...
@@ -314,7 +311,6 @@ struct btrfs_fs_info {
struct
mutex
fs_mutex
;
struct
list_head
trans_list
;
struct
list_head
dead_roots
;
struct
crypto_hash
*
hash_tfm
;
struct
delayed_work
trans_work
;
int
do_barriers
;
int
closing
;
...
...
fs/btrfs/disk-io.c
浏览文件 @
11bd143f
...
...
@@ -19,7 +19,7 @@
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/blkdev.h>
#include <linux/cr
ypto
.h>
#include <linux/cr
c32c
.h>
#include <linux/scatterlist.h>
#include <linux/swap.h>
#include <linux/radix-tree.h>
...
...
@@ -147,22 +147,12 @@ static int btree_get_block(struct inode *inode, sector_t iblock,
int
btrfs_csum_data
(
struct
btrfs_root
*
root
,
char
*
data
,
size_t
len
,
char
*
result
)
{
struct
scatterlist
sg
;
struct
crypto_hash
*
tfm
=
root
->
fs_info
->
hash_tfm
;
struct
hash_desc
desc
;
int
ret
;
desc
.
tfm
=
tfm
;
desc
.
flags
=
0
;
sg_init_one
(
&
sg
,
data
,
len
);
spin_lock_irq
(
&
root
->
fs_info
->
hash_lock
);
ret
=
crypto_hash_digest
(
&
desc
,
&
sg
,
1
,
result
);
spin_unlock_irq
(
&
root
->
fs_info
->
hash_lock
);
if
(
ret
)
{
printk
(
"digest failed
\n
"
);
}
return
ret
;
u32
crc
;
crc
=
crc32c
(
0
,
data
,
len
);
memcpy
(
result
,
&
crc
,
BTRFS_CRC32_SIZE
);
return
0
;
}
static
int
csum_tree_block
(
struct
btrfs_root
*
root
,
struct
buffer_head
*
bh
,
int
verify
)
{
...
...
@@ -454,14 +444,7 @@ struct btrfs_root *open_ctree(struct super_block *sb)
sizeof
(
struct
btrfs_key
));
insert_inode_hash
(
fs_info
->
btree_inode
);
mapping_set_gfp_mask
(
fs_info
->
btree_inode
->
i_mapping
,
GFP_NOFS
);
fs_info
->
hash_tfm
=
crypto_alloc_hash
(
"crc32c"
,
0
,
CRYPTO_ALG_ASYNC
);
spin_lock_init
(
&
fs_info
->
hash_lock
);
if
(
!
fs_info
->
hash_tfm
||
IS_ERR
(
fs_info
->
hash_tfm
))
{
printk
(
"btrfs: failed hash setup, modprobe cryptomgr?
\n
"
);
err
=
-
ENOMEM
;
goto
fail_iput
;
}
mutex_init
(
&
fs_info
->
trans_mutex
);
mutex_init
(
&
fs_info
->
fs_mutex
);
...
...
@@ -613,7 +596,6 @@ int close_ctree(struct btrfs_root *root)
btrfs_block_release
(
fs_info
->
tree_root
,
fs_info
->
tree_root
->
node
);
btrfs_block_release
(
root
,
fs_info
->
sb_buffer
);
crypto_free_hash
(
fs_info
->
hash_tfm
);
truncate_inode_pages
(
fs_info
->
btree_inode
->
i_mapping
,
0
);
iput
(
fs_info
->
btree_inode
);
...
...
fs/btrfs/file.c
浏览文件 @
11bd143f
...
...
@@ -607,7 +607,8 @@ static ssize_t btrfs_file_write(struct file *file, const char __user *buf,
while
(
count
>
0
)
{
size_t
offset
=
pos
&
(
PAGE_CACHE_SIZE
-
1
);
size_t
write_bytes
=
min
(
count
,
nrptrs
*
PAGE_CACHE_SIZE
-
size_t
write_bytes
=
min
(
count
,
nrptrs
*
(
size_t
)
PAGE_CACHE_SIZE
-
offset
);
size_t
num_pages
=
(
write_bytes
+
PAGE_CACHE_SIZE
-
1
)
>>
PAGE_CACHE_SHIFT
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录