[patch] UBIFS: Add a encryption key parameter to the compress / decompress function.

Artem Bityutskiy dedekind1 at gmail.com
Mon Apr 2 10:02:18 EDT 2012


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 <reardonj at inf.ethz.ch>

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;

-- 
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20120402/3cba1670/attachment-0001.sig>


More information about the linux-mtd mailing list