Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
f0dfc0b0
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
5
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f0dfc0b0
编写于
11月 25, 2011
作者:
C
Cong Wang
提交者:
Cong Wang
3月 20, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
crypto: remove the second argument of k[un]map_atomic()
Signed-off-by:
N
Cong Wang
<
amwang@redhat.com
>
上级
8fd75e12
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
23 addition
and
45 deletion
+23
-45
crypto/ahash.c
crypto/ahash.c
+2
-2
crypto/async_tx/async_memcpy.c
crypto/async_tx/async_memcpy.c
+4
-4
crypto/blkcipher.c
crypto/blkcipher.c
+4
-4
crypto/ccm.c
crypto/ccm.c
+2
-2
crypto/scatterwalk.c
crypto/scatterwalk.c
+4
-4
crypto/shash.c
crypto/shash.c
+4
-4
include/crypto/scatterwalk.h
include/crypto/scatterwalk.h
+3
-25
未找到文件。
crypto/ahash.c
浏览文件 @
f0dfc0b0
...
...
@@ -46,7 +46,7 @@ static int hash_walk_next(struct crypto_hash_walk *walk)
unsigned
int
nbytes
=
min
(
walk
->
entrylen
,
((
unsigned
int
)(
PAGE_SIZE
))
-
offset
);
walk
->
data
=
crypto_kmap
(
walk
->
pg
,
0
);
walk
->
data
=
kmap_atomic
(
walk
->
pg
);
walk
->
data
+=
offset
;
if
(
offset
&
alignmask
)
{
...
...
@@ -93,7 +93,7 @@ int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err)
return
nbytes
;
}
crypto_kunmap
(
walk
->
data
,
0
);
kunmap_atomic
(
walk
->
data
);
crypto_yield
(
walk
->
flags
);
if
(
err
)
...
...
crypto/async_tx/async_memcpy.c
浏览文件 @
f0dfc0b0
...
...
@@ -79,13 +79,13 @@ async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset,
/* wait for any prerequisite operations */
async_tx_quiesce
(
&
submit
->
depend_tx
);
dest_buf
=
kmap_atomic
(
dest
,
KM_USER0
)
+
dest_offset
;
src_buf
=
kmap_atomic
(
src
,
KM_USER1
)
+
src_offset
;
dest_buf
=
kmap_atomic
(
dest
)
+
dest_offset
;
src_buf
=
kmap_atomic
(
src
)
+
src_offset
;
memcpy
(
dest_buf
,
src_buf
,
len
);
kunmap_atomic
(
src_buf
,
KM_USER1
);
kunmap_atomic
(
dest_buf
,
KM_USER0
);
kunmap_atomic
(
src_buf
);
kunmap_atomic
(
dest_buf
);
async_tx_sync_epilog
(
submit
);
}
...
...
crypto/blkcipher.c
浏览文件 @
f0dfc0b0
...
...
@@ -43,22 +43,22 @@ static int blkcipher_walk_first(struct blkcipher_desc *desc,
static
inline
void
blkcipher_map_src
(
struct
blkcipher_walk
*
walk
)
{
walk
->
src
.
virt
.
addr
=
scatterwalk_map
(
&
walk
->
in
,
0
);
walk
->
src
.
virt
.
addr
=
scatterwalk_map
(
&
walk
->
in
);
}
static
inline
void
blkcipher_map_dst
(
struct
blkcipher_walk
*
walk
)
{
walk
->
dst
.
virt
.
addr
=
scatterwalk_map
(
&
walk
->
out
,
1
);
walk
->
dst
.
virt
.
addr
=
scatterwalk_map
(
&
walk
->
out
);
}
static
inline
void
blkcipher_unmap_src
(
struct
blkcipher_walk
*
walk
)
{
scatterwalk_unmap
(
walk
->
src
.
virt
.
addr
,
0
);
scatterwalk_unmap
(
walk
->
src
.
virt
.
addr
);
}
static
inline
void
blkcipher_unmap_dst
(
struct
blkcipher_walk
*
walk
)
{
scatterwalk_unmap
(
walk
->
dst
.
virt
.
addr
,
1
);
scatterwalk_unmap
(
walk
->
dst
.
virt
.
addr
);
}
/* Get a spot of the specified length that does not straddle a page.
...
...
crypto/ccm.c
浏览文件 @
f0dfc0b0
...
...
@@ -216,12 +216,12 @@ static void get_data_to_compute(struct crypto_cipher *tfm,
scatterwalk_start
(
&
walk
,
sg_next
(
walk
.
sg
));
n
=
scatterwalk_clamp
(
&
walk
,
len
);
}
data_src
=
scatterwalk_map
(
&
walk
,
0
);
data_src
=
scatterwalk_map
(
&
walk
);
compute_mac
(
tfm
,
data_src
,
n
,
pctx
);
len
-=
n
;
scatterwalk_unmap
(
data_src
,
0
);
scatterwalk_unmap
(
data_src
);
scatterwalk_advance
(
&
walk
,
n
);
scatterwalk_done
(
&
walk
,
0
,
len
);
if
(
len
)
...
...
crypto/scatterwalk.c
浏览文件 @
f0dfc0b0
...
...
@@ -40,9 +40,9 @@ void scatterwalk_start(struct scatter_walk *walk, struct scatterlist *sg)
}
EXPORT_SYMBOL_GPL
(
scatterwalk_start
);
void
*
scatterwalk_map
(
struct
scatter_walk
*
walk
,
int
out
)
void
*
scatterwalk_map
(
struct
scatter_walk
*
walk
)
{
return
crypto_kmap
(
scatterwalk_page
(
walk
),
out
)
+
return
kmap_atomic
(
scatterwalk_page
(
walk
)
)
+
offset_in_page
(
walk
->
offset
);
}
EXPORT_SYMBOL_GPL
(
scatterwalk_map
);
...
...
@@ -83,9 +83,9 @@ void scatterwalk_copychunks(void *buf, struct scatter_walk *walk,
if
(
len_this_page
>
nbytes
)
len_this_page
=
nbytes
;
vaddr
=
scatterwalk_map
(
walk
,
out
);
vaddr
=
scatterwalk_map
(
walk
);
memcpy_dir
(
buf
,
vaddr
,
len_this_page
,
out
);
scatterwalk_unmap
(
vaddr
,
out
);
scatterwalk_unmap
(
vaddr
);
scatterwalk_advance
(
walk
,
len_this_page
);
...
...
crypto/shash.c
浏览文件 @
f0dfc0b0
...
...
@@ -281,10 +281,10 @@ int shash_ahash_digest(struct ahash_request *req, struct shash_desc *desc)
if
(
nbytes
<
min
(
sg
->
length
,
((
unsigned
int
)(
PAGE_SIZE
))
-
offset
))
{
void
*
data
;
data
=
crypto_kmap
(
sg_page
(
sg
),
0
);
data
=
kmap_atomic
(
sg_page
(
sg
)
);
err
=
crypto_shash_digest
(
desc
,
data
+
offset
,
nbytes
,
req
->
result
);
crypto_kunmap
(
data
,
0
);
kunmap_atomic
(
data
);
crypto_yield
(
desc
->
flags
);
}
else
err
=
crypto_shash_init
(
desc
)
?:
...
...
@@ -420,9 +420,9 @@ static int shash_compat_digest(struct hash_desc *hdesc, struct scatterlist *sg,
desc
->
flags
=
hdesc
->
flags
;
data
=
crypto_kmap
(
sg_page
(
sg
),
0
);
data
=
kmap_atomic
(
sg_page
(
sg
)
);
err
=
crypto_shash_digest
(
desc
,
data
+
offset
,
nbytes
,
out
);
crypto_kunmap
(
data
,
0
);
kunmap_atomic
(
data
);
crypto_yield
(
desc
->
flags
);
goto
out
;
}
...
...
include/crypto/scatterwalk.h
浏览文件 @
f0dfc0b0
...
...
@@ -25,28 +25,6 @@
#include <linux/scatterlist.h>
#include <linux/sched.h>
static
inline
enum
km_type
crypto_kmap_type
(
int
out
)
{
enum
km_type
type
;
if
(
in_softirq
())
type
=
out
*
(
KM_SOFTIRQ1
-
KM_SOFTIRQ0
)
+
KM_SOFTIRQ0
;
else
type
=
out
*
(
KM_USER1
-
KM_USER0
)
+
KM_USER0
;
return
type
;
}
static
inline
void
*
crypto_kmap
(
struct
page
*
page
,
int
out
)
{
return
kmap_atomic
(
page
,
crypto_kmap_type
(
out
));
}
static
inline
void
crypto_kunmap
(
void
*
vaddr
,
int
out
)
{
kunmap_atomic
(
vaddr
,
crypto_kmap_type
(
out
));
}
static
inline
void
crypto_yield
(
u32
flags
)
{
if
(
flags
&
CRYPTO_TFM_REQ_MAY_SLEEP
)
...
...
@@ -121,15 +99,15 @@ static inline struct page *scatterwalk_page(struct scatter_walk *walk)
return
sg_page
(
walk
->
sg
)
+
(
walk
->
offset
>>
PAGE_SHIFT
);
}
static
inline
void
scatterwalk_unmap
(
void
*
vaddr
,
int
out
)
static
inline
void
scatterwalk_unmap
(
void
*
vaddr
)
{
crypto_kunmap
(
vaddr
,
out
);
kunmap_atomic
(
vaddr
);
}
void
scatterwalk_start
(
struct
scatter_walk
*
walk
,
struct
scatterlist
*
sg
);
void
scatterwalk_copychunks
(
void
*
buf
,
struct
scatter_walk
*
walk
,
size_t
nbytes
,
int
out
);
void
*
scatterwalk_map
(
struct
scatter_walk
*
walk
,
int
out
);
void
*
scatterwalk_map
(
struct
scatter_walk
*
walk
);
void
scatterwalk_done
(
struct
scatter_walk
*
walk
,
int
out
,
int
more
);
void
scatterwalk_map_and_copy
(
void
*
buf
,
struct
scatterlist
*
sg
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录