diff options
author | Tyler Hicks <tyhicks@canonical.com> | 2013-05-23 15:08:40 -0400 |
---|---|---|
committer | Tyler Hicks <tyhicks@canonical.com> | 2013-06-07 20:28:29 -0400 |
commit | 0df5ed65c14e2c36ed842fcff58118662009f1a1 (patch) | |
tree | 6e053b8e634ca9c74f7151e3a0969851c471abce /fs/ecryptfs | |
parent | 406c93df09ae7a345b510cf6619f881b42a3d553 (diff) |
eCryptfs: Make extent and scatterlist crypt function parameters similar
The 'dest' abbreviation is only used in crypt_scatterlist(), while all
other functions in crypto.c use 'dst' so dest_sg should be renamed to
dst_sg.
The crypt_stat parameter is typically the first parameter in internal
eCryptfs functions so crypt_stat and dst_page should be swapped in
crypt_extent().
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Diffstat (limited to 'fs/ecryptfs')
-rw-r--r-- | fs/ecryptfs/crypto.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index 9947388ccd8d..46a6f6a4a705 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c | |||
@@ -330,7 +330,7 @@ static void extent_crypt_complete(struct crypto_async_request *req, int rc) | |||
330 | /** | 330 | /** |
331 | * crypt_scatterlist | 331 | * crypt_scatterlist |
332 | * @crypt_stat: Pointer to the crypt_stat struct to initialize. | 332 | * @crypt_stat: Pointer to the crypt_stat struct to initialize. |
333 | * @dest_sg: Destination of the data after performing the crypto operation | 333 | * @dst_sg: Destination of the data after performing the crypto operation |
334 | * @src_sg: Data to be encrypted or decrypted | 334 | * @src_sg: Data to be encrypted or decrypted |
335 | * @size: Length of data | 335 | * @size: Length of data |
336 | * @iv: IV to use | 336 | * @iv: IV to use |
@@ -339,7 +339,7 @@ static void extent_crypt_complete(struct crypto_async_request *req, int rc) | |||
339 | * Returns the number of bytes encrypted or decrypted; negative value on error | 339 | * Returns the number of bytes encrypted or decrypted; negative value on error |
340 | */ | 340 | */ |
341 | static int crypt_scatterlist(struct ecryptfs_crypt_stat *crypt_stat, | 341 | static int crypt_scatterlist(struct ecryptfs_crypt_stat *crypt_stat, |
342 | struct scatterlist *dest_sg, | 342 | struct scatterlist *dst_sg, |
343 | struct scatterlist *src_sg, int size, | 343 | struct scatterlist *src_sg, int size, |
344 | unsigned char *iv, int op) | 344 | unsigned char *iv, int op) |
345 | { | 345 | { |
@@ -384,7 +384,7 @@ static int crypt_scatterlist(struct ecryptfs_crypt_stat *crypt_stat, | |||
384 | crypt_stat->flags |= ECRYPTFS_KEY_SET; | 384 | crypt_stat->flags |= ECRYPTFS_KEY_SET; |
385 | } | 385 | } |
386 | mutex_unlock(&crypt_stat->cs_tfm_mutex); | 386 | mutex_unlock(&crypt_stat->cs_tfm_mutex); |
387 | ablkcipher_request_set_crypt(req, src_sg, dest_sg, size, iv); | 387 | ablkcipher_request_set_crypt(req, src_sg, dst_sg, size, iv); |
388 | rc = op == ENCRYPT ? crypto_ablkcipher_encrypt(req) : | 388 | rc = op == ENCRYPT ? crypto_ablkcipher_encrypt(req) : |
389 | crypto_ablkcipher_decrypt(req); | 389 | crypto_ablkcipher_decrypt(req); |
390 | if (rc == -EINPROGRESS || rc == -EBUSY) { | 390 | if (rc == -EINPROGRESS || rc == -EBUSY) { |
@@ -413,9 +413,9 @@ static loff_t lower_offset_for_page(struct ecryptfs_crypt_stat *crypt_stat, | |||
413 | 413 | ||
414 | /** | 414 | /** |
415 | * crypt_extent | 415 | * crypt_extent |
416 | * @dst_page: The page to write the result into | ||
417 | * @crypt_stat: crypt_stat containing cryptographic context for the | 416 | * @crypt_stat: crypt_stat containing cryptographic context for the |
418 | * encryption operation | 417 | * encryption operation |
418 | * @dst_page: The page to write the result into | ||
419 | * @src_page: The page to read from | 419 | * @src_page: The page to read from |
420 | * @extent_offset: Page extent offset for use in generating IV | 420 | * @extent_offset: Page extent offset for use in generating IV |
421 | * @op: ENCRYPT or DECRYPT to indicate the desired operation | 421 | * @op: ENCRYPT or DECRYPT to indicate the desired operation |
@@ -424,8 +424,8 @@ static loff_t lower_offset_for_page(struct ecryptfs_crypt_stat *crypt_stat, | |||
424 | * | 424 | * |
425 | * Return zero on success; non-zero otherwise | 425 | * Return zero on success; non-zero otherwise |
426 | */ | 426 | */ |
427 | static int crypt_extent(struct page *dst_page, | 427 | static int crypt_extent(struct ecryptfs_crypt_stat *crypt_stat, |
428 | struct ecryptfs_crypt_stat *crypt_stat, | 428 | struct page *dst_page, |
429 | struct page *src_page, | 429 | struct page *src_page, |
430 | unsigned long extent_offset, int op) | 430 | unsigned long extent_offset, int op) |
431 | { | 431 | { |
@@ -508,7 +508,7 @@ int ecryptfs_encrypt_page(struct page *page) | |||
508 | for (extent_offset = 0; | 508 | for (extent_offset = 0; |
509 | extent_offset < (PAGE_CACHE_SIZE / crypt_stat->extent_size); | 509 | extent_offset < (PAGE_CACHE_SIZE / crypt_stat->extent_size); |
510 | extent_offset++) { | 510 | extent_offset++) { |
511 | rc = crypt_extent(enc_extent_page, crypt_stat, page, | 511 | rc = crypt_extent(crypt_stat, enc_extent_page, page, |
512 | extent_offset, ENCRYPT); | 512 | extent_offset, ENCRYPT); |
513 | if (rc) { | 513 | if (rc) { |
514 | printk(KERN_ERR "%s: Error encrypting extent; " | 514 | printk(KERN_ERR "%s: Error encrypting extent; " |
@@ -581,7 +581,7 @@ int ecryptfs_decrypt_page(struct page *page) | |||
581 | for (extent_offset = 0; | 581 | for (extent_offset = 0; |
582 | extent_offset < (PAGE_CACHE_SIZE / crypt_stat->extent_size); | 582 | extent_offset < (PAGE_CACHE_SIZE / crypt_stat->extent_size); |
583 | extent_offset++) { | 583 | extent_offset++) { |
584 | rc = crypt_extent(page, crypt_stat, page, | 584 | rc = crypt_extent(crypt_stat, page, page, |
585 | extent_offset, DECRYPT); | 585 | extent_offset, DECRYPT); |
586 | if (rc) { | 586 | if (rc) { |
587 | printk(KERN_ERR "%s: Error encrypting extent; " | 587 | printk(KERN_ERR "%s: Error encrypting extent; " |