Skip to content

Commit 2a415a0

Browse files
committed
fscrypt: remove the "write" part of struct fscrypt_ctx
Now that fscrypt_ctx is not used for writes, remove the 'w' fields. Reviewed-by: Chandan Rajendra <chandan@linux.ibm.com> Signed-off-by: Eric Biggers <ebiggers@google.com>
1 parent d2d0727 commit 2a415a0

3 files changed

Lines changed: 14 additions & 18 deletions

File tree

‎fs/crypto/bio.c‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ EXPORT_SYMBOL(fscrypt_decrypt_bio);
5353

5454
static void completion_pages(struct work_struct *work)
5555
{
56-
struct fscrypt_ctx *ctx =
57-
container_of(work, struct fscrypt_ctx, r.work);
58-
struct bio *bio = ctx->r.bio;
56+
struct fscrypt_ctx *ctx = container_of(work, struct fscrypt_ctx, work);
57+
struct bio *bio = ctx->bio;
5958

6059
__fscrypt_decrypt_bio(bio, true);
6160
fscrypt_release_ctx(ctx);
@@ -64,9 +63,9 @@ static void completion_pages(struct work_struct *work)
6463

6564
void fscrypt_enqueue_decrypt_bio(struct fscrypt_ctx *ctx, struct bio *bio)
6665
{
67-
INIT_WORK(&ctx->r.work, completion_pages);
68-
ctx->r.bio = bio;
69-
fscrypt_enqueue_decrypt_work(&ctx->r.work);
66+
INIT_WORK(&ctx->work, completion_pages);
67+
ctx->bio = bio;
68+
fscrypt_enqueue_decrypt_work(&ctx->work);
7069
}
7170
EXPORT_SYMBOL(fscrypt_enqueue_decrypt_bio);
7271

‎fs/crypto/crypto.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ void fscrypt_enqueue_decrypt_work(struct work_struct *work)
5959
EXPORT_SYMBOL(fscrypt_enqueue_decrypt_work);
6060

6161
/**
62-
* fscrypt_release_ctx() - Releases an encryption context
63-
* @ctx: The encryption context to release.
62+
* fscrypt_release_ctx() - Release a decryption context
63+
* @ctx: The decryption context to release.
6464
*
65-
* If the encryption context was allocated from the pre-allocated pool, returns
66-
* it to that pool. Else, frees it.
65+
* If the decryption context was allocated from the pre-allocated pool, return
66+
* it to that pool. Else, free it.
6767
*/
6868
void fscrypt_release_ctx(struct fscrypt_ctx *ctx)
6969
{
@@ -80,12 +80,12 @@ void fscrypt_release_ctx(struct fscrypt_ctx *ctx)
8080
EXPORT_SYMBOL(fscrypt_release_ctx);
8181

8282
/**
83-
* fscrypt_get_ctx() - Gets an encryption context
83+
* fscrypt_get_ctx() - Get a decryption context
8484
* @gfp_flags: The gfp flag for memory allocation
8585
*
86-
* Allocates and initializes an encryption context.
86+
* Allocate and initialize a decryption context.
8787
*
88-
* Return: A new encryption context on success; an ERR_PTR() otherwise.
88+
* Return: A new decryption context on success; an ERR_PTR() otherwise.
8989
*/
9090
struct fscrypt_ctx *fscrypt_get_ctx(gfp_t gfp_flags)
9191
{

‎include/linux/fscrypt.h‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,13 @@ struct fscrypt_operations {
6363
unsigned int max_namelen;
6464
};
6565

66+
/* Decryption work */
6667
struct fscrypt_ctx {
6768
union {
68-
struct {
69-
struct page *bounce_page; /* Ciphertext page */
70-
struct page *control_page; /* Original page */
71-
} w;
7269
struct {
7370
struct bio *bio;
7471
struct work_struct work;
75-
} r;
72+
};
7673
struct list_head free_list; /* Free list */
7774
};
7875
u8 flags; /* Flags */

0 commit comments

Comments
 (0)