Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 36e607a1 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

staging: lustre: remove ll_crypto_alloc_blkcipher



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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2b53313a
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -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)
+2 −2
Original line number Diff line number Diff line
@@ -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);
+3 −3
Original line number Diff line number Diff line
@@ -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);