Loading fs/crypto/bio.c +5 −6 Original line number Diff line number Diff line Loading @@ -53,9 +53,8 @@ EXPORT_SYMBOL(fscrypt_decrypt_bio); static void completion_pages(struct work_struct *work) { struct fscrypt_ctx *ctx = container_of(work, struct fscrypt_ctx, r.work); struct bio *bio = ctx->r.bio; struct fscrypt_ctx *ctx = container_of(work, struct fscrypt_ctx, work); struct bio *bio = ctx->bio; __fscrypt_decrypt_bio(bio, true); fscrypt_release_ctx(ctx); Loading @@ -64,9 +63,9 @@ static void completion_pages(struct work_struct *work) void fscrypt_enqueue_decrypt_bio(struct fscrypt_ctx *ctx, struct bio *bio) { INIT_WORK(&ctx->r.work, completion_pages); ctx->r.bio = bio; fscrypt_enqueue_decrypt_work(&ctx->r.work); INIT_WORK(&ctx->work, completion_pages); ctx->bio = bio; fscrypt_enqueue_decrypt_work(&ctx->work); } EXPORT_SYMBOL(fscrypt_enqueue_decrypt_bio); Loading fs/crypto/crypto.c +7 −7 Original line number Diff line number Diff line Loading @@ -59,11 +59,11 @@ void fscrypt_enqueue_decrypt_work(struct work_struct *work) EXPORT_SYMBOL(fscrypt_enqueue_decrypt_work); /** * fscrypt_release_ctx() - Releases an encryption context * @ctx: The encryption context to release. * fscrypt_release_ctx() - Release a decryption context * @ctx: The decryption context to release. * * If the encryption context was allocated from the pre-allocated pool, returns * it to that pool. Else, frees it. * If the decryption context was allocated from the pre-allocated pool, return * it to that pool. Else, free it. */ void fscrypt_release_ctx(struct fscrypt_ctx *ctx) { Loading @@ -80,12 +80,12 @@ void fscrypt_release_ctx(struct fscrypt_ctx *ctx) EXPORT_SYMBOL(fscrypt_release_ctx); /** * fscrypt_get_ctx() - Gets an encryption context * fscrypt_get_ctx() - Get a decryption context * @gfp_flags: The gfp flag for memory allocation * * Allocates and initializes an encryption context. * Allocate and initialize a decryption context. * * Return: A new encryption context on success; an ERR_PTR() otherwise. * Return: A new decryption context on success; an ERR_PTR() otherwise. */ struct fscrypt_ctx *fscrypt_get_ctx(gfp_t gfp_flags) { Loading include/linux/fscrypt.h +2 −5 Original line number Diff line number Diff line Loading @@ -63,16 +63,13 @@ struct fscrypt_operations { unsigned int max_namelen; }; /* Decryption work */ struct fscrypt_ctx { union { struct { struct page *bounce_page; /* Ciphertext page */ struct page *control_page; /* Original page */ } w; struct { struct bio *bio; struct work_struct work; } r; }; struct list_head free_list; /* Free list */ }; u8 flags; /* Flags */ Loading Loading
fs/crypto/bio.c +5 −6 Original line number Diff line number Diff line Loading @@ -53,9 +53,8 @@ EXPORT_SYMBOL(fscrypt_decrypt_bio); static void completion_pages(struct work_struct *work) { struct fscrypt_ctx *ctx = container_of(work, struct fscrypt_ctx, r.work); struct bio *bio = ctx->r.bio; struct fscrypt_ctx *ctx = container_of(work, struct fscrypt_ctx, work); struct bio *bio = ctx->bio; __fscrypt_decrypt_bio(bio, true); fscrypt_release_ctx(ctx); Loading @@ -64,9 +63,9 @@ static void completion_pages(struct work_struct *work) void fscrypt_enqueue_decrypt_bio(struct fscrypt_ctx *ctx, struct bio *bio) { INIT_WORK(&ctx->r.work, completion_pages); ctx->r.bio = bio; fscrypt_enqueue_decrypt_work(&ctx->r.work); INIT_WORK(&ctx->work, completion_pages); ctx->bio = bio; fscrypt_enqueue_decrypt_work(&ctx->work); } EXPORT_SYMBOL(fscrypt_enqueue_decrypt_bio); Loading
fs/crypto/crypto.c +7 −7 Original line number Diff line number Diff line Loading @@ -59,11 +59,11 @@ void fscrypt_enqueue_decrypt_work(struct work_struct *work) EXPORT_SYMBOL(fscrypt_enqueue_decrypt_work); /** * fscrypt_release_ctx() - Releases an encryption context * @ctx: The encryption context to release. * fscrypt_release_ctx() - Release a decryption context * @ctx: The decryption context to release. * * If the encryption context was allocated from the pre-allocated pool, returns * it to that pool. Else, frees it. * If the decryption context was allocated from the pre-allocated pool, return * it to that pool. Else, free it. */ void fscrypt_release_ctx(struct fscrypt_ctx *ctx) { Loading @@ -80,12 +80,12 @@ void fscrypt_release_ctx(struct fscrypt_ctx *ctx) EXPORT_SYMBOL(fscrypt_release_ctx); /** * fscrypt_get_ctx() - Gets an encryption context * fscrypt_get_ctx() - Get a decryption context * @gfp_flags: The gfp flag for memory allocation * * Allocates and initializes an encryption context. * Allocate and initialize a decryption context. * * Return: A new encryption context on success; an ERR_PTR() otherwise. * Return: A new decryption context on success; an ERR_PTR() otherwise. */ struct fscrypt_ctx *fscrypt_get_ctx(gfp_t gfp_flags) { Loading
include/linux/fscrypt.h +2 −5 Original line number Diff line number Diff line Loading @@ -63,16 +63,13 @@ struct fscrypt_operations { unsigned int max_namelen; }; /* Decryption work */ struct fscrypt_ctx { union { struct { struct page *bounce_page; /* Ciphertext page */ struct page *control_page; /* Original page */ } w; struct { struct bio *bio; struct work_struct work; } r; }; struct list_head free_list; /* Free list */ }; u8 flags; /* Flags */ Loading