From patchwork Fri Apr 12 17:10:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Rajendra X-Patchwork-Id: 1084875 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ext4-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44gktV266Rz9s70 for ; Sat, 13 Apr 2019 03:10:42 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726851AbfDLRKk (ORCPT ); Fri, 12 Apr 2019 13:10:40 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:58532 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726954AbfDLRKk (ORCPT ); Fri, 12 Apr 2019 13:10:40 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3CH8gS8086189 for ; Fri, 12 Apr 2019 13:10:39 -0400 Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.151]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rtxadsbma-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 12 Apr 2019 13:10:39 -0400 Received: from localhost by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 12 Apr 2019 18:10:38 +0100 Received: from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19) by e33.co.us.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 12 Apr 2019 18:10:35 +0100 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x3CHAYWd58327104 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Apr 2019 17:10:34 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E74646A057; Fri, 12 Apr 2019 17:10:33 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 593586A051; Fri, 12 Apr 2019 17:10:30 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.85.82.25]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 12 Apr 2019 17:10:30 +0000 (GMT) From: Chandan Rajendra To: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fscrypt@vger.kernel.org Cc: Chandan Rajendra , tytso@mit.edu, adilger.kernel@dilger.ca, ebiggers@kernel.org, jaegeuk@kernel.org, yuchao0@huawei.com Subject: [RFC PATCH 07/14] Remove the term "bio" from post read processing Date: Fri, 12 Apr 2019 22:40:34 +0530 X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190412171041.31995-1-chandan@linux.ibm.com> References: <20190412171041.31995-1-chandan@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19041217-0036-0000-0000-00000AA7F5FC X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010914; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000284; SDB=6.01188096; UDB=6.00622386; IPR=6.00968863; MB=3.00026412; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-12 17:10:37 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19041217-0037-0000-0000-00004B5D4DF0 Message-Id: <20190412171041.31995-8-chandan@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-12_10:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904120115 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org For block size < page size, apart from handling bios, post read processing needs to handle buffer heads. Hence this commit removes the term "bio" from the identifiers associated with post read processing. Signed-off-by: Chandan Rajendra --- fs/crypto/bio.c | 6 ++-- fs/f2fs/data.c | 10 +++--- fs/mpage.c | 10 +++--- fs/post_read_process.c | 56 +++++++++++++++---------------- fs/verity/verify.c | 6 ++-- include/linux/post_read_process.h | 16 ++++----- 6 files changed, 52 insertions(+), 52 deletions(-) diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c index 3e40d65ae6a8..bab48dfa3765 100644 --- a/fs/crypto/bio.c +++ b/fs/crypto/bio.c @@ -58,12 +58,12 @@ EXPORT_SYMBOL(fscrypt_decrypt_bio); void fscrypt_decrypt_work(struct work_struct *work) { - struct bio_post_read_ctx *ctx = - container_of(work, struct bio_post_read_ctx, work); + struct post_read_ctx *ctx = + container_of(work, struct post_read_ctx, work); fscrypt_decrypt_bio(ctx->bio); - bio_post_read_processing(ctx); + post_read_processing(ctx); } void fscrypt_pullback_bio_page(struct page **page, bool restore) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 2f62244f6d24..f00f018bed27 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -89,10 +89,10 @@ static void __read_end_io(struct bio *bio) #if defined(CONFIG_FS_ENCRYPTION) || defined(CONFIG_FS_VERITY) if (bio->bi_private) { - struct bio_post_read_ctx *ctx; + struct post_read_ctx *ctx; ctx = bio->bi_private; - put_bio_post_read_ctx(ctx); + put_post_read_ctx(ctx); } #endif bio_put(bio); @@ -108,7 +108,7 @@ static void f2fs_read_end_io(struct bio *bio) #if defined(CONFIG_FS_ENCRYPTION) || defined(CONFIG_FS_VERITY) if (!bio->bi_status && bio->bi_private) { - bio_post_read_processing((struct bio_post_read_ctx *)(bio->bi_private)); + post_read_processing((struct post_read_ctx *)(bio->bi_private)); return; } #endif @@ -514,7 +514,7 @@ static struct bio *f2fs_grab_read_bio(struct inode *inode, block_t blkaddr, struct f2fs_sb_info *sbi = F2FS_I_SB(inode); struct bio *bio; #if defined(CONFIG_FS_ENCRYPTION) || defined(CONFIG_FS_VERITY) - struct bio_post_read_ctx *ctx; + struct post_read_ctx *ctx; #endif if (!f2fs_is_valid_blkaddr(sbi, blkaddr, DATA_GENERIC)) return ERR_PTR(-EFAULT); @@ -527,7 +527,7 @@ static struct bio *f2fs_grab_read_bio(struct inode *inode, block_t blkaddr, bio_set_op_attrs(bio, REQ_OP_READ, op_flag); #if defined(CONFIG_FS_ENCRYPTION) || defined(CONFIG_FS_VERITY) - ctx = get_bio_post_read_ctx(inode, bio, first_idx); + ctx = get_post_read_ctx(inode, bio, first_idx); if (IS_ERR(ctx)) { bio_put(bio); return (struct bio *)ctx; diff --git a/fs/mpage.c b/fs/mpage.c index b1fe1afa626e..3c0e484a1d2f 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -56,16 +56,16 @@ static void mpage_end_io(struct bio *bio) #if defined(CONFIG_FS_ENCRYPTION) || defined(CONFIG_FS_VERITY) if (!bio->bi_status && bio->bi_private) { - struct bio_post_read_ctx *ctx; + struct post_read_ctx *ctx; ctx = bio->bi_private; - bio_post_read_processing(ctx); + post_read_processing(ctx); return; } if (bio->bi_private) - put_bio_post_read_ctx((struct bio_post_read_ctx *)(bio->bi_private)); + put_post_read_ctx((struct post_read_ctx *)(bio->bi_private)); #endif bio_for_each_segment_all(bv, bio, i, iter_all) { @@ -328,7 +328,7 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args) alloc_new: if (args->bio == NULL) { #if defined(CONFIG_FS_ENCRYPTION) || defined(CONFIG_FS_VERITY) - struct bio_post_read_ctx *ctx; + struct post_read_ctx *ctx; #endif if (first_hole == blocks_per_page && !(IS_ENCRYPTED(inode) || IS_VERITY(inode))) { @@ -344,7 +344,7 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args) goto confused; #if defined(CONFIG_FS_ENCRYPTION) || defined(CONFIG_FS_VERITY) - ctx = get_bio_post_read_ctx(inode, args->bio, page->index); + ctx = get_post_read_ctx(inode, args->bio, page->index); if (IS_ERR(ctx)) { bio_put(args->bio); args->bio = NULL; diff --git a/fs/post_read_process.c b/fs/post_read_process.c index c408184b671a..f0ec1957a8b3 100644 --- a/fs/post_read_process.c +++ b/fs/post_read_process.c @@ -14,17 +14,17 @@ #define NUM_PREALLOC_POST_READ_CTXS 128 -static struct kmem_cache *bio_post_read_ctx_cache; -static mempool_t *bio_post_read_ctx_pool; +static struct kmem_cache *post_read_ctx_cache; +static mempool_t *post_read_ctx_pool; /* postprocessing steps for read bios */ -enum bio_post_read_step { +enum post_read_step { STEP_INITIAL = 0, STEP_DECRYPT, STEP_VERITY, }; -void end_bio_post_read_processing(struct bio *bio) +void end_post_read_processing(struct bio *bio) { struct page *page; struct bio_vec *bv; @@ -42,12 +42,12 @@ void end_bio_post_read_processing(struct bio *bio) unlock_page(page); } if (bio->bi_private) - put_bio_post_read_ctx(bio->bi_private); + put_post_read_ctx(bio->bi_private); bio_put(bio); } -EXPORT_SYMBOL(end_bio_post_read_processing); +EXPORT_SYMBOL(end_post_read_processing); -void bio_post_read_processing(struct bio_post_read_ctx *ctx) +void post_read_processing(struct post_read_ctx *ctx) { /* * We use different work queues for decryption and for verity because @@ -70,17 +70,17 @@ void bio_post_read_processing(struct bio_post_read_ctx *ctx) ctx->cur_step++; /* fall-through */ default: - end_bio_post_read_processing(ctx->bio); + end_post_read_processing(ctx->bio); } } -EXPORT_SYMBOL(bio_post_read_processing); +EXPORT_SYMBOL(post_read_processing); -struct bio_post_read_ctx *get_bio_post_read_ctx(struct inode *inode, - struct bio *bio, - pgoff_t index) +struct post_read_ctx *get_post_read_ctx(struct inode *inode, + struct bio *bio, + pgoff_t index) { unsigned int post_read_steps = 0; - struct bio_post_read_ctx *ctx = NULL; + struct post_read_ctx *ctx = NULL; if (IS_ENCRYPTED(inode) && S_ISREG(inode->i_mode)) post_read_steps |= 1 << STEP_DECRYPT; @@ -92,7 +92,7 @@ struct bio_post_read_ctx *get_bio_post_read_ctx(struct inode *inode, post_read_steps |= 1 << STEP_VERITY; #endif if (post_read_steps) { - ctx = mempool_alloc(bio_post_read_ctx_pool, GFP_NOFS); + ctx = mempool_alloc(post_read_ctx_pool, GFP_NOFS); if (!ctx) return ERR_PTR(-ENOMEM); ctx->bio = bio; @@ -103,36 +103,36 @@ struct bio_post_read_ctx *get_bio_post_read_ctx(struct inode *inode, } return ctx; } -EXPORT_SYMBOL(get_bio_post_read_ctx); +EXPORT_SYMBOL(get_post_read_ctx); -void put_bio_post_read_ctx(struct bio_post_read_ctx *ctx) +void put_post_read_ctx(struct post_read_ctx *ctx) { - mempool_free(ctx, bio_post_read_ctx_pool); + mempool_free(ctx, post_read_ctx_pool); } -EXPORT_SYMBOL(put_bio_post_read_ctx); +EXPORT_SYMBOL(put_post_read_ctx); -bool bio_post_read_required(struct bio *bio) +bool post_read_required(struct bio *bio) { return bio->bi_private && !bio->bi_status; } -EXPORT_SYMBOL(bio_post_read_required); +EXPORT_SYMBOL(post_read_required); -static int __init bio_init_post_read_processing(void) +static int __init init_post_read_processing(void) { - bio_post_read_ctx_cache = KMEM_CACHE(bio_post_read_ctx, 0); - if (!bio_post_read_ctx_cache) + post_read_ctx_cache = KMEM_CACHE(post_read_ctx, 0); + if (!post_read_ctx_cache) goto fail; - bio_post_read_ctx_pool = + post_read_ctx_pool = mempool_create_slab_pool(NUM_PREALLOC_POST_READ_CTXS, - bio_post_read_ctx_cache); - if (!bio_post_read_ctx_pool) + post_read_ctx_cache); + if (!post_read_ctx_pool) goto fail_free_cache; return 0; fail_free_cache: - kmem_cache_destroy(bio_post_read_ctx_cache); + kmem_cache_destroy(post_read_ctx_cache); fail: return -ENOMEM; } -fs_initcall(bio_init_post_read_processing); +fs_initcall(init_post_read_processing); diff --git a/fs/verity/verify.c b/fs/verity/verify.c index f81d8ff847ec..6cb43c538a3c 100644 --- a/fs/verity/verify.c +++ b/fs/verity/verify.c @@ -287,12 +287,12 @@ EXPORT_SYMBOL_GPL(fsverity_verify_bio); static void fsverity_verify_work(struct work_struct *work) { - struct bio_post_read_ctx *ctx = - container_of(work, struct bio_post_read_ctx, work); + struct post_read_ctx *ctx = + container_of(work, struct post_read_ctx, work); fsverity_verify_bio(ctx->bio); - bio_post_read_processing(ctx); + post_read_processing(ctx); } /** diff --git a/include/linux/post_read_process.h b/include/linux/post_read_process.h index 09e52928f861..523bdecf9252 100644 --- a/include/linux/post_read_process.h +++ b/include/linux/post_read_process.h @@ -2,7 +2,7 @@ #ifndef _POST_READ_PROCESS_H #define _POST_READ_PROCESS_H -struct bio_post_read_ctx { +struct post_read_ctx { struct bio *bio; struct inode *inode; struct work_struct work; @@ -10,12 +10,12 @@ struct bio_post_read_ctx { unsigned int enabled_steps; }; -void end_bio_post_read_processing(struct bio *bio); -void bio_post_read_processing(struct bio_post_read_ctx *ctx); -struct bio_post_read_ctx *get_bio_post_read_ctx(struct inode *inode, - struct bio *bio, - pgoff_t index); -void put_bio_post_read_ctx(struct bio_post_read_ctx *ctx); -bool bio_post_read_required(struct bio *bio); +void end_post_read_processing(struct bio *bio); +void post_read_processing(struct post_read_ctx *ctx); +struct post_read_ctx *get_post_read_ctx(struct inode *inode, + struct bio *bio, + pgoff_t index); +void put_post_read_ctx(struct post_read_ctx *ctx); +bool post_read_required(struct bio *bio); #endif /* _POST_READ_PROCESS_H */