From patchwork Thu Jan 28 07:11:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052273 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=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 D00F6C433E9 for ; Thu, 28 Jan 2021 07:13:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 67BD561492 for ; Thu, 28 Jan 2021 07:13:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 67BD561492 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F0C216B007E; Thu, 28 Jan 2021 02:13:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EE1D96B0080; Thu, 28 Jan 2021 02:13:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA98A6B0083; Thu, 28 Jan 2021 02:13:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0019.hostedemail.com [216.40.44.19]) by kanga.kvack.org (Postfix) with ESMTP id C5FC66B007E for ; Thu, 28 Jan 2021 02:13:48 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 8D28B1F1B for ; Thu, 28 Jan 2021 07:13:48 +0000 (UTC) X-FDA: 77754318936.27.bag27_5311ebe2759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id 6B25A3D66D for ; Thu, 28 Jan 2021 07:13:48 +0000 (UTC) X-HE-Tag: bag27_5311ebe2759d X-Filterd-Recvd-Size: 5703 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:13:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818155; x=1643354155; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ph9rmwEURyYiJjcGgT3e2aApJZNJOSNpUoZqKSV1dx8=; b=ExwFIyxzmQ/UYQM68qMh6Gkvf3hD1PDMBoygoanjtaB22DsrG6hNhrBt CUofJzlbKVcR98l+PlEKOV9N5n3Ly3Ig6LWMFoWlq+izlyl0OU6CopzPd 65eEC3zWwQlIhHuf+RByCHTMmeUNfxjADGCq+YavFMO8ilHjPM/z5Dl3X SC4ZQMTunzWtnxI/xYykCT+YH6Nf3y3Q6he17GRRAUxnDfglUj1XRylTa uKl8FvItTFfoZFzhOnYX++7a3emN+4ZCU+h2qfWs+TMM+T9FhFRXmraEI S0wYiPx4/2En7jehubWox05woqCODPbP0S0vk/AirvXDmuCkEqM1J2aLw Q==; IronPort-SDR: MEHq05Yb48QuUGOFrqdflKz9j8ysUOhq+RAugXSRqfbePssEdOVa0n2Tktt9G3wON8BIv9p1RW Cs1wosZs+kZBS7u2ebqIFrDRf6Vj2bkbbBJozYNeJp0cnBZhWCQ/hDcKY0JusUptKfQ79S5yDB 3xgfNqKv/rRJXb7WyzcxFdXbJr+aV0uZ2Vj9vzkKg6esG70yYyym9P8L9jte/iZcBp1TdiiuzA JByzZkyZJYFupqP+9OdByo5Yj/t6Tek4c0aH4rYAiEGBQEUMkkWkXbJTKDCdrpWQZ+AkJrtDdb F7Y= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="262549023" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Jan 2021 15:15:53 +0800 IronPort-SDR: P0e5xJQfjcxZBg8RFzIQg7eV/a6ukFkmoW9FBf1Ncj8zuRet2AFxqyyXu7kUlC0v7JwinqJ7tY pQKTqc5Lfvw+9mKLTnRA2RXAqCnNmlZ92wIOvTWHacT0Or1KR3GCYf1du5DZ4CI4ueHo4iRe+c yJis6YgjnwRsUu4xJaMOtl5gErr0HAbnDBGvsYULOXjNwnW4wP6oTh+ZsJNzCBMsWQ/HsS6SZd Cx8Ct16IBzSdBSFel5NOkHoNrorZoM0crxjQsIJgjjy+mkjHgeLpavcbFoifo+OjSZz3O16QhN I+uK8LhpvchoT7DFtYDW+/a2 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2021 22:58:06 -0800 IronPort-SDR: 2qgPwD8neR80/SdtH4pRH50bxmDr7msnaiMmu0nET+XLf24Atsm9LH9w2S7p7pMRphnBeo5pVx VOFkyyTuzt5tWdOljMzaLRlQ/2Y+vBgbMl5P6BLyAgHROT8V3ajdo6WQ+YwR34TObygZuUERZX rfU+sPmHgGS1V+3dgxOeo8REERCKgWHIYxzhiuWRBtY6dBheQaeAr6VP4LTAPeLl+kd1iFUoyd mqKwU7dlwbyE4M8F7GURh/yglDYKxcs47wr8oitkT1bgU4EtSPSZoGcLrNM5tqqKQP8I79UW3Y S3E= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:13:46 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 14/34] fs/buffer: use bio_new in submit_bh_wbc Date: Wed, 27 Jan 2021 23:11:13 -0800 Message-Id: <20210128071133.60335-15-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210128071133.60335-1-chaitanya.kulkarni@wdc.com> References: <20210128071133.60335-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- fs/buffer.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index 32647d2011df..fcbea667fa04 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -3023,12 +3023,16 @@ static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, if (test_set_buffer_req(bh) && (op == REQ_OP_WRITE)) clear_buffer_write_io_error(bh); - bio = bio_alloc(GFP_NOIO, 1); + if (buffer_meta(bh)) + op_flags |= REQ_META; + if (buffer_prio(bh)) + op_flags |= REQ_PRIO; + + bio = bio_new(bh->b_bdev, bh->b_blocknr * (bh->b_size >> 9), op, + op_flags, GFP_NOIO, 1); fscrypt_set_bio_crypt_ctx_bh(bio, bh, GFP_NOIO); - bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9); - bio_set_dev(bio, bh->b_bdev); bio->bi_write_hint = write_hint; bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh)); @@ -3037,12 +3041,6 @@ static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, bio->bi_end_io = end_bio_bh_io_sync; bio->bi_private = bh; - if (buffer_meta(bh)) - op_flags |= REQ_META; - if (buffer_prio(bh)) - op_flags |= REQ_PRIO; - bio_set_op_attrs(bio, op, op_flags); - /* Take care of bh's that straddle the end of the device */ guard_bio_eod(bio);