From patchwork Thu Jan 28 07:11:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052253 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 4338AC433DB for ; Thu, 28 Jan 2021 07:12:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DB73364DCE for ; Thu, 28 Jan 2021 07:12:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DB73364DCE 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 3EDD96B007B; Thu, 28 Jan 2021 02:12:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 39BA96B007D; Thu, 28 Jan 2021 02:12:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 263D26B007E; Thu, 28 Jan 2021 02:12:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0199.hostedemail.com [216.40.44.199]) by kanga.kvack.org (Postfix) with ESMTP id 08C206B007B for ; Thu, 28 Jan 2021 02:12:10 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C544D8249980 for ; Thu, 28 Jan 2021 07:12:09 +0000 (UTC) X-FDA: 77754314778.08.sleep48_580ab9c2759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id 9F1501819E621 for ; Thu, 28 Jan 2021 07:12:09 +0000 (UTC) X-HE-Tag: sleep48_580ab9c2759d X-Filterd-Recvd-Size: 5742 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:12:07 +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=1611817928; x=1643353928; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jUCaPFeDv057fdkiILPSRkCuXPSAzqxSiECC+FKJaMI=; b=pc8+QBXzBiwbZ9gbiWD0mw+OnUAm5yg/VBC1y8ntqAVVshIaTzr9Vbwz gG4aOQx3iHdSmEPX0YH6pjzGLmifiIyKN6YhfSXr5fEULrE6AkKFchwTz BS9NHmtvyyCj3RbNi4Lt7qIKc+tzD+a6TNP5s6wLtbp0c6ZTGGbVorC3+ 7p2KZRcGtr5vvZc0KAMJFPtIL87pfX4Spy1PSQKM/lERX2ewq3XgHmr/T MHb5WfWC9GIMel8QyHr4hM8dZu5lyzYfR7c5GqWKsdGoIiNV6EhfH0+GN Xol2JdBr8BIdwx0JqKgubwo92NC/F4eyJV+h0CfPzIlqhWnTbpyPOQ5fn A==; IronPort-SDR: krN7rtbePNVNjQAriJkXP6FS9WK6ArhIVPB+cHHSVwANVIdybhm1vx/h3jBkkEIGdf81awa2Oh x+QnzhnRjTiEdnIsWGFg1CQb3X8nI/blP9fRZ7R9n5WFwqDMkKUGcopf7/m+UIORiaySvSm55b 17InxMTfXvTEqlnRzmzym6Fr+C+pSgViPcmiqjRp02kvAGUMyQctmfatZQhpLssL37sDEvIrYJ gqjLI6h6VrqRAEpQXWlQ+ZvjYqbdopMyh83Aay4JLBDfLqAkiLiSqz7+dYyMnfkx3IXezsGQCh CE4= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158518029" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Jan 2021 15:12:06 +0800 IronPort-SDR: WNswR5ikoGqaOEK60eMyJNEYabruJ/iGyYE3L7jJSv9Zo8UydWHP2nvjiJcS0fczt6RVniDpKq rBLECI2r1agOSy1y4Bww+ISbFUyFF5LduGPCUZyqAKWDqm3U78u1CXxs/xXbGAzHifts+AfrPJ Dg1JGtL9xVq6E/ANSVZgYFmwzNhy/tBGE/SwCjtAAfZWG9jgRoO89tnAql7MLfJKLU/oB/nKym RvVNElu4iSG3N4fh+7O4wB2KwY84Gju6rH8rR1sbnKQV3xZUItuSwM3SoayZQWNg64j3uGO0oc lGKY5n2cdJPTy4J9XD2gjfwl Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2021 22:54:24 -0800 IronPort-SDR: d5xTirF8Ys37shQjxL90xQdmAvrvSyaDd23k+ldZQk6g8Gmyh3lDvEoGm16xcyp5mSBaZTpxOa PvC1PFp6twA2TpPlG+Ql+/AG65S9RMLgGFawcQCbg9J6k/x2AMPUiKYtsSCC84Z+EGYfmFKoID N3xp6Srvi9c6y+EZp98pFBd59WcY1NGSO1F5aHMorlNIT26uZMyL8pegMXpgjACziNosRf/+TT qFeHE9fwJbeXCBkPpJ7sXhYMSQdfV8ojzZIb3gXAYZT1zkKG2mcOAVOk/sf7gRxWJd9WgQISSA lhk= 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:12:06 -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 03/34] drdb: use bio_new in drdb Date: Wed, 27 Jan 2021 23:11:02 -0800 Message-Id: <20210128071133.60335-4-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 --- drivers/block/drbd/drbd_receiver.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 09c86ef3f0fd..e1cd3427b28b 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -1643,6 +1643,7 @@ int drbd_submit_peer_request(struct drbd_device *device, struct bio *bio; struct page *page = peer_req->pages; sector_t sector = peer_req->i.sector; + struct block_device *bdev = device->ldev->backing_bdev; unsigned data_size = peer_req->i.size; unsigned n_bios = 0; unsigned nr_pages = (data_size + PAGE_SIZE -1) >> PAGE_SHIFT; @@ -1687,15 +1688,12 @@ int drbd_submit_peer_request(struct drbd_device *device, * generated bio, but a bio allocated on behalf of the peer. */ next_bio: - bio = bio_alloc(GFP_NOIO, nr_pages); + bio = bio_new(bdev, sector, op, op_flags, GFP_NOIO, nr_pages); if (!bio) { drbd_err(device, "submit_ee: Allocation of a bio failed (nr_pages=%u)\n", nr_pages); goto fail; } /* > peer_req->i.sector, unless this is the first bio */ - bio->bi_iter.bi_sector = sector; - bio_set_dev(bio, device->ldev->backing_bdev); - bio_set_op_attrs(bio, op, op_flags); bio->bi_private = peer_req; bio->bi_end_io = drbd_peer_request_endio;