diff options
Diffstat (limited to 'drivers/block/cryptoloop.c')
-rw-r--r-- | drivers/block/cryptoloop.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/block/cryptoloop.c b/drivers/block/cryptoloop.c index 40535036e893..1b58b010797f 100644 --- a/drivers/block/cryptoloop.c +++ b/drivers/block/cryptoloop.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/crypto.h> | 26 | #include <linux/crypto.h> |
27 | #include <linux/blkdev.h> | 27 | #include <linux/blkdev.h> |
28 | #include <linux/loop.h> | 28 | #include <linux/loop.h> |
29 | #include <linux/scatterlist.h> | ||
29 | #include <asm/semaphore.h> | 30 | #include <asm/semaphore.h> |
30 | #include <asm/uaccess.h> | 31 | #include <asm/uaccess.h> |
31 | 32 | ||
@@ -119,14 +120,17 @@ cryptoloop_transfer(struct loop_device *lo, int cmd, | |||
119 | .tfm = tfm, | 120 | .tfm = tfm, |
120 | .flags = CRYPTO_TFM_REQ_MAY_SLEEP, | 121 | .flags = CRYPTO_TFM_REQ_MAY_SLEEP, |
121 | }; | 122 | }; |
122 | struct scatterlist sg_out = { NULL, }; | 123 | struct scatterlist sg_out; |
123 | struct scatterlist sg_in = { NULL, }; | 124 | struct scatterlist sg_in; |
124 | 125 | ||
125 | encdec_cbc_t encdecfunc; | 126 | encdec_cbc_t encdecfunc; |
126 | struct page *in_page, *out_page; | 127 | struct page *in_page, *out_page; |
127 | unsigned in_offs, out_offs; | 128 | unsigned in_offs, out_offs; |
128 | int err; | 129 | int err; |
129 | 130 | ||
131 | sg_init_table(&sg_out, 1); | ||
132 | sg_init_table(&sg_in, 1); | ||
133 | |||
130 | if (cmd == READ) { | 134 | if (cmd == READ) { |
131 | in_page = raw_page; | 135 | in_page = raw_page; |
132 | in_offs = raw_off; | 136 | in_offs = raw_off; |
@@ -146,11 +150,11 @@ cryptoloop_transfer(struct loop_device *lo, int cmd, | |||
146 | u32 iv[4] = { 0, }; | 150 | u32 iv[4] = { 0, }; |
147 | iv[0] = cpu_to_le32(IV & 0xffffffff); | 151 | iv[0] = cpu_to_le32(IV & 0xffffffff); |
148 | 152 | ||
149 | sg_in.page = in_page; | 153 | sg_set_page(&sg_in, in_page); |
150 | sg_in.offset = in_offs; | 154 | sg_in.offset = in_offs; |
151 | sg_in.length = sz; | 155 | sg_in.length = sz; |
152 | 156 | ||
153 | sg_out.page = out_page; | 157 | sg_set_page(&sg_out, out_page); |
154 | sg_out.offset = out_offs; | 158 | sg_out.offset = out_offs; |
155 | sg_out.length = sz; | 159 | sg_out.length = sz; |
156 | 160 | ||