staging: lustre: remove ll_crypto_alloc_blkcipher
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Aug 2013 06:44:31 +0000 (14:44 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Aug 2013 06:44:31 +0000 (14:44 +0800)
Turns out that the ll_crypto_alloc_blkcipher() wrapper didn't even do
anything, and is probably wrong, so it's not needed, just call the
crypto core directly.

Cc: Peng Tao <tao.peng@emc.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/include/linux/lustre_compat25.h
drivers/staging/lustre/lustre/obdclass/capa.c
drivers/staging/lustre/lustre/ptlrpc/gss/gss_krb5_mech.c

index 3ea520a8cbcda69ed8aba5f558e14d0bae989c1e..089f358b6b2eb5224aed49084c8750c8f9430c04 100644 (file)
@@ -99,19 +99,6 @@ static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt,
 #define FS_HAS_FIEMAP                  (0)
 #endif
 
-
-/* add a lustre compatible layer for crypto API */
-#include <linux/crypto.h>
-
-static inline
-struct crypto_blkcipher *ll_crypto_alloc_blkcipher(const char *name,
-                                                  u32 type, u32 mask)
-{
-       struct crypto_blkcipher *rtn = crypto_alloc_blkcipher(name, type, mask);
-
-       return (rtn == NULL ? ERR_PTR(-ENOMEM) : rtn);
-}
-
 #define ll_vfs_rmdir(dir,entry,mnt)         vfs_rmdir(dir,entry)
 #define ll_vfs_mkdir(inode,dir,mnt,mode)       vfs_mkdir(inode,dir,mode)
 #define ll_vfs_link(old,mnt,dir,new,mnt1)       vfs_link(old,dir,new)
index 8ec1ec9f6a68c4ba24452d8573edfed16a802e9a..68d797ba8ae4566d1d373cb80dbf556e490d159d 100644 (file)
@@ -303,7 +303,7 @@ int capa_encrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen)
 
        /* passing "aes" in a variable instead of a constant string keeps gcc
         * 4.3.2 happy */
-       tfm = ll_crypto_alloc_blkcipher(alg, 0, 0 );
+       tfm = crypto_alloc_blkcipher(alg, 0, 0 );
        if (IS_ERR(tfm)) {
                CERROR("failed to load transform for aes\n");
                return PTR_ERR(tfm);
@@ -353,7 +353,7 @@ int capa_decrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen)
 
        /* passing "aes" in a variable instead of a constant string keeps gcc
         * 4.3.2 happy */
-       tfm = ll_crypto_alloc_blkcipher(alg, 0, 0 );
+       tfm = crypto_alloc_blkcipher(alg, 0, 0 );
        if (IS_ERR(tfm)) {
                CERROR("failed to load transform for aes\n");
                return PTR_ERR(tfm);
index 900efeeee857b112b5c0a7ab4e02fed1621e23c7..c106a9e049a7516412253fd6e1e3139901fad500 100644 (file)
@@ -148,7 +148,7 @@ static const char * enctype2str(__u32 enctype)
 static
 int keyblock_init(struct krb5_keyblock *kb, char *alg_name, int alg_mode)
 {
-       kb->kb_tfm = ll_crypto_alloc_blkcipher(alg_name, alg_mode, 0);
+       kb->kb_tfm = crypto_alloc_blkcipher(alg_name, alg_mode, 0);
        if (IS_ERR(kb->kb_tfm)) {
                CERROR("failed to alloc tfm: %s, mode %d\n",
                       alg_name, alg_mode);
@@ -1256,7 +1256,7 @@ __u32 gss_wrap_kerberos(struct gss_ctx *gctx,
                        GOTO(arc4_out, rc = -EACCES);
                }
 
-               arc4_tfm = ll_crypto_alloc_blkcipher("ecb(arc4)", 0, 0);
+               arc4_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, 0);
                if (IS_ERR(arc4_tfm)) {
                        CERROR("failed to alloc tfm arc4 in ECB mode\n");
                        GOTO(arc4_out_key, rc = -EACCES);
@@ -1532,7 +1532,7 @@ __u32 gss_unwrap_kerberos(struct gss_ctx  *gctx,
                        GOTO(arc4_out, rc = -EACCES);
                }
 
-               arc4_tfm = ll_crypto_alloc_blkcipher("ecb(arc4)", 0, 0);
+               arc4_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, 0);
                if (IS_ERR(arc4_tfm)) {
                        CERROR("failed to alloc tfm arc4 in ECB mode\n");
                        GOTO(arc4_out_key, rc = -EACCES);