From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org ([198.145.29.99]:47190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726167AbfEAWqG (ORCPT ); Wed, 1 May 2019 18:46:06 -0400 From: Eric Biggers Subject: [PATCH 02/13] fscrypt: remove the "write" part of struct fscrypt_ctx Date: Wed, 1 May 2019 15:45:04 -0700 Message-Id: <20190501224515.43059-3-ebiggers@kernel.org> In-Reply-To: <20190501224515.43059-1-ebiggers@kernel.org> References: <20190501224515.43059-1-ebiggers@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-fscrypt-owner@vger.kernel.org To: linux-fscrypt@vger.kernel.org Cc: linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org, Chandan Rajendra List-ID: From: Eric Biggers Now that fscrypt_ctx is not used for writes, remove the 'w' fields. Signed-off-by: Eric Biggers --- fs/crypto/bio.c | 11 +++++------ fs/crypto/crypto.c | 14 +++++++------- include/linux/fscrypt.h | 7 ++----- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c index 9107e8fe55897..548ec6bb569cf 100644 --- a/fs/crypto/bio.c +++ b/fs/crypto/bio.c @@ -54,9 +54,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); @@ -65,9 +64,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); diff --git a/fs/crypto/crypto.c b/fs/crypto/crypto.c index 4b076f8daab75..ebfa13cfecb7d 100644 --- a/fs/crypto/crypto.c +++ b/fs/crypto/crypto.c @@ -58,11 +58,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) { @@ -79,12 +79,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) { diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h index 77837e72e4add..11e7187fa2e52 100644 --- a/include/linux/fscrypt.h +++ b/include/linux/fscrypt.h @@ -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 */ -- 2.21.0.593.g511ec345e18-goog From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Biggers Subject: [PATCH 02/13] fscrypt: remove the "write" part of struct fscrypt_ctx Date: Wed, 1 May 2019 15:45:04 -0700 Message-ID: <20190501224515.43059-3-ebiggers@kernel.org> References: <20190501224515.43059-1-ebiggers@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1hLxzQ-0005Tl-JD for linux-f2fs-devel@lists.sourceforge.net; Wed, 01 May 2019 22:46:12 +0000 Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1hLxzP-002XuT-AK for linux-f2fs-devel@lists.sourceforge.net; Wed, 01 May 2019 22:46:12 +0000 In-Reply-To: <20190501224515.43059-1-ebiggers@kernel.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net To: linux-fscrypt@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-mtd@lists.infradead.org, Chandan Rajendra , linux-f2fs-devel@lists.sourceforge.net From: Eric Biggers Now that fscrypt_ctx is not used for writes, remove the 'w' fields. Signed-off-by: Eric Biggers --- fs/crypto/bio.c | 11 +++++------ fs/crypto/crypto.c | 14 +++++++------- include/linux/fscrypt.h | 7 ++----- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c index 9107e8fe55897..548ec6bb569cf 100644 --- a/fs/crypto/bio.c +++ b/fs/crypto/bio.c @@ -54,9 +54,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); @@ -65,9 +64,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); diff --git a/fs/crypto/crypto.c b/fs/crypto/crypto.c index 4b076f8daab75..ebfa13cfecb7d 100644 --- a/fs/crypto/crypto.c +++ b/fs/crypto/crypto.c @@ -58,11 +58,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) { @@ -79,12 +79,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) { diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h index 77837e72e4add..11e7187fa2e52 100644 --- a/include/linux/fscrypt.h +++ b/include/linux/fscrypt.h @@ -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 */ -- 2.21.0.593.g511ec345e18-goog From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88CB7C04AAC for ; Wed, 1 May 2019 22:46:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5A369217D8 for ; Wed, 1 May 2019 22:46:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="k9stBGAz"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="xWesjP6+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5A369217D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=21sKmD44ekjuzHgcrOaVG+pRjiaYyZsaTP+IqcKpzjM=; b=k9stBGAzpQjMFk 0u6nm3cFrWfsNQKMioAGWtBNaSyeao5mVZhmO+fnW45uGc9uCvsyHk/WW64Y8/ofEsyg/jfw13rAH VgGw52WiIxLCQapaP9kUTT+jC6EicF8MoNx2z4W9XVHmvUUSLoSKL+ifcStf2QUbOU0pK2HUZHxm1 tcYv8RRwqPxDNI9COkWnopKXr+MpcJejlC3LvhW6YdtFqiPEqsnSkI3ElE2whp8TLllOPRCLJ7Xkw FU/Py/4zqgd9VHRDAhI/2khERvX/1OO5voh95ZvUV+AtmGVoTfAjYM/0tuD1IdJF79XMZB2Th2kU1 +7ChJset6edrkTiP6QHQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hLxzM-00067r-PY; Wed, 01 May 2019 22:46:08 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hLxzJ-00065J-Um for linux-mtd@lists.infradead.org; Wed, 01 May 2019 22:46:07 +0000 Received: from ebiggers-linuxstation.mtv.corp.google.com (unknown [104.132.1.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7E47A208C3; Wed, 1 May 2019 22:46:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556750765; bh=C8QCwapKW3U1NG9FA0FfajgZX249u2BatzzbutlTbHM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xWesjP6+4N/fUY8sdSJYz9/5AYkoS6EJvOsiD+JWTI+4Os9xkz2f/ugmZtas1Mmma cZUS6psNpUcyFRIqGQ78jdprtiEFiQSiW+CkONgDZ2k3Rz7VaDuyQWfitlNFiyrnYC 0ydXH9LfZ/HI982B1LZzpaIXx4QGiQfYd1iVStUY= From: Eric Biggers To: linux-fscrypt@vger.kernel.org Subject: [PATCH 02/13] fscrypt: remove the "write" part of struct fscrypt_ctx Date: Wed, 1 May 2019 15:45:04 -0700 Message-Id: <20190501224515.43059-3-ebiggers@kernel.org> X-Mailer: git-send-email 2.21.0.593.g511ec345e18-goog In-Reply-To: <20190501224515.43059-1-ebiggers@kernel.org> References: <20190501224515.43059-1-ebiggers@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190501_154606_031403_E7E2CA19 X-CRM114-Status: GOOD ( 12.03 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-mtd@lists.infradead.org, Chandan Rajendra , linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org From: Eric Biggers Now that fscrypt_ctx is not used for writes, remove the 'w' fields. Signed-off-by: Eric Biggers --- fs/crypto/bio.c | 11 +++++------ fs/crypto/crypto.c | 14 +++++++------- include/linux/fscrypt.h | 7 ++----- 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c index 9107e8fe55897..548ec6bb569cf 100644 --- a/fs/crypto/bio.c +++ b/fs/crypto/bio.c @@ -54,9 +54,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); @@ -65,9 +64,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); diff --git a/fs/crypto/crypto.c b/fs/crypto/crypto.c index 4b076f8daab75..ebfa13cfecb7d 100644 --- a/fs/crypto/crypto.c +++ b/fs/crypto/crypto.c @@ -58,11 +58,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) { @@ -79,12 +79,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) { diff --git a/include/linux/fscrypt.h b/include/linux/fscrypt.h index 77837e72e4add..11e7187fa2e52 100644 --- a/include/linux/fscrypt.h +++ b/include/linux/fscrypt.h @@ -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 */ -- 2.21.0.593.g511ec345e18-goog ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/