From patchwork Mon Apr 2 14:02:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artem Bityutskiy X-Patchwork-Id: 150160 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A5779B6EEC for ; Tue, 3 Apr 2012 00:00:21 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SEhmo-00067p-9C; Mon, 02 Apr 2012 13:59:10 +0000 Received: from mga02.intel.com ([134.134.136.20]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SEhml-00067U-NL for linux-mtd@lists.infradead.org; Mon, 02 Apr 2012 13:59:08 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 02 Apr 2012 06:59:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.67,352,1309762800"; d="asc'?scan'208";a="124483058" Received: from linux.jf.intel.com (HELO linux.intel.com) ([10.23.219.25]) by orsmga001.jf.intel.com with ESMTP; 02 Apr 2012 06:59:04 -0700 Received: from [10.237.72.167] (sauron.fi.intel.com [10.237.72.167]) by linux.intel.com (Postfix) with ESMTP id E00906A4007; Mon, 2 Apr 2012 06:59:01 -0700 (PDT) Message-ID: <1333375338.22146.6.camel@sauron.fi.intel.com> Subject: Re: [patch] UBIFS: Add a encryption key parameter to the compress / decompress function. From: Artem Bityutskiy To: Joel Reardon Date: Mon, 02 Apr 2012 17:02:18 +0300 In-Reply-To: References: <1330531826.3545.128.camel@sauron.fi.intel.com> <1332511796.18717.72.camel@sauron.fi.intel.com> <1332521515.22278.2.camel@sauron.fi.intel.com> <1332836863.31549.9.camel@sauron.fi.intel.com> X-Mailer: Evolution 3.2.3 (3.2.3-2.fc16) Mime-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -5.0 (-----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-5.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [134.134.136.20 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (dedekind1[at]gmail.com) 0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is CUSTOM_MED 0.8 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (dedekind1[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.9 NML_ADSP_CUSTOM_MED ADSP custom_med hit, and not from a mailing list Cc: linux-fsdevel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: dedekind1@gmail.com List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org On Thu, 2012-03-29 at 16:11 +0200, Joel Reardon wrote: > Added a crypto_key parameter to ubifs compress and decompress. Will be used > later if non-NULL to encrypt / decrypt data nodes. > > Signed-off-by: Joel Reardon Hi, thanks, pushed with the following amendments: diff --git a/fs/ubifs/compress.c b/fs/ubifs/compress.c index c91974a..b796b8d 100644 --- a/fs/ubifs/compress.c +++ b/fs/ubifs/compress.c @@ -82,8 +82,8 @@ struct ubifs_compressor *ubifs_compressors[UBIFS_COMPR_TYPES_CNT]; * @out_len: output buffer length is returned here * @compr_type: type of compression to use on enter, actually used compression * type on exit - * @crypto_key: a pointer to bytes to use as the encryption key, - * if NULL then no encryption is performed. + * @crypto_key: a pointer to bytes to use as the encryption key, if NULL then + * no encryption is performed * * This function compresses input buffer @in_buf of length @in_len and stores * the result in the output buffer @out_buf and the resulting length in @@ -142,8 +142,8 @@ no_compr: * @out_buf: output buffer where decompressed data should * @out_len: output length is returned here * @compr_type: type of compression - * @crypto_key: a pointer to bytes to use as the decryption key, - * if NULL then no decryption is performed. + * @crypto_key: a pointer to bytes to use as the decryption key, if NULL then + * no decryption is performed. * * This function decompresses data from buffer @in_buf into buffer @out_buf. * The length of the uncompressed data is returned in @out_len. This functions diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c index 9ece275..57c4d2f 100644 --- a/fs/ubifs/journal.c +++ b/fs/ubifs/journal.c @@ -1113,8 +1113,7 @@ static int recomp_data_node(struct ubifs_data_node *dn, int *new_len) len = le32_to_cpu(dn->ch.len) - UBIFS_DATA_NODE_SZ; compr_type = le16_to_cpu(dn->compr_type); - err = ubifs_decompress( - &dn->data, len, buf, &out_len, compr_type, NULL); + err = ubifs_decompress(&dn->data, len, buf, &out_len, compr_type, NULL); if (err) goto out;