From patchwork Mon Dec 12 20:48:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 9471317 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0962D607D3 for ; Mon, 12 Dec 2016 20:50:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3F0F28518 for ; Mon, 12 Dec 2016 20:50:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E901B2851B; Mon, 12 Dec 2016 20:50:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9259628518 for ; Mon, 12 Dec 2016 20:50:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932519AbcLLUuP (ORCPT ); Mon, 12 Dec 2016 15:50:15 -0500 Received: from mail-wj0-f196.google.com ([209.85.210.196]:35035 "EHLO mail-wj0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932510AbcLLUuN (ORCPT ); Mon, 12 Dec 2016 15:50:13 -0500 Received: by mail-wj0-f196.google.com with SMTP id he10so13560193wjc.2 for ; Mon, 12 Dec 2016 12:50:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=nZtLdpFkQU5DWoqODo7FLsgL9KOFyH6kFr6I8iou2t8=; b=NOdDLPvJy+s7Ip8Cftmjcw982WwPXNJqHFLIE8+YBEFSKVVrp17l5BxvocwvJph04+ F3GROPiHKuPKzAC4TC7tBMFqEBhEiuWF6f4sqw5BZ6jBi8PcNJVv8ZfydaQHpIM8Ut5C u3UkZzko5toFS72A1xuqM+NoRtTJQAJVez8HZ8bBxmHPRGUD28drRR5uqOdMOUMl+Pq7 nt/C+cRhlS+4wY1kiQnBvy2vtOZaL26fuU1Hie/PJKiJxFcS/+PWuied/h5BWQJp2hVg 73toxU4sNVCJyWuvYKUBltX04L+qNmeN3nCiny8i6nK47SknXr1g0MHDGPS4FtUr8uIO Y8Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=nZtLdpFkQU5DWoqODo7FLsgL9KOFyH6kFr6I8iou2t8=; b=E+wUUjNpowDLhfIQd0qp9+l310jG/3MqwPv5XgMetlGI/P/J4FTjX/yqgpZQK9SyLD OCxx0GDo/L1lcsNGD54l0SvcIRrqK2MWbGwfoR1HVTfuKL4aKyCP+CYJ1rcNQKZufVbK 33vwfNl7thQUzTFigoJg1A0c+eVy2lpAky+sQY9wcR/P7eR50r1yAETHYJkcmGMXBzlw XJQ6V7bPcot+AmCYR/28mKJT5NCPTeMIfoKQIwYMrEr4RjZycfuopz3IKzRVmzH+ApPc Ip0s2FWkQpLyuOL3FF50Eihp646sejSFMGw357EK5EW1MsIUdPgSKd496C97d7ZtFvLT iXEw== X-Gm-Message-State: AKaTC03UdrI9UB77B1T/+yU8U4qvdm8EPTuSJojipEengmRFIDgqc+7L0HxDUpJUvXxYxA== X-Received: by 10.194.91.148 with SMTP id ce20mr95503289wjb.59.1481575811749; Mon, 12 Dec 2016 12:50:11 -0800 (PST) Received: from dhcp-1-105.brq.redhat.com ([213.175.37.12]) by smtp.gmail.com with ESMTPSA id 135sm37201887wmh.14.2016.12.12.12.50.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Dec 2016 12:50:11 -0800 (PST) From: Ilya Dryomov To: ceph-devel@vger.kernel.org Subject: [PATCH 10/15] libceph: uninline ceph_crypto_key_destroy() Date: Mon, 12 Dec 2016 21:48:55 +0100 Message-Id: <1481575740-1834-11-git-send-email-idryomov@gmail.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1481575740-1834-1-git-send-email-idryomov@gmail.com> References: <1481575740-1834-1-git-send-email-idryomov@gmail.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Ilya Dryomov --- net/ceph/crypto.c | 8 ++++++++ net/ceph/crypto.h | 9 +-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/net/ceph/crypto.c b/net/ceph/crypto.c index 38936e1fd644..c4d8f68e0b18 100644 --- a/net/ceph/crypto.c +++ b/net/ceph/crypto.c @@ -80,6 +80,14 @@ int ceph_crypto_key_unarmor(struct ceph_crypto_key *key, const char *inkey) return 0; } +void ceph_crypto_key_destroy(struct ceph_crypto_key *key) +{ + if (key) { + kfree(key->key); + key->key = NULL; + } +} + static struct crypto_skcipher *ceph_crypto_alloc_cipher(void) { return crypto_alloc_skcipher("cbc(aes)", 0, CRYPTO_ALG_ASYNC); diff --git a/net/ceph/crypto.h b/net/ceph/crypto.h index c33bcafd3829..c4211590b721 100644 --- a/net/ceph/crypto.h +++ b/net/ceph/crypto.h @@ -14,19 +14,12 @@ struct ceph_crypto_key { void *key; }; -static inline void ceph_crypto_key_destroy(struct ceph_crypto_key *key) -{ - if (key) { - kfree(key->key); - key->key = NULL; - } -} - int ceph_crypto_key_clone(struct ceph_crypto_key *dst, const struct ceph_crypto_key *src); int ceph_crypto_key_encode(struct ceph_crypto_key *key, void **p, void *end); int ceph_crypto_key_decode(struct ceph_crypto_key *key, void **p, void *end); int ceph_crypto_key_unarmor(struct ceph_crypto_key *key, const char *in); +void ceph_crypto_key_destroy(struct ceph_crypto_key *key); /* crypto.c */ int ceph_crypt(const struct ceph_crypto_key *key, bool encrypt,