From patchwork Thu Jan 28 07:11:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052307 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 92044C433DB for ; Thu, 28 Jan 2021 07:15:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2A95264DD8 for ; Thu, 28 Jan 2021 07:15:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A95264DD8 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 AE7E76B0092; Thu, 28 Jan 2021 02:15:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id ABDA66B0093; Thu, 28 Jan 2021 02:15:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9D4226B0095; Thu, 28 Jan 2021 02:15:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0030.hostedemail.com [216.40.44.30]) by kanga.kvack.org (Postfix) with ESMTP id 875C26B0092 for ; Thu, 28 Jan 2021 02:15:58 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 4FF693635 for ; Thu, 28 Jan 2021 07:15:58 +0000 (UTC) X-FDA: 77754324396.09.wire71_2e101752759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id 2AFE2180AD830 for ; Thu, 28 Jan 2021 07:15:58 +0000 (UTC) X-HE-Tag: wire71_2e101752759d X-Filterd-Recvd-Size: 5963 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:15:57 +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=1611818157; x=1643354157; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Y9+Mnjxua+V7f2wybPN6k7Lk3+3v11itMxG4MZ3QMkM=; b=RYXg2a6tiujSNdCyfDN5HjKk52DFYz1SXj5wkeJ+PMsqKT6Wvc4HtMOL yLK1Ru+oj1+NeyMim3sRBmlI6mgTJrGpspicBTgNpUdjaVjM6djLf7arX pHr599vFnXdgv0S/EGiiudT2eXs4VF71I3OCkj8THi8b9le/LZma1Ps2l yarZJL5SEp/XnLzZOKf0m2eRuyy6tAqWhe1Ey5ICY2j5eLsw+IH9Y9fqJ 4e1oBDcQ8QwsM16AT07JsfnM0uzWW/KxZoCVhhKqMIoakBhKo0uaNq13E nIRZOGF35ggRgt1t1T7ET1+mTUF6UF0Sc5UjZQSypOjk8vxJ+wRM/nb/J A==; IronPort-SDR: hFx5e/vYrV3VszYCldFox+90xQNA6IM4GRcPE4nRwiMXnDdOUIScKboqbzLc6dRyzZF1u+J80u MaSep8W2l+dYcCGjcy5+B/7ZOmLW1tE+ccFmcnh6Pdssubui+vtOnCFkoBII3MUdXgloqBmeRn 84r7btc8OFG3CWWCVxa2HCfAG33+Kr0nzHQXCO81Ght+9k65qxE6UW7hQWVMskv58h0PahOGyl wPH7nmeXhy2gGbbR78iFMOOYfR9i07ncw4pX98k/qx5wS9ZjWuNqUEIIp5fDjo+fAYu8Gq6RAf ZEg= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158518465" 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:56 +0800 IronPort-SDR: 8E5oUj4LEy+DUAG6PP7JqJAtuT0kI+zcgEug8FA41AtamdwzhoSwGkJKXCGTXij+3r+b5cZ9xL uIg0uNUN6Gl0mbB+vngZLTujcn5M9AXzqkEblTrI0LptgqMANWRU8f2ZK/76Z9q88th02Nx3L/ 2EoH5WSbgrDqLt1L6isjKe8OTUcjrVWnmckEo3EeCVSVQPUTwYpeLcTy4iOTiSBo5Aabm1y0W+ iKX3ZWKuQFcih3XBgmB9oUwpKwiL/TgegVbuge28e51EzZ0zlWrVE2gbzHx7rD/g6+hDOEwEiN zKkzKFMc+PCdt7wScjh/1kwx 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 23:00:16 -0800 IronPort-SDR: MJghY7CI3VIGR5/IaW1FKfL3TP8YTcGZMlKgwb78Me3B/B/3apRuuzh9zoIBvsafPZo8P1zI7O tvlMLEPWxNEsao+d+OWmeAfzkHQtyrR4CezWVDYJlrvLmf+2864qvNG9WiZqHSu38lUOwqOgWr BwUEJ5wQyzZ3OCyeIORv7uUc6VzLa9ZZ6RiC/IlKAQuXNbiGRl7btRhvnWciISjEw6c6WHvSr7 U7MWRK7LEz7DNkLYA3LIdhi5N4PJW+ftjhgTNZ5eyVeVGIhgT6If8NwOmXnpUTI7IymY6dp08v 5GE= 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:15:56 -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 31/34] iomap: use bio_new in iomap_readpage_actor Date: Wed, 27 Jan 2021 23:11:30 -0800 Message-Id: <20210128071133.60335-32-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/iomap/buffered-io.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 16a1e82e3aeb..08d119b62cf5 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -241,6 +241,9 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data, struct page *page = ctx->cur_page; struct iomap_page *iop = iomap_page_create(inode, page); bool same_page = false, is_contig = false; + struct block_device *bdev = iomap->bdev; + unsigned opf = ctx->rac ? REQ_RAHEAD : 0; + unsigned op = REQ_OP_READ; loff_t orig_pos = pos; unsigned poff, plen; sector_t sector; @@ -285,19 +288,14 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data, if (ctx->rac) /* same as readahead_gfp_mask */ gfp |= __GFP_NORETRY | __GFP_NOWARN; - ctx->bio = bio_alloc(gfp, min(BIO_MAX_PAGES, nr_vecs)); + ctx->bio = bio_new(bdev, sector, op, opf, gfp, nr_vecs); /* * If the bio_alloc fails, try it again for a single page to * avoid having to deal with partial page reads. This emulates * what do_mpage_readpage does. */ if (!ctx->bio) - ctx->bio = bio_alloc(orig_gfp, 1); - ctx->bio->bi_opf = REQ_OP_READ; - if (ctx->rac) - ctx->bio->bi_opf |= REQ_RAHEAD; - ctx->bio->bi_iter.bi_sector = sector; - bio_set_dev(ctx->bio, iomap->bdev); + ctx->bio = bio_new(bdev, sector, op, opf, orig_gfp, 1); ctx->bio->bi_end_io = iomap_read_end_io; }