Skip to content

Commit 53fd755

Browse files
ebiggerstytso
authored andcommitted
fscrypto: rename completion callbacks to reflect usage
fscrypt_complete() was used only for data pages, not for all encryption/decryption. Rename it to page_crypt_complete(). dir_crypt_complete() was used for filename encryption/decryption for both directory entries and symbolic links. Rename it to fname_crypt_complete(). Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent d83ae73 commit 53fd755

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

‎fs/crypto/crypto.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ struct fscrypt_ctx *fscrypt_get_ctx(struct inode *inode, gfp_t gfp_flags)
127127
EXPORT_SYMBOL(fscrypt_get_ctx);
128128

129129
/**
130-
* fscrypt_complete() - The completion callback for page encryption
131-
* @req: The asynchronous encryption request context
132-
* @res: The result of the encryption operation
130+
* page_crypt_complete() - completion callback for page crypto
131+
* @req: The asynchronous cipher request context
132+
* @res: The result of the cipher operation
133133
*/
134-
static void fscrypt_complete(struct crypto_async_request *req, int res)
134+
static void page_crypt_complete(struct crypto_async_request *req, int res)
135135
{
136136
struct fscrypt_completion_result *ecr = req->data;
137137

@@ -169,7 +169,7 @@ static int do_page_crypto(struct inode *inode,
169169

170170
skcipher_request_set_callback(
171171
req, CRYPTO_TFM_REQ_MAY_BACKLOG | CRYPTO_TFM_REQ_MAY_SLEEP,
172-
fscrypt_complete, &ecr);
172+
page_crypt_complete, &ecr);
173173

174174
BUILD_BUG_ON(FS_XTS_TWEAK_SIZE < sizeof(index));
175175
memcpy(xts_tweak, &index, sizeof(index));

‎fs/crypto/fname.c‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ static u32 size_round_up(size_t size, size_t blksize)
2020
}
2121

2222
/**
23-
* dir_crypt_complete() -
23+
* fname_crypt_complete() - completion callback for filename crypto
24+
* @req: The asynchronous cipher request context
25+
* @res: The result of the cipher operation
2426
*/
25-
static void dir_crypt_complete(struct crypto_async_request *req, int res)
27+
static void fname_crypt_complete(struct crypto_async_request *req, int res)
2628
{
2729
struct fscrypt_completion_result *ecr = req->data;
2830

@@ -82,7 +84,7 @@ static int fname_encrypt(struct inode *inode,
8284
}
8385
skcipher_request_set_callback(req,
8486
CRYPTO_TFM_REQ_MAY_BACKLOG | CRYPTO_TFM_REQ_MAY_SLEEP,
85-
dir_crypt_complete, &ecr);
87+
fname_crypt_complete, &ecr);
8688

8789
/* Copy the input */
8890
memcpy(workbuf, iname->name, iname->len);
@@ -144,7 +146,7 @@ static int fname_decrypt(struct inode *inode,
144146
}
145147
skcipher_request_set_callback(req,
146148
CRYPTO_TFM_REQ_MAY_BACKLOG | CRYPTO_TFM_REQ_MAY_SLEEP,
147-
dir_crypt_complete, &ecr);
149+
fname_crypt_complete, &ecr);
148150

149151
/* Initialize IV */
150152
memset(iv, 0, FS_CRYPTO_BLOCK_SIZE);

0 commit comments

Comments
 (0)