Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / block / cryptoloop.c
index 6dc9a09..3d4261c 100644 (file)
@@ -57,9 +57,11 @@ cryptoloop_init(struct loop_device *lo, const struct loop_info64 *info)
        mode = strsep(&cmsp, "-");
 
        if (mode == NULL || strcmp(mode, "cbc") == 0)
-               tfm = crypto_alloc_tfm(cipher, CRYPTO_TFM_MODE_CBC);
+               tfm = crypto_alloc_tfm(cipher, CRYPTO_TFM_MODE_CBC |
+                                              CRYPTO_TFM_REQ_MAY_SLEEP);
        else if (strcmp(mode, "ecb") == 0)
-               tfm = crypto_alloc_tfm(cipher, CRYPTO_TFM_MODE_ECB);
+               tfm = crypto_alloc_tfm(cipher, CRYPTO_TFM_MODE_ECB |
+                                              CRYPTO_TFM_REQ_MAY_SLEEP);
        if (tfm == NULL)
                return -EINVAL;
 
@@ -93,8 +95,8 @@ cryptoloop_transfer_ecb(struct loop_device *lo, int cmd,
                        int size, sector_t IV)
 {
        struct crypto_tfm *tfm = (struct crypto_tfm *) lo->key_data;
-       struct scatterlist sg_out = { 0, };
-       struct scatterlist sg_in = { 0, };
+       struct scatterlist sg_out = { NULL, };
+       struct scatterlist sg_in = { NULL, };
 
        encdec_ecb_t encdecfunc;
        struct page *in_page, *out_page;
@@ -147,8 +149,8 @@ cryptoloop_transfer_cbc(struct loop_device *lo, int cmd,
                        int size, sector_t IV)
 {
        struct crypto_tfm *tfm = (struct crypto_tfm *) lo->key_data;
-       struct scatterlist sg_out = { 0, };
-       struct scatterlist sg_in = { 0, };
+       struct scatterlist sg_out = { NULL, };
+       struct scatterlist sg_in = { NULL, };
 
        encdec_cbc_t encdecfunc;
        struct page *in_page, *out_page;