diff options
Diffstat (limited to 'include/crypto/scatterwalk.h')
-rw-r--r-- | include/crypto/scatterwalk.h | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/include/crypto/scatterwalk.h b/include/crypto/scatterwalk.h index 4fd95a323beb..3744d2a642df 100644 --- a/include/crypto/scatterwalk.h +++ b/include/crypto/scatterwalk.h | |||
@@ -25,28 +25,6 @@ | |||
25 | #include <linux/scatterlist.h> | 25 | #include <linux/scatterlist.h> |
26 | #include <linux/sched.h> | 26 | #include <linux/sched.h> |
27 | 27 | ||
28 | static inline enum km_type crypto_kmap_type(int out) | ||
29 | { | ||
30 | enum km_type type; | ||
31 | |||
32 | if (in_softirq()) | ||
33 | type = out * (KM_SOFTIRQ1 - KM_SOFTIRQ0) + KM_SOFTIRQ0; | ||
34 | else | ||
35 | type = out * (KM_USER1 - KM_USER0) + KM_USER0; | ||
36 | |||
37 | return type; | ||
38 | } | ||
39 | |||
40 | static inline void *crypto_kmap(struct page *page, int out) | ||
41 | { | ||
42 | return kmap_atomic(page, crypto_kmap_type(out)); | ||
43 | } | ||
44 | |||
45 | static inline void crypto_kunmap(void *vaddr, int out) | ||
46 | { | ||
47 | kunmap_atomic(vaddr, crypto_kmap_type(out)); | ||
48 | } | ||
49 | |||
50 | static inline void crypto_yield(u32 flags) | 28 | static inline void crypto_yield(u32 flags) |
51 | { | 29 | { |
52 | if (flags & CRYPTO_TFM_REQ_MAY_SLEEP) | 30 | if (flags & CRYPTO_TFM_REQ_MAY_SLEEP) |
@@ -121,15 +99,15 @@ static inline struct page *scatterwalk_page(struct scatter_walk *walk) | |||
121 | return sg_page(walk->sg) + (walk->offset >> PAGE_SHIFT); | 99 | return sg_page(walk->sg) + (walk->offset >> PAGE_SHIFT); |
122 | } | 100 | } |
123 | 101 | ||
124 | static inline void scatterwalk_unmap(void *vaddr, int out) | 102 | static inline void scatterwalk_unmap(void *vaddr) |
125 | { | 103 | { |
126 | crypto_kunmap(vaddr, out); | 104 | kunmap_atomic(vaddr); |
127 | } | 105 | } |
128 | 106 | ||
129 | void scatterwalk_start(struct scatter_walk *walk, struct scatterlist *sg); | 107 | void scatterwalk_start(struct scatter_walk *walk, struct scatterlist *sg); |
130 | void scatterwalk_copychunks(void *buf, struct scatter_walk *walk, | 108 | void scatterwalk_copychunks(void *buf, struct scatter_walk *walk, |
131 | size_t nbytes, int out); | 109 | size_t nbytes, int out); |
132 | void *scatterwalk_map(struct scatter_walk *walk, int out); | 110 | void *scatterwalk_map(struct scatter_walk *walk); |
133 | void scatterwalk_done(struct scatter_walk *walk, int out, int more); | 111 | void scatterwalk_done(struct scatter_walk *walk, int out, int more); |
134 | 112 | ||
135 | void scatterwalk_map_and_copy(void *buf, struct scatterlist *sg, | 113 | void scatterwalk_map_and_copy(void *buf, struct scatterlist *sg, |