1 ext4 crypto: fix compile warnings
3 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
5 fs/ext4/crypto.c | 19 ++++++++++---------
6 1 file changed, 10 insertions(+), 9 deletions(-)
8 diff --git a/fs/ext4/crypto.c b/fs/ext4/crypto.c
9 index e892d68..0428608 100644
10 --- a/fs/ext4/crypto.c
11 +++ b/fs/ext4/crypto.c
13 #include <linux/random.h>
14 #include <linux/scatterlist.h>
15 #include <linux/spinlock_types.h>
16 +#include <linux/key.h>
22 /* Encryption added and removed here! (L: */
24 -mempool_t *ext4_bounce_page_pool = NULL;
25 +static mempool_t *ext4_bounce_page_pool = NULL;
27 -LIST_HEAD(ext4_free_crypto_ctxs);
28 -DEFINE_SPINLOCK(ext4_crypto_ctx_lock);
29 +static LIST_HEAD(ext4_free_crypto_ctxs);
30 +static DEFINE_SPINLOCK(ext4_crypto_ctx_lock);
32 /* TODO(mhalcrow): Remove for release */
33 atomic_t ext4_dbg_pages = ATOMIC_INIT(0);
34 @@ -87,7 +88,7 @@ void ext4_release_crypto_ctx(struct ext4_crypto_ctx *ctx)
35 * Return: An allocated and initialized encryption context on
36 * success. An error value or NULL otherwise.
38 -static struct ext4_crypto_ctx *ext4_alloc_and_init_crypto_ctx(u32 mask)
39 +static struct ext4_crypto_ctx *ext4_alloc_and_init_crypto_ctx(gfp_t mask)
41 struct ext4_crypto_ctx *ctx = kzalloc(sizeof(struct ext4_crypto_ctx),
43 @@ -373,8 +374,8 @@ static void ext4_prep_pages_for_write(struct page *ciphertext_page,
44 * Return: An allocated page with the encrypted content on
45 * success. Else, an error value or NULL.
47 -struct page *ext4_xts_encrypt(struct ext4_crypto_ctx *ctx,
48 - struct page *plaintext_page)
49 +static struct page *ext4_xts_encrypt(struct ext4_crypto_ctx *ctx,
50 + struct page *plaintext_page)
52 struct page *ciphertext_page = ctx->bounce_page;
53 u8 xts_tweak[EXT4_XTS_TWEAK_SIZE];
54 @@ -493,7 +494,7 @@ struct page *ext4_encrypt(struct ext4_crypto_ctx *ctx,
56 * Return: Zero on success, non-zero otherwise.
58 -int ext4_xts_decrypt(struct ext4_crypto_ctx *ctx, struct page *page)
59 +static int ext4_xts_decrypt(struct ext4_crypto_ctx *ctx, struct page *page)
61 u8 xts_tweak[EXT4_XTS_TWEAK_SIZE];
62 struct ablkcipher_request *req = NULL;
63 @@ -607,7 +608,7 @@ static int ext4_get_wrapping_key_from_keyring(
64 if (WARN_ON_ONCE(create_key->datalen !=
65 sizeof(struct ecryptfs_auth_tok))) {
67 - "%s: Got auth tok length [%d], expected [%ld]\n",
68 + "%s: Got auth tok length [%d], expected [%zd]\n",
69 __func__, create_key->datalen,
70 sizeof(struct ecryptfs_auth_tok));
72 @@ -706,7 +707,7 @@ static uint32_t ext4_validate_encryption_key_size(uint32_t mode, uint32_t size)
73 struct ext4_hmac_result {
74 struct completion completion;
80 * ext4_hmac_complete() - Completion for async HMAC