From patchwork Thu Jan 28 07:11:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052163 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 5A26DC433E0 for ; Thu, 28 Jan 2021 07:12:11 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 1261964DD9 for ; Thu, 28 Jan 2021 07:12:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1261964DD9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76569.138191 (Exim 4.92) (envelope-from ) id 1l51T5-0003OJ-Pd; Thu, 28 Jan 2021 07:11:51 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76569.138191; Thu, 28 Jan 2021 07:11:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51T5-0003OB-MH; Thu, 28 Jan 2021 07:11:51 +0000 Received: by outflank-mailman (input) for mailman id 76569; Thu, 28 Jan 2021 07:11:50 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51T4-0003No-KE for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:11:50 +0000 Received: from esa3.hgst.iphmx.com (unknown [216.71.153.141]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id cd66f260-13a4-4693-b98f-d42b9279e01c; Thu, 28 Jan 2021 07:11:48 +0000 (UTC) Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Jan 2021 15:11:47 +0800 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:56:07 -0800 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:11:46 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: cd66f260-13a4-4693-b98f-d42b9279e01c DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611817908; x=1643353908; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eWet3+GOqUNRw+dCyihtl3LTOeV3gTTJDd7Ea4w+clg=; b=iMqWOGYFcU/z4lo7PoOXYZTsAbxO7VKfU3WDTRM+XIro0cg2PZ+UoR0O zOdKL9nsRm6UChk8kvAImXLNrXJuxtg9dlr6ojpj8kID5TkhQqGaQom60 wg25bVcYzhDP0hWBoVNCOqFXxW6GTSHb0yNNXD5+gv5Wkm+LjrW6aYuGx 08xgPmCTvnNHJwhyhDcKS8dTurEhHbjHm85Thosp/DiIXf16omtWeRAg7 NNXUdRg9wKKx0J20ty0i+us+O+79Fvluj55eIdqfCHHNcmbDTN+WC/O/r Pw/Nru94ujijYu/STDWWO3smL5bQcTvzOlXUigAN7uyuGXjOLbWYdODyP Q==; IronPort-SDR: Cg0YySq52S1BuYvbYJA5tV8RN60kOfaJ8QXPIarU8RJmGG3ZSm/zgGgxYXimAfRAR57BaBhNGr eklxNYueuhkztz/2Y53pIGN8qULIrhRgLGXXMPGlwjENBeiZpicXu9PleRFAF5EDK5xsI6HFFu 8TG9KKCq/uYMXasbYK6QEKHI3/w6UReRb5bl4JJboF1ixvE3MVGP9ojTuASPW1PjQGHXqKIKNq TFF0e9aMJlt2AjHUKWh6Hr/xiC6D1AVKrOgP2fTJxoUyl6aj5HEI46V+2is+atUd3Q0NGhKsAA I08= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="162963089" IronPort-SDR: CQ3xngbmWgBCY128PrOjv3YPIhdzR5/rdx7EQv1x+b0HTwFN4ltwdNFQv5FvA1TbS4ULFawWPm kwT2sibF6IG3KiSh+LGFEWCNi2B/00GnBOk4cp/TDLePP49TiHQd8DgSijwnSZiTydgmYgLvYS KcLPasadLharbWJpg07S5Ezzl0RrLkJ3twr/qU043n8xTi/DMptOxbb20eNEECbQEOlfBU4uWd 7NoP/Y4QBbrDoXvqexuZ776uaQPac/TQHhI3PEFF9dMqayERupQaa+CULj8SgwqQ46dfOiCsy0 jENBUexABXv5dcxgCfqU2R3T IronPort-SDR: UO027L+w2LmrSv+r4jHc7V6MfhclxochZ4q/gKoOnHb/alTZT7F9/4KjZrNCZAKJPJHjEl8zjQ btfDHq8ntGB6arYkxikoGObA79gqCi3nJZAFBbpTjKtHzOWqNheZit1SHeKrnOkOlZqda10wHA lKzVa+peWlZiSXNoZnitf2s3YH424/Lf6Od0Q5TvGZLxtIxoLSsxIGie29rcLN/atLab1ULG9S UmjXPLLRWItiporouoLkwAzUh8fELyClcBeyT3S1PWdOuFAmZ6ShYxhRystXSbBeBsPW0LixEL geY= WDCIronportException: Internal 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 01/34] block: move common code into blk_next_bio() Date: Wed, 27 Jan 2021 23:11:00 -0800 Message-Id: <20210128071133.60335-2-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 blk_next_bio() is the central function which allocates the bios for discard, write-same, write-zeroes and zone-mgmt. The initialization of various bio members is duplicated in disacrd, write-same, write-zeores. In this preparation patch we add bdev, sector, op, and opf arguments to the blk_next_bio() to reduce the duplication. In the next patch we introduce bio_new(), this prepration patch allows us to call it inside blk_next_bio(). Signed-off-by: Chaitanya Kulkarni --- block/blk-lib.c | 36 +++++++++++++++--------------------- block/blk-zoned.c | 4 +--- block/blk.h | 5 +++-- 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/block/blk-lib.c b/block/blk-lib.c index 752f9c722062..fb486a0bdb58 100644 --- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -10,7 +10,9 @@ #include "blk.h" -struct bio *blk_next_bio(struct bio *bio, unsigned int nr_pages, gfp_t gfp) +struct bio *blk_next_bio(struct bio *bio, struct block_device *bdev, + sector_t sect, unsigned op, unsigned opf, + unsigned int nr_pages, gfp_t gfp) { struct bio *new = bio_alloc(gfp, nr_pages); @@ -19,6 +21,10 @@ struct bio *blk_next_bio(struct bio *bio, unsigned int nr_pages, gfp_t gfp) submit_bio(bio); } + new->bi_iter.bi_sector = sect; + bio_set_dev(new, bdev); + bio_set_op_attrs(new, op, opf); + return new; } @@ -94,11 +100,7 @@ int __blkdev_issue_discard(struct block_device *bdev, sector_t sector, WARN_ON_ONCE((req_sects << 9) > UINT_MAX); - bio = blk_next_bio(bio, 0, gfp_mask); - bio->bi_iter.bi_sector = sector; - bio_set_dev(bio, bdev); - bio_set_op_attrs(bio, op, 0); - + bio = blk_next_bio(bio, bdev, sector, op, 0, 0, gfp_mask); bio->bi_iter.bi_size = req_sects << 9; sector += req_sects; nr_sects -= req_sects; @@ -168,6 +170,7 @@ static int __blkdev_issue_write_same(struct block_device *bdev, sector_t sector, { struct request_queue *q = bdev_get_queue(bdev); unsigned int max_write_same_sectors; + unsigned int op = REQ_OP_WRITE_SAME; struct bio *bio = *biop; sector_t bs_mask; @@ -188,14 +191,11 @@ static int __blkdev_issue_write_same(struct block_device *bdev, sector_t sector, max_write_same_sectors = bio_allowed_max_sectors(q); while (nr_sects) { - bio = blk_next_bio(bio, 1, gfp_mask); - bio->bi_iter.bi_sector = sector; - bio_set_dev(bio, bdev); + bio = blk_next_bio(bio, bdev, sector, op, 0, 1, gfp_mask); bio->bi_vcnt = 1; bio->bi_io_vec->bv_page = page; bio->bi_io_vec->bv_offset = 0; bio->bi_io_vec->bv_len = bdev_logical_block_size(bdev); - bio_set_op_attrs(bio, REQ_OP_WRITE_SAME, 0); if (nr_sects > max_write_same_sectors) { bio->bi_iter.bi_size = max_write_same_sectors << 9; @@ -249,7 +249,9 @@ static int __blkdev_issue_write_zeroes(struct block_device *bdev, { struct bio *bio = *biop; unsigned int max_write_zeroes_sectors; + unsigned int op = REQ_OP_WRITE_ZEROES; struct request_queue *q = bdev_get_queue(bdev); + unsigned int opf = flags & BLKDEV_ZERO_NOUNMAP ? REQ_NOUNMAP : 0; if (!q) return -ENXIO; @@ -264,13 +266,7 @@ static int __blkdev_issue_write_zeroes(struct block_device *bdev, return -EOPNOTSUPP; while (nr_sects) { - bio = blk_next_bio(bio, 0, gfp_mask); - bio->bi_iter.bi_sector = sector; - bio_set_dev(bio, bdev); - bio->bi_opf = REQ_OP_WRITE_ZEROES; - if (flags & BLKDEV_ZERO_NOUNMAP) - bio->bi_opf |= REQ_NOUNMAP; - + bio = blk_next_bio(bio, bdev, sector, op, opf, 0, gfp_mask); if (nr_sects > max_write_zeroes_sectors) { bio->bi_iter.bi_size = max_write_zeroes_sectors << 9; nr_sects -= max_write_zeroes_sectors; @@ -303,6 +299,7 @@ static int __blkdev_issue_zero_pages(struct block_device *bdev, sector_t sector, sector_t nr_sects, gfp_t gfp_mask, struct bio **biop) { + unsigned int nr_pages = __blkdev_sectors_to_bio_pages(nr_sects); struct request_queue *q = bdev_get_queue(bdev); struct bio *bio = *biop; int bi_size = 0; @@ -315,11 +312,8 @@ static int __blkdev_issue_zero_pages(struct block_device *bdev, return -EPERM; while (nr_sects != 0) { - bio = blk_next_bio(bio, __blkdev_sectors_to_bio_pages(nr_sects), + bio = blk_next_bio(bio, bdev, sector, REQ_OP_WRITE, 0, nr_pages, gfp_mask); - bio->bi_iter.bi_sector = sector; - bio_set_dev(bio, bdev); - bio_set_op_attrs(bio, REQ_OP_WRITE, 0); while (nr_sects != 0) { sz = min((sector_t) PAGE_SIZE, nr_sects << 9); diff --git a/block/blk-zoned.c b/block/blk-zoned.c index 7a68b6e4300c..68e77628348d 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -231,8 +231,7 @@ int blkdev_zone_mgmt(struct block_device *bdev, enum req_opf op, return -EINVAL; while (sector < end_sector) { - bio = blk_next_bio(bio, 0, gfp_mask); - bio_set_dev(bio, bdev); + bio = blk_next_bio(bio, bdev, 0 , op, REQ_SYNC, 0, gfp_mask); /* * Special case for the zone reset operation that reset all @@ -244,7 +243,6 @@ int blkdev_zone_mgmt(struct block_device *bdev, enum req_opf op, break; } - bio->bi_opf = op | REQ_SYNC; bio->bi_iter.bi_sector = sector; sector += zone_sectors; diff --git a/block/blk.h b/block/blk.h index 0198335c5838..0a278bae5478 100644 --- a/block/blk.h +++ b/block/blk.h @@ -329,8 +329,9 @@ extern int blk_iolatency_init(struct request_queue *q); static inline int blk_iolatency_init(struct request_queue *q) { return 0; } #endif -struct bio *blk_next_bio(struct bio *bio, unsigned int nr_pages, gfp_t gfp); - +struct bio *blk_next_bio(struct bio *bio, struct block_device *bdev, + sector_t sect, unsigned op, unsigned opf, + unsigned int nr_pages, gfp_t gfp); #ifdef CONFIG_BLK_DEV_ZONED void blk_queue_free_zone_bitmaps(struct request_queue *q); #else From patchwork Thu Jan 28 07:11:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052165 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 6B45CC433E6 for ; Thu, 28 Jan 2021 07:12:11 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 297A564DDA for ; Thu, 28 Jan 2021 07:12:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 297A564DDA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76571.138202 (Exim 4.92) (envelope-from ) id 1l51TF-0003Si-29; Thu, 28 Jan 2021 07:12:01 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76571.138202; Thu, 28 Jan 2021 07:12:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51TE-0003Sa-V9; Thu, 28 Jan 2021 07:12:00 +0000 Received: by outflank-mailman (input) for mailman id 76571; Thu, 28 Jan 2021 07:11:59 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51TD-0003QU-Ph for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:11:59 +0000 Received: from esa5.hgst.iphmx.com (unknown [216.71.153.144]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 062e1d88-3293-431d-a3c9-ee9f572ce136; Thu, 28 Jan 2021 07:11:58 +0000 (UTC) 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:11:57 +0800 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:15 -0800 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:11:57 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 062e1d88-3293-431d-a3c9-ee9f572ce136 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611817917; x=1643353917; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1Q7huJyMDOVynURh2o3jolV4xRilOq3cl8xkF29/liU=; b=enGvdYf9NC84Zw8fbazQwuF8lHG7Hl7OHG0Djn6p15CQ6sFWQnSTdMIE fTVb2TGE7FlZTfw/GSjjxlF8nlg6qwVG3KwfAiR9/Sb3jbYufvvtcwSDF uRuW2DIRa+wWd+gEg/P94nTH9uFQdCSYAJg82Ys9HYgDM21+absYlbSFy r1Y7ZFsFafQhwTFE0hF4lHuvM4ibWvT1gCpdwtL+fzmm3p6AyJSnMOTyk iCSboWzoGwZ+lY/cihXiZ/SnVrv3xPyB6RsMsbW4QRpoEo6xXdH9RfQFO C26zlsxlQYPVKqFwWyWh1tH/tUYek+t4qaUQZm0ja4Hm/fZDXuHpSEoIA w==; IronPort-SDR: 8/dBKA7g/jbRzCZQg8lJkOc/yY6kSqYaDab+Qwamz43l63acYbyrw55KYd8E88hJ/2S18+xLDx 34HJ1ZzvJbk3iIqM0QLbkVgAV9xf2UGJW0IHCnpFfvc092M5n1y9oe8Yu5ZwMP68v3j4sl1GQD jNYRfiGszaTJeCGQ9wovfl8D5XqpGyxMM2MtP3LpRKmZP+c/8UQgUFCtYNhYNpDb6W9fPYCCRw pi4ninNiqvJ5LLJuvbsMg3pfVxNf3TeDidcPKBNI1f/Qv1spgjuryrUrAa3Dr5s4UuUn4ETXBO Ap4= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158517995" IronPort-SDR: rfQpYOswVNFR2gS5xT3kk1zuVCn6nMX/nrwfivaz/wWQ5oqSiqcBR8y+LbTIOAR1VlKnfwdzCX pgmDoujWGwMsqy8TiKbKr0dZnxwwv7dIc0sgGlsLJkBXZ9WGw0zXPypvaKgWZTxDO8eslsgk6e EEZz3l8yfORjDN6QdKYDQhLJ8/F7XLcCEwJoxAMlQQlDK/cTN3ymDwF20i/2Ux7cobX4NoSCex W2lzL8X+PCJFxvxcVmVSIvT3UIr781Kl0DuO5kZ1Dg/0tSkr0w4SgUfWMLskjEJyF7nEMcj66F 4Q109esZwg0XsCE9Kisw6n8G IronPort-SDR: HYKG8+pmcZ9KZ4KZ0ijEvKFdi7W0dgGDXHFsWIaWNxW3zaOZulAuYVmKBU97gor6eDg6ylP5Ni 6/ahnxe6yM79ewZwsqKvrfMjvqQiAhLVOYCtlxS8Bh1Gz/vhwXPlVRnl4SwtLQD680yYKL86EL o3y724i0cbqHM9ChTIb0swq0MYuYoJx+iwqVjQ/XkVzNSKEtJ8uwRbdybmRUPVMHWHGtPAl98+ IjNd0sVxBZiY+I2eDgAQpiJ9r1dqmBNoZAqnfBCkqleNy/DSVZGKQaXDO89s0wR1FlZS/ZCSSd 5w0= WDCIronportException: Internal 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 02/34] block: introduce and use bio_new Date: Wed, 27 Jan 2021 23:11:01 -0800 Message-Id: <20210128071133.60335-3-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 Introduce bio_new() helper and use it in blk-lib.c to allocate and initialize various non-optional or semi-optional members of the bio along with bio allocation done with bio_alloc(). Here we also calmp the max_bvecs for bio with BIO_MAX_PAGES before we pass to bio_alloc(). Signed-off-by: Chaitanya Kulkarni Signed-off-by: Chaitanya Kulkarni --- block/blk-lib.c | 6 +----- include/linux/bio.h | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/block/blk-lib.c b/block/blk-lib.c index fb486a0bdb58..ec29415f00dd 100644 --- a/block/blk-lib.c +++ b/block/blk-lib.c @@ -14,17 +14,13 @@ struct bio *blk_next_bio(struct bio *bio, struct block_device *bdev, sector_t sect, unsigned op, unsigned opf, unsigned int nr_pages, gfp_t gfp) { - struct bio *new = bio_alloc(gfp, nr_pages); + struct bio *new = bio_new(bdev, sect, op, opf, gfp, nr_pages); if (bio) { bio_chain(bio, new); submit_bio(bio); } - new->bi_iter.bi_sector = sect; - bio_set_dev(new, bdev); - bio_set_op_attrs(new, op, opf); - return new; } diff --git a/include/linux/bio.h b/include/linux/bio.h index c74857cf1252..2a09ba100546 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -826,5 +826,30 @@ static inline void bio_set_polled(struct bio *bio, struct kiocb *kiocb) if (!is_sync_kiocb(kiocb)) bio->bi_opf |= REQ_NOWAIT; } +/** + * bio_new - allcate and initialize new bio + * @bdev: blockdev to issue discard for + * @sector: start sector + * @op: REQ_OP_XXX from enum req_opf + * @op_flags: REQ_XXX from enum req_flag_bits + * @max_bvecs: maximum bvec to be allocated for this bio + * @gfp_mask: memory allocation flags (for bio_alloc) + * + * Description: + * Allocates, initializes common members, and returns a new bio. + */ +static inline struct bio *bio_new(struct block_device *bdev, sector_t sector, + unsigned int op, unsigned int op_flags, + unsigned int max_bvecs, gfp_t gfp_mask) +{ + unsigned nr_bvec = clamp_t(unsigned int, max_bvecs, 0, BIO_MAX_PAGES); + struct bio *bio = bio_alloc(gfp_mask, nr_bvec); + + bio_set_dev(bio, bdev); + bio->bi_iter.bi_sector = sector; + bio_set_op_attrs(bio, op, op_flags); + + return bio; +} #endif /* __LINUX_BIO_H */ 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: 12052169 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 D4333C433E6 for ; Thu, 28 Jan 2021 07:12:20 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 87BF764DD8 for ; Thu, 28 Jan 2021 07:12:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 87BF764DD8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76575.138215 (Exim 4.92) (envelope-from ) id 1l51TQ-0003Yo-C0; Thu, 28 Jan 2021 07:12:12 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76575.138215; Thu, 28 Jan 2021 07:12:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51TQ-0003Yg-8b; Thu, 28 Jan 2021 07:12:12 +0000 Received: by outflank-mailman (input) for mailman id 76575; Thu, 28 Jan 2021 07:12:10 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51TO-0003Y5-JD for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:12:10 +0000 Received: from esa3.hgst.iphmx.com (unknown [216.71.153.141]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id fb547af9-eb84-4c99-bd7d-dbd0c1260015; Thu, 28 Jan 2021 07:12:07 +0000 (UTC) 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 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 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 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: fb547af9-eb84-4c99-bd7d-dbd0c1260015 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611817927; x=1643353927; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jUCaPFeDv057fdkiILPSRkCuXPSAzqxSiECC+FKJaMI=; b=ntzfBVdo6Ba8+2InFSdLXU0jcRosgGQ/a63/Hz8IQ622DjbGi6ZQMeb5 0wyjQLb+5qz92VJsgQeCphIOcfIrq1dm8LAOt39vK6fhnWNivb9YK75D4 +XQ8NZ1GGPJqP6gBu666Jh4pzj5AZqHGrREhSiCYlS4zDSPlBnXjEKUeB q7lyZjlhZcudf/u+Qux/EsAnW29nnheu+5DFtYZO5pqzJ33EBRazOUVOl z7HIVC30EKfUDdWuSCJS4OXDNLip8eUZftDIsVxrefAMX/CzJ7fwztqEL ctLEGmxTt46J/874hseAZ8pqMHCFC4Of1CoWK/g7uh/i7GL3IC8GBXlpM A==; IronPort-SDR: UP/zg7VusFM37PFExVn1lpsq4kLlp3CoWfxlTMD27D9IMap9JPMjj3BqHLRPB+lhnNpe4ZPZbP 8kwCBfy1bf7mfSN2D32EfvowCqLT5okVggOFWWrPUveJvUfo2ymhQgyFGqI05TPCD92y4vSr75 fALAIM5gSbdZIsp6uc3zl1zV5l2mdCubhZENgrGn16ZC5qDqAteab4yNT9YbH6hjreb6ju52Ec Kte8SIp7+3F6DH/KSyCFEw93Y+n8mVTJVePAMS7bKjpoKLtkcT+7reZB++nmq+TBgFusqZ0911 w/o= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="162963116" IronPort-SDR: 8i0j1P+vj7oUgnmWMDCVMmiMi/tvxMOLB6tyoIxd9NRYHDF8m0rKbbA4pVsRUz4VP1lJ+lT5Go Qbip/3H67HbZZkCHJXtATZEq9dxkj6+5cicW4dgr8nxtkKpLqdGUP/JPjhlrQja+jwnqpLfH6W jLnZtjTtevIqirU5Zh+MmvOv9T94JhsbnN+ZOsb76Fi0F+r/WrsGsP3w3V2vQTXscndevNEQvt n5TwssndZ/I8e+lmlx7gVN1pGtAOUBzpPYAacf49GRV7V965p9fdoE5bpiPz6GWg2NyvNx1mOs gZoNjL/SimU8o7q7eDs3+2FX IronPort-SDR: d5xTirF8Ys37shQjxL90xQdmAvrvSyaDd23k+ldZQk6g8Gmyh3lDvEoGm16xcyp5mSBaZTpxOa PvC1PFp6twA2TpPlG+Ql+/AG65S9RMLgGFawcQCbg9J6k/x2AMPUiKYtsSCC84Z+EGYfmFKoID N3xp6Srvi9c6y+EZp98pFBd59WcY1NGSO1F5aHMorlNIT26uZMyL8pegMXpgjACziNosRf/+TT qFeHE9fwJbeXCBkPpJ7sXhYMSQdfV8ojzZIb3gXAYZT1zkKG2mcOAVOk/sf7gRxWJd9WgQISSA lhk= WDCIronportException: Internal 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 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; From patchwork Thu Jan 28 07:11:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052171 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 B8871C433E0 for ; Thu, 28 Jan 2021 07:12:28 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 65C1E64DD6 for ; Thu, 28 Jan 2021 07:12:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 65C1E64DD6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76579.138227 (Exim 4.92) (envelope-from ) id 1l51TY-0003ep-Rx; Thu, 28 Jan 2021 07:12:20 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76579.138227; Thu, 28 Jan 2021 07:12:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51TY-0003eg-Nl; Thu, 28 Jan 2021 07:12:20 +0000 Received: by outflank-mailman (input) for mailman id 76579; Thu, 28 Jan 2021 07:12:19 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51TX-0003e2-GD for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:12:19 +0000 Received: from esa5.hgst.iphmx.com (unknown [216.71.153.144]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 8155d42f-4410-473e-9aec-c33bf1545e19; Thu, 28 Jan 2021 07:12:18 +0000 (UTC) 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:12:16 +0800 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:56:36 -0800 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:16 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 8155d42f-4410-473e-9aec-c33bf1545e19 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611817938; x=1643353938; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=H5WYNiBvrNWIzR/dDsyAI0RzKPxZxlDuB4vWYUDlMrE=; b=nTCJ/jo6Ravq1fP7M7IF2+lgEPjN9ey5djcz2unlL5FDEMGuhD6cUyK8 iZ06mGy8V/A2r5wqd6kLwsj4NrvQH3M979SFcamKcpIUNDj8xiIoiszYY Pp4SC0IDJYmaovKrkiGT0ysPRKU4Z/yORg6PiGVeSWJvJYXhMAh7T17Fm 4zPkDDVJDUv46+d38RVKBko5bzVXPv57ddmlEheqIVlm8JALbDtUXEAI6 v8mbiJQZPF3F/QDXPnMI9qApDMtxSwcEnmlikzusXsyMdudJtTMTTZrQh LOnFcI0J8VdIke4yuH0YDrZuBmrTthOddYocxoa9H//YaHk9BQmJV4avA g==; IronPort-SDR: gdFFU5PZNAYOhnKxNZLzR/eMpHEKmd5S6QzV4b7iDR/oQnrAdr4QVw2tqljSiwQrUgX3C9YccN 3rixqsLpteMciiAzZ823QwdhSvvQZxCEvRF3wk+wvsWkwT9y6v92AFAk1DNzuqn8ZlojCVdDSv 71ObpD8V1BVRqckwnGU2vYGA9iep2DpypMt0BhJGTvqwIwnW+khuntXoHCq7QiCRySRyCR2hAJ dkYuyMwrCWiKHNubJGed7RHDxQgF9ErKvmj1H9AcmwfcYK/E3b3U/VwdGnMBe4/Zt9sB/0I6dl EoA= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158518045" IronPort-SDR: TnX6CdAM0G669YD2/0mFLpB/iYawSSNiP4c9iqDMqX1DZp2e7WWQ+pnV/pFUq+AtYqBpnMTsRT Wp60HApwwH6w5mm2JeZy8nmGENxMsHWw8aec68dB1/c/65vLKBtUz03+jVpm+0B15nx5H1WRKq hfFj0rECp61vKw3Gb2eQTvjRW03bLiSeFBrRbBuic+qFBl450DZstf0FZg+DclUIPeJVfPrCZr cTwGdhS9YMFLzZ9umS/vxFaFCNAa6gXkI1FleVQCUiQGjtzyEBGWD7Af1BZa78h+C2gTPiw7cy h3GHNFwJLNg/0Vd9eG89nC2p IronPort-SDR: sJ1sB4+NIXrk86BqB2mBiNRkLb2CtaUtTUjLUptuVolKqncgiWgms0hBmEnyXBHOe2LGJgTWAc Mtkqx7/Ji/KEF3P2zVgoCc4AZmvUpaw07sB7pwwqNDwBZIjeJgdIawB6xDKz7hKZuinbJ6FPFN v+digmuqEID+qvvg+Pvdb6mLkPbYX8es6TqyRNtA6iTBnQbrstI0JA9CgrvLf0RhQ0DnF83KdI QwpSDAYi/vWthDgyxzldo4sKChZfQfmY/MjRYeTOvpJG4q5JRSujoZAO3KJfZIMHz0OJMVK9L1 YPQ= WDCIronportException: Internal 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 04/34] drdb: use bio_new() in submit_one_flush Date: Wed, 27 Jan 2021 23:11:03 -0800 Message-Id: <20210128071133.60335-5-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 Signed-off-by: Chaitanya Kulkarni --- drivers/block/drbd/drbd_receiver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index e1cd3427b28b..b86bbf725cbd 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -1277,8 +1277,10 @@ static void one_flush_endio(struct bio *bio) static void submit_one_flush(struct drbd_device *device, struct issue_flush_context *ctx) { - struct bio *bio = bio_alloc(GFP_NOIO, 0); + struct block_device *bdev = device->ldev->backing_bdev; + struct bio *bio = bio_new(bdev, 0, REQ_OP_FLUSH, REQ_PREFLUSH, 0, GFP_NOIO); struct one_flush_context *octx = kmalloc(sizeof(*octx), GFP_NOIO); + if (!bio || !octx) { drbd_warn(device, "Could not allocate a bio, CANNOT ISSUE FLUSH\n"); /* FIXME: what else can I do now? disconnecting or detaching @@ -1296,10 +1298,8 @@ static void submit_one_flush(struct drbd_device *device, struct issue_flush_cont octx->device = device; octx->ctx = ctx; - bio_set_dev(bio, device->ldev->backing_bdev); bio->bi_private = octx; bio->bi_end_io = one_flush_endio; - bio->bi_opf = REQ_OP_FLUSH | REQ_PREFLUSH; device->flush_jif = jiffies; set_bit(FLUSH_PENDING, &device->flags); From patchwork Thu Jan 28 07:11:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052173 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 ACF0CC433DB for ; Thu, 28 Jan 2021 07:12:38 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 5F6A061492 for ; Thu, 28 Jan 2021 07:12:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F6A061492 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76582.138239 (Exim 4.92) (envelope-from ) id 1l51Ti-0003lN-9J; Thu, 28 Jan 2021 07:12:30 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76582.138239; Thu, 28 Jan 2021 07:12:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Ti-0003lC-3F; Thu, 28 Jan 2021 07:12:30 +0000 Received: by outflank-mailman (input) for mailman id 76582; Thu, 28 Jan 2021 07:12:28 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Tg-0003e2-T7 for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:12:28 +0000 Received: from esa1.hgst.iphmx.com (unknown [68.232.141.245]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 137ebf97-0169-4203-a9bb-30765848f164; Thu, 28 Jan 2021 07:12:27 +0000 (UTC) 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:12:26 +0800 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:56:46 -0800 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:26 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 137ebf97-0169-4203-a9bb-30765848f164 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611817947; x=1643353947; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yNs/pnE8yDpXGswjvz9qkLYz+CA1dL9+4aNznurTKfw=; b=ABqU0TSLndvxDDWKfL5zVGwpxOOy19qhSPFc5HmUY2mnGdtSaNggSoFg potYzDbECGCx6ycrzIuG7KOMDkzGvkNrD736uvfYR7/CHzHKsmFIhXXLt R5H0LfnZItvqgJmo93KjECDJFniM56JettL6AZYiWC8fbZeZEvb3QeP+5 cwNFNzg58qYJD5QkLPad/Tl47BGOWYVg6sOxN6n/zwR7QkwaoG7BI0nuK 205irqTa5aT9d03xdWv0PbGzP5JNfTnyyFiqDcaUphlvlNKQB/R1AbYMx 2yEf+KSSQefgLUNtP4KtBknKiKXcC+y/zRh6BCE3zlwELA98BuzJxZnGI Q==; IronPort-SDR: Mv1tRe6U/EO5kUv1FeWtqgcDQJUUExtDzrSUhjgk7JAI6KP4Li+dnoI3okQt3nbSq2u4t9K6FE 1DaZwYEXkXOyzofZofWdTGrzJ8X81Q9Z3p3BR2SS3zx7RQWxdp0SDS5/LzX0BDwYTWmOz6aZDn zyYPS2oo+1KuxXeqqS2M9OFa33qC1Vn5pOd1I96fklPxAXFYkXJeYMwV78eRNCCWVI0acQZ23H oMadudcLFsP5L8jXXg+xLhGMM77ewHXj4fTDvhcrYgyVuRgNUP3RmcdDKYVlnekODhsfNf3s/n 2qs= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="268892389" IronPort-SDR: vtLaAN5oc3j+BEPgkSi3uqE78KETxSIhCasFKkZ0GSPc7o8wgtr09TmfI0aiUc0gBQh/j5uCa+ X9719Q3w8GgxS96CvH6IVb+ex1ueRFnBLv4b5V5EFZEuBz3DLfDm3RnGNvSmPB1M3sboUnyDD2 NZOWBEQp9ZfkyS0srDBETR1C4HWz30icYBXxOzN0p7bK866e0v/uvdferIF/9Z1sZ7M6cHcaq5 VxYHMxn08XJEIZlCBMcLYheJL3btw4xO+6a4hw46oLBcAiKKU151Gf5ThOVM/OMCH0gngpchby oCcdFuapDLQyKM07K6WJM1cb IronPort-SDR: AXyfJ+0DzRblLd1C2a8i26F/p5ozSimYWSlSS31hVM9ZD6XicSUM+PrSEKfC1Dird0dpCST4jr RH8MY1sbvDVq5P84PowPihV3IFXmyzQNH7jhgBGPCvDUQHmJMRxTWJczw7haMsXH6G94Is8ChW 3Thpc5BIBnKiKhlT74BApZ+91+Tr+DAOOck7bXVmzNs8yvwHiSmvLe1vToPqpHXLGvuEQ8CHDc wMtFD3vO2n6mQgoI8Yf56mEPo6oNIWF003bHhQMN3DD+ikOw4kJGblAZl7I7M30srcHVxOHbPk wqE= WDCIronportException: Internal 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 05/34] xen-blkback: use bio_new Date: Wed, 27 Jan 2021 23:11:04 -0800 Message-Id: <20210128071133.60335-6-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 Create a wrapper on the tio of the bio_new() named get_new_bio() & use it in the dispatch_rw_block_io(). p Signed-off-by: Chaitanya Kulkarni --- drivers/block/xen-blkback/blkback.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c index 9ebf53903d7b..3760278f0ee6 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c @@ -1174,6 +1174,15 @@ do_block_io_op(struct xen_blkif_ring *ring, unsigned int *eoi_flags) return more_to_do; } + +static struct bio * +get_new_bio(struct phys_req *preq, unsigned int op, unsigned int op_flags, + gfp_t gfp_mask, unsigned int nr_bvec) +{ + return bio_new(preq->bdev, preq->sector_number, op, op_flags, nr_bvec, + gfp_mask); + +} /* * Transmutation of the 'struct blkif_request' to a proper 'struct bio' * and call the 'submit_bio' to pass it to the underlying storage. @@ -1324,16 +1333,14 @@ static int dispatch_rw_block_io(struct xen_blkif_ring *ring, seg[i].offset) == 0)) { int nr_iovecs = min_t(int, (nseg-i), BIO_MAX_PAGES); - bio = bio_alloc(GFP_KERNEL, nr_iovecs); + bio = get_new_bio(&preq, operation, operation_flags, + GFP_KERNEL, nr_iovecs); if (unlikely(bio == NULL)) goto fail_put_bio; biolist[nbio++] = bio; - bio_set_dev(bio, preq.bdev); bio->bi_private = pending_req; bio->bi_end_io = end_block_io_op; - bio->bi_iter.bi_sector = preq.sector_number; - bio_set_op_attrs(bio, operation, operation_flags); } preq.sector_number += seg[i].nsec; @@ -1343,15 +1350,14 @@ static int dispatch_rw_block_io(struct xen_blkif_ring *ring, if (!bio) { BUG_ON(operation_flags != REQ_PREFLUSH); - bio = bio_alloc(GFP_KERNEL, 0); + bio = get_new_bio(&preq, operation, operation_flags, + GFP_KERNEL, 0); if (unlikely(bio == NULL)) goto fail_put_bio; biolist[nbio++] = bio; - bio_set_dev(bio, preq.bdev); bio->bi_private = pending_req; bio->bi_end_io = end_block_io_op; - bio_set_op_attrs(bio, operation, operation_flags); } atomic_set(&pending_req->pendcnt, nbio); From patchwork Thu Jan 28 07:11:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052175 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 56ADFC433DB for ; Thu, 28 Jan 2021 07:12:47 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 F3A7164DCE for ; Thu, 28 Jan 2021 07:12:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F3A7164DCE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76588.138251 (Exim 4.92) (envelope-from ) id 1l51Tr-0003rZ-GF; Thu, 28 Jan 2021 07:12:39 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76588.138251; Thu, 28 Jan 2021 07:12:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Tr-0003rQ-D3; Thu, 28 Jan 2021 07:12:39 +0000 Received: by outflank-mailman (input) for mailman id 76588; Thu, 28 Jan 2021 07:12:38 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Tq-0003qq-5c for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:12:38 +0000 Received: from esa3.hgst.iphmx.com (unknown [216.71.153.141]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 58e0f633-b27f-4e8e-86ad-fd02acf6d291; Thu, 28 Jan 2021 07:12:37 +0000 (UTC) Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Jan 2021 15:12:36 +0800 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:56:56 -0800 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:36 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 58e0f633-b27f-4e8e-86ad-fd02acf6d291 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611817956; x=1643353956; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QAiSNZxQXn+fhhqJHg770cKqGnQ7j5esbXKR/QGBS14=; b=RNtHyDvzb2x/JasSn0QZOEbJpP5zeOlEybaSVBsHNyZvxPZ1mQGM8OeE /mpvvBXQgzPpFvNGZca4WFxZP0t0Uq9vH+64z1pDkKLeawUgvGYHVBfyo 7/4l6mOAmK3q+07LZS3UNYFO3NLprJpMcnFDB+U54SwkA28XzApXFkUYZ MXwA2yx8ggC+K5heZa/s7tie9hxHhrBy0Ex/X3ueF9OrmOTx6Va9IaT/K XBQrAMKSXKuuayq9HAu743O+Pxt6EZGX2RHd1EY+Gcvtf04n0HCcd0MrI HT3904xH+7hIRuFfbGvBaeDIO7YED1Sq4cVHeeSW0GKEfHdRoQBMuJEQ2 w==; IronPort-SDR: kkfh2b6qDZAWIFYtXf668AHkiwL7PBIDCO8UPwmQDjTuaqYiTqcF9nYaGsfvVS91wjyCRHdVpS nX1qTP1HHfffZ1h9GQL5w9W40zsdmB5eG0mvPR1YvlvowbGcV4NtdgtlCUspEjJNIGhFax0l+l 0zGlqwjenESb2s3K4GP47y6DllMSHTshKwSERecfI1N2oCsYknQcna5jrRdSE2rwglnaibdsWd grUc6kkHYSNkd5ctPLZv3H3F7A/Hq6Gsoe6loPQ5dmYO3BA7blvckU8dmaE8Xc6Bb40Y7PGscN clY= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="162963171" IronPort-SDR: FrQsHzGc00ExQMSekcvMaBGoE349MWo/XVecILS7niIoC4AQL01JxBqVXLyWYIETsh9G9vWiyd 4QyQeir0qu5mjPU5L832JHclxPbVGJ4DjxH+3NAC4tOxSyr2eeGtOGfpaMztiaM/OGhc9jqcvq v3a9ZeL+YhwN9DpY6b/5SXk/T39ATO/qwuPhVnvm5gMQ7wjoroiIjHVuRKjTNgdAfwScAVCA7H Py0Dsbb+arES1UqY1GzhLm/fE4j788EQfIxkMcM4D4klkEZ5c6eFBHhLB2vq7/hZ2jSN6Omegf cKqnTfSheVsEwleuxlJlk1tI IronPort-SDR: Luc6lg4Pa+bVHOb4HzkXJiWLGqMg6JC6Nyg0Lqb88ZIBDNylXDUPHvAGuri+ui5nWB8hV8jug9 qFWTXFaOWHAL0oehOyPdERabJ1LaG9aVOt3b6RTgmVCVF9xZaJrmkG+mjzow98LgNG5t1Hjoni gqXmojTILo9AyCGo2PpCozas3remWiyjnR1rz1m7Heq2aoYdQ+f2mWDUtJhIIR3UJyQKknW4V+ XZO06It7hG6XcBrRwkAZf9a8HSkB5bDSC1ddzu75XBYoKVtN9lipurMfP/HgqVuXVuz/kSCAwn InQ= WDCIronportException: Internal 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 06/34] zram: use bio_new Date: Wed, 27 Jan 2021 23:11:05 -0800 Message-Id: <20210128071133.60335-7-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 Signed-off-by: Chaitanya Kulkarni --- drivers/block/zram/zram_drv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index d7018543842e..5d744e528d4f 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -587,12 +587,11 @@ static int read_from_bdev_async(struct zram *zram, struct bio_vec *bvec, { struct bio *bio; - bio = bio_alloc(GFP_ATOMIC, 1); + bio = bio_alloc(zram->bdev, entry * (PAGE_SIZE >> 9), 0, 0, + 1, GFP_ATOMIC); if (!bio) return -ENOMEM; - bio->bi_iter.bi_sector = entry * (PAGE_SIZE >> 9); - bio_set_dev(bio, zram->bdev); if (!bio_add_page(bio, bvec->bv_page, bvec->bv_len, bvec->bv_offset)) { bio_put(bio); return -EIO; From patchwork Thu Jan 28 07:11:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052179 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 C31F6C433E0 for ; Thu, 28 Jan 2021 07:13:06 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 6CC8C64DD8 for ; Thu, 28 Jan 2021 07:13:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6CC8C64DD8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76595.138275 (Exim 4.92) (envelope-from ) id 1l51UA-00042i-2a; Thu, 28 Jan 2021 07:12:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76595.138275; Thu, 28 Jan 2021 07:12:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51U9-00042X-Vq; Thu, 28 Jan 2021 07:12:57 +0000 Received: by outflank-mailman (input) for mailman id 76595; Thu, 28 Jan 2021 07:12:56 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51U8-00040j-DC for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:12:56 +0000 Received: from esa2.hgst.iphmx.com (unknown [68.232.143.124]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 7f087a9c-87f4-413b-9b62-01a83a78ff2f; Thu, 28 Jan 2021 07:12:53 +0000 (UTC) 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:14:21 +0800 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:57:05 -0800 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:45 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7f087a9c-87f4-413b-9b62-01a83a78ff2f DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818074; x=1643354074; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=A6gWT2+anXyYq2Hv6qVI+iojoFiSM9Vb51ZpjBpkhPc=; b=gM/RwNIq1yMz3moNmYY7tIHWnvLEFZi3it25y6vCR8uyG74Ok+VaQrVD dQplJFcYrzQ62nAgkEVt6DyO75+H8w87LM/hbmJYMIFh3+jN7anHpphm5 HoOL77UagK5gxoYb4b0q62/lQCt70KprQ3d83VZBiK2E2MbzXYu+HgSPa dIQn9kWdAN5EwG4um1EkSTVT3aVddLRIdHp2jQYne1FSROA/eQCfhoHbU NQXguNFM+7JTRpTNVkNh1cGH+Fwnk3D7DzNxXVQnAPYN2J/TAknDdjSrQ LvOoq/eE6Q4eyF860CxYDp4dM922/vhVXX/IMx7EX83T79ZT7Hcd6AYV9 w==; IronPort-SDR: VaaR04ggAqFXOyy7jziY6XZn8tZ+eAXmimmP3zvqMO06fWIgMx+2nrQ/OWKG7VJriTxCOKhwzw cEO7jbgMSvCA3dFAMMYasC50xR0nNHEJaAULDaaPpSxTNEA4xIwbcHHY0BD5W/5WoAQjxt0cUN +PqtQSa24rXZJX1fh6TloJ0KSfTfd7m/WHUlpjdLgb9Y2rl8CeN/301piaVc/bSPke2sRvbzPy XmHq6qVkAkXiJRREfXAPLEQj6UKNXK+SDHs74g8xtYB19i630SO5u8pHaLu/gB+4km5MQZHYJq sbw= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="262548934" IronPort-SDR: tHKnkyA5sDjpo439P4+RiOKkzW5Juu1iWfyWNK9QKgTeCwc04rS7dgMt7vhaJpkILwBMpQmfVp gD7zv1Ct3HmK4l7RhTHtJU44dOaJVM6+AUlM3QNnviVFbEKLcvXhtr+NhsSydPXB5oHzKX2uB3 6z7/ykNrnuxV/jiJ6uh+VRlT+eStWQrsiNHInAONKI4ow+4zhF6ey06Yhy9aXw5s1rC72D5Xdq Ho4MNY8172qGVII50yIiSHRFC0CH5LSOR8WDmBETCLN1Y+S3R2vi6y891Cx6XxtEFD/zNGc7w0 jCIPY3RfMEdRwXKeoayd/OkE IronPort-SDR: iX0HhBu+61xFa7EtRWB17G0RFoDdFxtABLHP5yHe733z1qMOeQszsqPYXIq64MFQkReY48/RWk FOClHc2dhNxuRM1QyLpF0KtQrhnCpVvcpPgq0B9OecXrJpCL8UYdCuDWFTL9LdxFS6qWHXh51B DNrP6xQEwjJPm/GL/W/Mv5XtvThzXYCRCRRzvICfBStun4/LN576oOtiFYHwzWMShhTX3BjqKf c8icNJold/1bdh3xf4xqkQcFwP0TJ4M2AqZVo41MRst8Lsv9bfR6qeue7iMnlhLF3vJJuSRBwu WXg= WDCIronportException: Internal 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 07/34] dm: use bio_new in dm-log-writes Date: Wed, 27 Jan 2021 23:11:06 -0800 Message-Id: <20210128071133.60335-8-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 Signed-off-by: Chaitanya Kulkarni --- drivers/md/dm-log-writes.c | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/drivers/md/dm-log-writes.c b/drivers/md/dm-log-writes.c index e3d35c6c9f71..7ca9af407647 100644 --- a/drivers/md/dm-log-writes.c +++ b/drivers/md/dm-log-writes.c @@ -217,18 +217,15 @@ static int write_metadata(struct log_writes_c *lc, void *entry, void *ptr; size_t ret; - bio = bio_alloc(GFP_KERNEL, 1); + bio = bio_new(lc->logdev->bdev, sector, REQ_OP_WRITE, 0, 1, GFP_KERNEL); if (!bio) { DMERR("Couldn't alloc log bio"); goto error; } bio->bi_iter.bi_size = 0; - bio->bi_iter.bi_sector = sector; - bio_set_dev(bio, lc->logdev->bdev); bio->bi_end_io = (sector == WRITE_LOG_SUPER_SECTOR) ? log_end_super : log_end_io; bio->bi_private = lc; - bio_set_op_attrs(bio, REQ_OP_WRITE, 0); page = alloc_page(GFP_KERNEL); if (!page) { @@ -264,7 +261,7 @@ static int write_inline_data(struct log_writes_c *lc, void *entry, size_t entrylen, void *data, size_t datalen, sector_t sector) { - int num_pages, bio_pages, pg_datalen, pg_sectorlen, i; + int num_pages, pg_datalen, pg_sectorlen, i; struct page *page; struct bio *bio; size_t ret; @@ -272,24 +269,21 @@ static int write_inline_data(struct log_writes_c *lc, void *entry, while (datalen) { num_pages = ALIGN(datalen, PAGE_SIZE) >> PAGE_SHIFT; - bio_pages = min(num_pages, BIO_MAX_PAGES); atomic_inc(&lc->io_blocks); - bio = bio_alloc(GFP_KERNEL, bio_pages); + bio = bio_new(lc->logdev->bdev, sector, REQ_OP_WRITE, 0, + num_pages, GFP_KERNEL); if (!bio) { DMERR("Couldn't alloc inline data bio"); goto error; } bio->bi_iter.bi_size = 0; - bio->bi_iter.bi_sector = sector; - bio_set_dev(bio, lc->logdev->bdev); bio->bi_end_io = log_end_io; bio->bi_private = lc; - bio_set_op_attrs(bio, REQ_OP_WRITE, 0); - for (i = 0; i < bio_pages; i++) { + for (i = 0; i < bio->bi_max_vecs; i++) { pg_datalen = min_t(int, datalen, PAGE_SIZE); pg_sectorlen = ALIGN(pg_datalen, lc->sectorsize); @@ -317,7 +311,7 @@ static int write_inline_data(struct log_writes_c *lc, void *entry, } submit_bio(bio); - sector += bio_pages * PAGE_SECTORS; + sector += bio->bi_max_vecs * PAGE_SECTORS; } return 0; error_bio: @@ -364,17 +358,15 @@ static int log_one_block(struct log_writes_c *lc, goto out; atomic_inc(&lc->io_blocks); - bio = bio_alloc(GFP_KERNEL, min(block->vec_cnt, BIO_MAX_PAGES)); + bio = bio_new(lc->logdev->bdev, sector, REQ_OP_WRITE, 0, + block->vec_cnt, GFP_KERNEL); if (!bio) { DMERR("Couldn't alloc log bio"); goto error; } bio->bi_iter.bi_size = 0; - bio->bi_iter.bi_sector = sector; - bio_set_dev(bio, lc->logdev->bdev); bio->bi_end_io = log_end_io; bio->bi_private = lc; - bio_set_op_attrs(bio, REQ_OP_WRITE, 0); for (i = 0; i < block->vec_cnt; i++) { /* @@ -386,17 +378,15 @@ static int log_one_block(struct log_writes_c *lc, if (ret != block->vecs[i].bv_len) { atomic_inc(&lc->io_blocks); submit_bio(bio); - bio = bio_alloc(GFP_KERNEL, min(block->vec_cnt - i, BIO_MAX_PAGES)); + bio = bio_new(lc->logdev->bdev, sector, REQ_OP_WRITE, + 0, block->vec_cnt - i, GFP_KERNEL); if (!bio) { DMERR("Couldn't alloc log bio"); goto error; } bio->bi_iter.bi_size = 0; - bio->bi_iter.bi_sector = sector; - bio_set_dev(bio, lc->logdev->bdev); bio->bi_end_io = log_end_io; bio->bi_private = lc; - bio_set_op_attrs(bio, REQ_OP_WRITE, 0); ret = bio_add_page(bio, block->vecs[i].bv_page, block->vecs[i].bv_len, 0); From patchwork Thu Jan 28 07:11:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052177 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 6FE7DC433DB for ; Thu, 28 Jan 2021 07:13:05 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 2C02061492 for ; Thu, 28 Jan 2021 07:13:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C02061492 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76594.138263 (Exim 4.92) (envelope-from ) id 1l51U8-000410-QG; Thu, 28 Jan 2021 07:12:56 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76594.138263; Thu, 28 Jan 2021 07:12:56 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51U8-00040s-My; Thu, 28 Jan 2021 07:12:56 +0000 Received: by outflank-mailman (input) for mailman id 76594; Thu, 28 Jan 2021 07:12:55 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51U7-0003zD-KJ for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:12:55 +0000 Received: from esa1.hgst.iphmx.com (unknown [68.232.141.245]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 9ff1ad29-a7ab-4c39-8880-191d8951c6ec; Thu, 28 Jan 2021 07:12:54 +0000 (UTC) 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:12:53 +0800 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:57:13 -0800 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:53 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 9ff1ad29-a7ab-4c39-8880-191d8951c6ec DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611817974; x=1643353974; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ebUREFacDD1ljG2MqWB5dUmMjUM91D8UhGi2M79Y0SA=; b=K8jv0v10vzDROlHMAnGu7Z1hdg89hf1NvfWpHccppyK2Qqq3I5FXJ1Zy gb+n9+RaltggaA3QpwfbXvNXVuR1GUTcq1r3FjYZdyayvPZVcvsBNkuYJ 1tHEb4maZhlXtjuPbzNXlJX/f8LHgQLAzc+tw+oHVlHmxnjF+DgsNyO/8 I9u5VSzQ9n0F4RLx3m6GATkO8D+Gn2JVOYPScXahFRsJXCXc9yYEJCfqd Onrnc5Us9clHEj3SglR5XpUbMz89HKdmJAD5eZ2hDhO9gbsiQVBg5Q9+i Xylgo0lOMOOmg4aohszg0cbaoWepQJRFdFuLAUd0BS/21772QKRyQYLtH A==; IronPort-SDR: E1fkX9mALQSpSQRqYGIloGS2cfDW2oPRzPHVlF7jQ7qBQOXa/TDr/IH3wmc6ReYeQENynSr/DV KuvglDqJ2MVpPpj9UNQIh+je/PRWnsuo5rqsq3o3L/GEhxLEarbcYUt7tRCKHmUn/h6vhFeem9 NjVp0pWhNUGvTE0tRSyregZcLO3cMwYt57yD85l4Pqsmh95fxxmB96eqXE4DJhvJZUeEwsMhJQ 65dhOKyqY5H0Swh7RCXOQX0JJOgGUVJ/IPEBQVCoPLpkYNS2PXlWifiT0lwfGI3aPvd+/ej2N9 rLM= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="268892411" IronPort-SDR: JfaHSbgsTX4tBshRNu85zNjDX4JfSgpAalYsa9ganL72RXI+lwj1CvALk7jNkTKHODDRhaPULM 2QCxQBHaDQLKLzzTTJx6sZDUI4QL2z7sj7oWlFeKpkDsPjNz6ohW6OPAT+Fj31fP0Wco69Q5Wb 9KQAR7f3aFnCh6IFqA/U90eJ4ctmO1CHn2o9RL+SRg+TzT0pUU076X0anJZOd6l64DJj/v5S2x FcDy3SpjPUZr3Me2WQqUpbt8A2reaS4klVrZtLnI9YgzishgdQzwaHzWX3zoeLKZHP4K7W5aZI /mFTgzYM+x5E5leio1xLhyRQ IronPort-SDR: PY5y9iQTPaVno0Uv+vDzXalBIBo52CYeNhdpn1c7TxoOle28qWYUG06GBXepBaS7SSBSs9yjco 7juMCiLNAFC5Fl7+86T3v8dT5wViZ/r3nWsFgtnjfanPUZXEs47a6Ez/SVmFCas+uBcEU4K0rz 829GMnmof7Vria8o+CPxuoND3CfaQPgb+QYuf0lvO7BAPoDvQAY10VoO7lep1Qta/l6nA5+vbg ht+uppfjRckOmE5ekZUsc4vMGzhgqqwVxG/dC7eG99G+et4hw+q4h30FxFyz73HjopgItSw/2N PHA= WDCIronportException: Internal 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 08/34] dm-zoned: use bio_new in get_mblock_slow Date: Wed, 27 Jan 2021 23:11:07 -0800 Message-Id: <20210128071133.60335-9-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 Signed-off-by: Chaitanya Kulkarni --- drivers/md/dm-zoned-metadata.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c index 039d17b28938..e6252f48a49c 100644 --- a/drivers/md/dm-zoned-metadata.c +++ b/drivers/md/dm-zoned-metadata.c @@ -550,7 +550,8 @@ static struct dmz_mblock *dmz_get_mblock_slow(struct dmz_metadata *zmd, if (!mblk) return ERR_PTR(-ENOMEM); - bio = bio_alloc(GFP_NOIO, 1); + bio = bio_new(dev->bdev, dmz_blk2sect(block), REQ_OP_READ, + REQ_META | REQ_PRIO, 1, GFP_NOIO); if (!bio) { dmz_free_mblock(zmd, mblk); return ERR_PTR(-ENOMEM); @@ -577,11 +578,8 @@ static struct dmz_mblock *dmz_get_mblock_slow(struct dmz_metadata *zmd, spin_unlock(&zmd->mblk_lock); /* Submit read BIO */ - bio->bi_iter.bi_sector = dmz_blk2sect(block); - bio_set_dev(bio, dev->bdev); bio->bi_private = mblk; bio->bi_end_io = dmz_mblock_bio_end_io; - bio_set_op_attrs(bio, REQ_OP_READ, REQ_META | REQ_PRIO); bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); submit_bio(bio); From patchwork Thu Jan 28 07:11:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052181 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 54669C433E0 for ; Thu, 28 Jan 2021 07:13:13 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 1434564DCE for ; Thu, 28 Jan 2021 07:13:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1434564DCE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76599.138287 (Exim 4.92) (envelope-from ) id 1l51UI-0004AN-I9; Thu, 28 Jan 2021 07:13:06 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76599.138287; Thu, 28 Jan 2021 07:13:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51UI-0004AF-E1; Thu, 28 Jan 2021 07:13:06 +0000 Received: by outflank-mailman (input) for mailman id 76599; Thu, 28 Jan 2021 07:13:04 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51UG-00048y-HN for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:13:04 +0000 Received: from esa3.hgst.iphmx.com (unknown [216.71.153.141]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id db42adc0-1404-41f4-a545-7206404311c3; Thu, 28 Jan 2021 07:13:03 +0000 (UTC) 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:13:02 +0800 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:55:20 -0800 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:02 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: db42adc0-1404-41f4-a545-7206404311c3 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611817983; x=1643353983; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OzcT2XWni+wbNY2uowp8HTdSyU1JsS57dIOzGLP71ak=; b=DCTHmIIs3gw9kivtm1op9LgYX/zeqSVgFsjj2hNMK2fMLuZq9MQHtCJt t0oiq11BdFbk/DXas69rVxIqZuCNmWUmwpDuWf0x8VwTUKtVxaB90TiRi L/ueumxYEhwKh2TrQClHjvx4F834UdICFwe7nVOZYCFsE4X4wguTTfZdh QSqf9oMBvqF95b4wse/GArJtRfIJuC18O3FdPNdjJqWW6RCZBzxD4yNMT 7INZz48bFm2oZF9bqV6NzcPiGpqzWjVVYR64vBmpc1bgTLkjjnfIAWI2r hBZdD1Qor8OQO4k0Ybd5xsqLjZgAlAofvNh6PqJ0okrd0ZlQhrsJVGl19 Q==; IronPort-SDR: /Ehg7W3oO96HmOx7BOpK3IpA5+Q6Y6NIujGptz5FGbcCktNolbiyM0WDYaVrQeYK2NDzqfdOpB eiES1DZtHxFBLCP5yGjDQg2TmN9jZb7kl29SwOZ2q4vk+WYVY0ci/FnSJc/Vrw+TyPAXjy498W awJ5E96c1gb1FBra+MoXD6Ggmnx5qB4vJkiSPOcciYX7NUM9RF3YzktZzeh3MBej09lC0x9qfu h61xgBHS0IDEzh+6oofukF0zbllbB+LcDQk/qOzucr3WQG9wmKlzEeSnj6tZeENlUkl0oCj7i6 Xhs= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="162963196" IronPort-SDR: Ksd/LnIoJ+vsFjCGE8tsOEW2ssFLNYKgKtFW+zEdJnb6jheXsNaO5rq7C6Kw+rR7gylft6icMH +YReDC/JTUTpHxel8AR1WRqSJiG2B1pKhetrt7VRuVSmg5QVOdufPSwwbEzUMDZJ+NwViVtvl/ fSNlkrqdAhpvcDO7ttYJG+K2Yt+vF/+JW3bB1L7VKapGrK3PgNLbCM2QgRFPKM2x2YQ3Ycok+b VI4KBf8NOdKQ/GVu2B00bbycOSgZPx7QhAr+//E0FXXz4DXyinwg/QG/xXzFzV7V9tdTxePKHz SM2XlRlNjpgO7YMRTg4uGJB6 IronPort-SDR: m8MWhLly+Q/ggpFQoQazEvRAK79hMprrsJeibomNIX1/4xtKgak83IDhV3hY33IYYgETWfckla 12cflgJcZOLhtYF332W1ZeqMwkaZsc7uQahEN2f8ydynExvlY4KkvRqWC31LBbVv2+B3KXuSeg s9mXwdZWg1TGYc2w+IbnJALYEzC776WPgdLPtLGdrMUnCNPoz5WeDSYQd/QZ1Y+MzxJurZd/eC 94O7CZ/ZfohxaTfsL58Np58+H9TOWMfDJbBI8BFZ4728SkC4ncTHu1ybMvyhjmP7gPrroYjKqQ UWE= WDCIronportException: Internal 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 09/34] dm-zoned: use bio_new in dmz_write_mblock Date: Wed, 27 Jan 2021 23:11:08 -0800 Message-Id: <20210128071133.60335-10-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 Signed-off-by: Chaitanya Kulkarni --- drivers/md/dm-zoned-metadata.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c index e6252f48a49c..fa0ee732c6e9 100644 --- a/drivers/md/dm-zoned-metadata.c +++ b/drivers/md/dm-zoned-metadata.c @@ -723,7 +723,8 @@ static int dmz_write_mblock(struct dmz_metadata *zmd, struct dmz_mblock *mblk, if (dmz_bdev_is_dying(dev)) return -EIO; - bio = bio_alloc(GFP_NOIO, 1); + bio = bio_new(dev->bdev, dmz_blk2sect(block), REQ_OP_WRITE, + REQ_META | REQ_PRIO, 1, GFP_NOIO); if (!bio) { set_bit(DMZ_META_ERROR, &mblk->state); return -ENOMEM; @@ -731,11 +732,8 @@ static int dmz_write_mblock(struct dmz_metadata *zmd, struct dmz_mblock *mblk, set_bit(DMZ_META_WRITING, &mblk->state); - bio->bi_iter.bi_sector = dmz_blk2sect(block); - bio_set_dev(bio, dev->bdev); bio->bi_private = mblk; bio->bi_end_io = dmz_mblock_bio_end_io; - bio_set_op_attrs(bio, REQ_OP_WRITE, REQ_META | REQ_PRIO); bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); submit_bio(bio); From patchwork Thu Jan 28 07:11:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052183 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 4F637C433E0 for ; Thu, 28 Jan 2021 07:13:25 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 E8C6964DDB for ; Thu, 28 Jan 2021 07:13:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E8C6964DDB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76602.138299 (Exim 4.92) (envelope-from ) id 1l51US-0004Ij-Rh; Thu, 28 Jan 2021 07:13:16 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76602.138299; Thu, 28 Jan 2021 07:13:16 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51US-0004IY-Mj; Thu, 28 Jan 2021 07:13:16 +0000 Received: by outflank-mailman (input) for mailman id 76602; Thu, 28 Jan 2021 07:13:14 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51UQ-0004HS-Ph for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:13:14 +0000 Received: from esa6.hgst.iphmx.com (unknown [216.71.154.45]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id b36a3af8-cf16-4143-a2da-c9522a8f143c; Thu, 28 Jan 2021 07:13:12 +0000 (UTC) Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Jan 2021 15:13:11 +0800 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:55:29 -0800 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:11 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: b36a3af8-cf16-4143-a2da-c9522a8f143c DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611817992; x=1643353992; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Co0rYGelfI2tueL8o6ihJdxL5NS5pM4BZ/hI8135Y8w=; b=Xb0Fwe+1dWPBGptYkuW1jwf0/pZzxPFbd1k2654Y7VdM3NyEvMkmEi+D bsLUjUBzbjPwi0zwkSs6vsj9bYM590MjUObhNIrHJEzgUO8FRa8JxrV1C 8iz17D9kCor6WwcXELJ+G5szdApVOehLDL9LGn8Lkwycnk9mex6Hvp1aX sdk1Wt0t3OK4yrVhczWc+H+G6S2sZT3paqJOOYEDfLSlOH31rMYgafTZB qc195Ao5EorIWWdlOE7IEy+GzXpWO0FO6A5YH+jGEwM9Ys7nb4OZTOUbf CAxD00a3wU73cGuJ4IQLTfjqttOxPMX39gE0XqyhowJVIdxyz+du6BaXR A==; IronPort-SDR: F1mHyW95umCD7a3sFVNmF+qtCvYxKvBQx6aM6py0FlsYazS841A2FT1TjRRiDXQt6e2HptVUDY WlUdRbhH6+bJO/ZL5yrRZAEWyuQII0nmmeVox7VmMDTyZsMav1u42YjXe7qzHbs87/2LdwXenX cVO/bQ6kr00Bx78sZXGIDrxIRYYQU4UezmKrqFxWwUFFf52kiNC6AhOnIWT7OgXCgqyMIfXrit pmbePu98NDmQ4bgl+c+R/NM76dPKe0PcVhunaBwtndktFfJvp4afOI34YTtGmqw3MJ/WmrF08Y aVU= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="159693817" IronPort-SDR: FaQz2V8CERfrk48nsZSBXmkkk+/mcmabB9fTkoyiXUUhqfB7zf2fUdszkQAFqtLVBHvCh+LV2r QG//dfRVhHf2u1EqPeuCc65uFAUTve8TznyVonyWQE8Sf4C39Ir7kMudh6oigcsUN/aeQsdp2q DNFayyEQaOy97P20vJIqx4qyQnIdqxDvdnY9jjPvDbEDsEdWHsWkcHArXmTLKHMpg7v6O5Eu1c kAJlbdXfeTu/TSdGNHuMd7oKwzcEPe34qsnEWngd7kRDZm0CLDd/SUfXJuwAMMt1lDISVOKTvm pgbrJBkopkgS+jFsGs5ELYut IronPort-SDR: B3g2yURiLlkRDJQjiSw5Axb2Dh2vXpaNrKE/QAQl3YC0d9KYF6ZY/2WEGrs8Ad4s6CTMSYijlI As81DRh7fxTUcG6XscFZ0dEUGMxghLXCUSNbFTul1lhg8N84M173b0zoMSc59+C6RPGCZyVbXT e5q9NGchuukS+6n/XolnPl9CgZkf3lpSTdPe2xwj7IsZkLY+Q3H2m4972b6vr4aHe8P7F7VrjW YTjKY9EpCmYYdyolrCzI7bP6MpRPHgjkbRdfoyYEpwC7inxXY41c/i8ke9uNT4EC8+Q8lA/Kgh 6rI= WDCIronportException: Internal 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 10/34] dm-zoned: use bio_new in dmz_rdwr_block Date: Wed, 27 Jan 2021 23:11:09 -0800 Message-Id: <20210128071133.60335-11-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 Signed-off-by: Chaitanya Kulkarni --- drivers/md/dm-zoned-metadata.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c index fa0ee732c6e9..5b5ed5fce2ed 100644 --- a/drivers/md/dm-zoned-metadata.c +++ b/drivers/md/dm-zoned-metadata.c @@ -755,13 +755,11 @@ static int dmz_rdwr_block(struct dmz_dev *dev, int op, if (dmz_bdev_is_dying(dev)) return -EIO; - bio = bio_alloc(GFP_NOIO, 1); + bio = bio_new(dev->bdev, dmz_blk2sect(block), op, + REQ_SYNC | REQ_META | REQ_PRIO, 1, GFP_NOIO); if (!bio) return -ENOMEM; - bio->bi_iter.bi_sector = dmz_blk2sect(block); - bio_set_dev(bio, dev->bdev); - bio_set_op_attrs(bio, op, REQ_SYNC | REQ_META | REQ_PRIO); bio_add_page(bio, page, DMZ_BLOCK_SIZE, 0); ret = submit_bio_wait(bio); bio_put(bio); From patchwork Thu Jan 28 07:11:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052185 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 E48F6C433DB for ; Thu, 28 Jan 2021 07:13:32 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 9DF1164DD6 for ; Thu, 28 Jan 2021 07:13:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9DF1164DD6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76609.138311 (Exim 4.92) (envelope-from ) id 1l51Uc-0004QC-5V; Thu, 28 Jan 2021 07:13:26 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76609.138311; Thu, 28 Jan 2021 07:13:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Uc-0004Q1-0Z; Thu, 28 Jan 2021 07:13:26 +0000 Received: by outflank-mailman (input) for mailman id 76609; Thu, 28 Jan 2021 07:13:25 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Ub-0004PH-CX for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:13:25 +0000 Received: from esa5.hgst.iphmx.com (unknown [216.71.153.144]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 2bff9af5-6690-46e6-b969-e22fddc219a4; Thu, 28 Jan 2021 07:13:24 +0000 (UTC) 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:13:23 +0800 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:55:41 -0800 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:23 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 2bff9af5-6690-46e6-b969-e22fddc219a4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818004; x=1643354004; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=g8HJbcPmpqxtxJgQpVgZEQpuhn8q+oe36W4m3E0vxow=; b=XI0ykKj/3zgNK4sf+v7xp9lq/h6L+2YFPel83iOYaHKerDSqtKOr+24f fa5MlVF00jCXb5UG4SV5lp1cMfen1eryHuczjkB60XCYCSsPdrKXjL6GH 3hcrRhOA6kMe5XWR0x/kiTndQXq3S+VMVi3Fr63rdMzkwCd7ye7KNubKp mckYbemMizhDK1jtXZSrCnrHJjtEqNIls5ba8ZAZqgFtAciV5Hi1jI2rl 2qr0jNty/KqiuY6FzEOynYNDpr1/8PpxGHL4SHgM+FPEkfvQDoljmpFws MxUDS2URF+mWm9ZEsqM6pKEZOMrlpOreqW/9hvJjE2MBDSePRYASFJ7RS Q==; IronPort-SDR: gMMIgLRWoA0kmMJTYcDO81ywU4FXxgKVIiLHY635ulh68Ny8yLx2KvlgWa9bxC26Iv0hG9NxTI RIUKcbtVuIh6ZvJY5Q4sfaavA3J9/NDqwn9VCfu2CXbRpWKGHqZWFxcBElzHpZuY66xTKbRU48 T2M6KLaC0he/At2L1WB9sUEZ7ayAicelEZBTl83dLQeuBHgu+wkbbfYG5kgdJYncXjBpf8v+uM mIjpPu5o7nDusuGm++tqkCutlSZjjOeLQTA6e8H8gXdE9OFfOSHKbBHUZuoOrFP5DQtRg9KgYK tXk= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158518181" IronPort-SDR: EVL53SHQAGGz4+/T8Z4t2naSbYMMVq3mSslAq/C1JOCONexXTaXAF4c20Lz1T0M4kJ9GrWUgYG s41dv4NS6yInfJp/Rrx1MdVSe8hhiKgY9GWKcENFcrxZIyRgkAb+MObGpxOeg7450sG1oURiR9 mieR0493GXlfy7m2jUy0js8gflGaRbSZVVwDKAWL8AlnSCs+OUWC1QGjbMSxylPPyoBMbILk70 FGirdJdeRM4bIZrasMK1ElXb2eadqHB8+yzT6nJWZew8uUiZKPsA09SeroSSF3+U4DL7tkQFPY Gji0Dr29K5Gnd6kFCahsnkeh IronPort-SDR: S7K4kJLXzJBN+TtdhPMN6TP/Dffs+zSa3G/de5+S1/PIJxe5GMDYhILg7ObwZaeQtAx8NJxvkl nIc5LC+mPpv7TI+pptGOuvqvgXc2tzfVFCEyc5+LFgl+ipYQILMS5NCsDr+0Wgl54XSWETlfzh gHkg4ZggWJkUuTGFtq5ayNdqurKZ4tOlkNjJtnTH4tbAn7NSWqg+Ok++T//Bdn23FoUZxk+NbJ AQUU7LKb9NmxAxDMj2VCc1ROkgf8sOKgTR+MW0zxXzuua4VhN6N1CvrlPe6fa6RhDqhXPf7MuT aTA= WDCIronportException: Internal 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 11/34] nvmet: use bio_new in nvmet_bdev_execute_rw Date: Wed, 27 Jan 2021 23:11:10 -0800 Message-Id: <20210128071133.60335-12-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 Signed-off-by: Chaitanya Kulkarni --- drivers/nvme/target/io-cmd-bdev.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/nvme/target/io-cmd-bdev.c b/drivers/nvme/target/io-cmd-bdev.c index bf6e0ac9ad28..f5fd93a796a6 100644 --- a/drivers/nvme/target/io-cmd-bdev.c +++ b/drivers/nvme/target/io-cmd-bdev.c @@ -225,6 +225,7 @@ static int nvmet_bdev_alloc_bip(struct nvmet_req *req, struct bio *bio, static void nvmet_bdev_execute_rw(struct nvmet_req *req) { + struct block_device *bdev = req->ns->bdev; int sg_cnt = req->sg_cnt; struct bio *bio; struct scatterlist *sg; @@ -265,7 +266,7 @@ static void nvmet_bdev_execute_rw(struct nvmet_req *req) } else { bio = bio_alloc(GFP_KERNEL, min(sg_cnt, BIO_MAX_PAGES)); } - bio_set_dev(bio, req->ns->bdev); + bio_set_dev(bio, bdev); bio->bi_iter.bi_sector = sector; bio->bi_private = req; bio->bi_end_io = nvmet_bio_done; @@ -290,11 +291,7 @@ static void nvmet_bdev_execute_rw(struct nvmet_req *req) } } - bio = bio_alloc(GFP_KERNEL, min(sg_cnt, BIO_MAX_PAGES)); - bio_set_dev(bio, req->ns->bdev); - bio->bi_iter.bi_sector = sector; - bio->bi_opf = op; - + bio = bio_new(bdev, sector, op, 0, sg_cnt, GFP_KERNEL); bio_chain(bio, prev); submit_bio(prev); } From patchwork Thu Jan 28 07:11:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052187 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 16C46C433DB for ; Thu, 28 Jan 2021 07:13:43 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 B200F61492 for ; Thu, 28 Jan 2021 07:13:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B200F61492 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76614.138323 (Exim 4.92) (envelope-from ) id 1l51Uk-0004XJ-ED; Thu, 28 Jan 2021 07:13:34 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76614.138323; Thu, 28 Jan 2021 07:13:34 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Uk-0004X8-9j; Thu, 28 Jan 2021 07:13:34 +0000 Received: by outflank-mailman (input) for mailman id 76614; Thu, 28 Jan 2021 07:13:33 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Uj-0004WH-0Q for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:13:33 +0000 Received: from esa1.hgst.iphmx.com (unknown [68.232.141.245]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 745505db-b1a4-4ccc-9537-0981ff37795c; Thu, 28 Jan 2021 07:13:32 +0000 (UTC) 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:13:31 +0800 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:57:51 -0800 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:31 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 745505db-b1a4-4ccc-9537-0981ff37795c DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818012; x=1643354012; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5eayPzy70EKVB5mFbuCcXtyHCS4v72l8k3GegXWivXI=; b=gjv9D3mADvHpA+LqUN1+c+ixsCLpRda/g/1RcAhfbilIGKRQDAKHCy5q 8qLJ55npy8pen8HfkPJIvsE/IWDduVvt0ZQbFzvF8J/ZW8VlJbs8+DSaj eeODw3fBQF+v1N/VjY4G4RT2FyM9hwTs6NnP0vx2IZNpONhNYE2qqJ7Ft PT6F0eD//qfEbTYxdU/yyij8ekped/wOXpmZYzqKaVkNSGGjrKnIXhmMG OhHn95OsvNfyeZNPMsEAcM53OBnkgCMIXCHlZLgRwIb12jcKvUo9HUXbA LcCpcedt2YixJYqSjjS3S33m98UXyiK0d+xB/Lnmn99nLI6C+OD8NnFz5 g==; IronPort-SDR: c0+kqDwrZmCsY9dagEnynkfOF0UdpeUy9AwFFFJWZV+llPbvKJ2rIEFZFnPnPFha2iInk+bTe3 1kZdETF9FL860rv5Yrx18tdT36wjoIRTn6mSj2YmConSrCFcm8WG4i8MPbB/e/aPsmI1neLvJ9 FWD+Md+J3PPpBrwWKQx7b/pN2bO3AF2hH0T3ss3ShU0/f47ScMmtDunAERK0/eXDbpsjaNZxw9 ghMT2CVWFnyc2R0/sJRGH1/podBG/RKyyOmkz4+Ls8t6Ageuunz+eDW4rDUkYVjCJwz9hgz3t3 Mc8= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="268892469" IronPort-SDR: HQeR5anHBqx5KzDK1rlK6ymmz3C1kJ5bsv/Led8WAUkaAplaINN65VwIofvLtef51YL3xanujg yoAxfhfvHV3YUlnp6Ix209i7+A57HZJmI0KlZzmSvuFJEvB11UatlRz1qd25cj1KvwqCNa/GCo meTa82G0EYNkqbVO1NhUS5sB+z0OL0L40R5dO50oqz++00H6v0LfK0UcIxuor75fcWITOljuiC JWANqXLqyQdroUt5vlcLo3jsbv6RzK9LVkoGNP0uhv6mU/ISheL1B6twtKYr36I5Z2gZR/D1dL +NrcMiFjlj+xn++vzI9k8t1K IronPort-SDR: VOVmzSzF+PFJ5cIlwEfer9zopXRJVevtkqTAdV/vkmWi5tqY25x0d3LuGTyYENdxWXzay1z5UI 3lglUXeUdXrgV2kjosRDVsxHgPX3JmYCMkybSp7dVFiY2NtJizGeP3Ns2Zua+ztPSx29L5AtLA s1r4WqMcMEF5NenjfW/yptNoTwylDj+qb8oKvyina3WsNVkg0wovZeJk89NSPRf5yUzOMPXVB7 hd4QqToWmHIoH7o5yPqPfXS+LYwCHRus+XuP8hoEESu425XNxiI+t6Xi0EnlRBN9AYDyemp/IQ NGk= WDCIronportException: Internal 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 12/34] scsi: target/iblock: use bio_new Date: Wed, 27 Jan 2021 23:11:11 -0800 Message-Id: <20210128071133.60335-13-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 Signed-off-by: Chaitanya Kulkarni --- drivers/target/target_core_iblock.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index 8ed93fd205c7..f1264918aee1 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c @@ -379,10 +379,9 @@ iblock_execute_sync_cache(struct se_cmd *cmd) if (immed) target_complete_cmd(cmd, SAM_STAT_GOOD); - bio = bio_alloc(GFP_KERNEL, 0); + bio = bio_new(ib_dev->ibd_bd, 0, REQ_OP_WRITE, REQ_PREFLUSH, 0, + GFP_KERNEL); bio->bi_end_io = iblock_end_io_flush; - bio_set_dev(bio, ib_dev->ibd_bd); - bio->bi_opf = REQ_OP_WRITE | REQ_PREFLUSH; if (!immed) bio->bi_private = cmd; submit_bio(bio); From patchwork Thu Jan 28 07:11:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052189 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 C7D37C433E0 for ; Thu, 28 Jan 2021 07:13:50 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 7F3BF64DCE for ; Thu, 28 Jan 2021 07:13:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7F3BF64DCE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76619.138335 (Exim 4.92) (envelope-from ) id 1l51Ut-0004eS-P9; Thu, 28 Jan 2021 07:13:43 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76619.138335; Thu, 28 Jan 2021 07:13:43 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Ut-0004eI-L6; Thu, 28 Jan 2021 07:13:43 +0000 Received: by outflank-mailman (input) for mailman id 76619; Thu, 28 Jan 2021 07:13:42 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Us-0004at-6x for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:13:42 +0000 Received: from esa6.hgst.iphmx.com (unknown [216.71.154.45]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 85411200-e327-4b7f-a61d-050bada68c6b; Thu, 28 Jan 2021 07:13:39 +0000 (UTC) Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Jan 2021 15:13:38 +0800 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:55:56 -0800 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:38 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 85411200-e327-4b7f-a61d-050bada68c6b DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818019; x=1643354019; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OdHsUuhLqy4MrzmNdd/tdpH4dcVzXnQrrHk/wuqLVYg=; b=BmcUjl2e66oFnSa18MPNVGlB/flKPZ+C9X/e27m609RMD6t4EEHkLQvS ihTY/41u+4v8g5AgvKg5QTRxjluYE4xvKMI5B2XTEP1oqo/M+sYQCS91n Y/huMQPesj9CKY+W2icBSGBWAb3lWOEWy8V+02A3a6ez+aOEt+fHLeYOh DGePOZllzlDtHTetWOWpMjD753bxWA48wdbjhWIFnc7nL6FRG99jZ3iG4 krm8v3Mx1/2lhg6DzR9Bk8qdbXDWolxSBQ61tEXWT4Gl57X4bSaKDova8 wqrabiM8qBHRKwl1/ZNrjmCIRJ3z0qFn+7a6cpPxBNHsbPplVfJqvBxCY w==; IronPort-SDR: 9tB28j1q+nnIPuDB5wePPnLsv+Mo5WRek8Uh+zU5su/oJexnaAaYu9yPRqaho091YftwlpUJBE PhX3rQffvkggnbazPvdbC5aZXrUJ9S/WG8zbB/hC8pka+zkamLggTJ9gcgMB5qVM7byIp5uUmq AV72Hii6/Ui/705IHx5ZpKWsbcumeu3J/exRk4/yPggJGQE9Le6tDjfAAy5ssecXCn+T+6pyVG TzzfTaxKw4oYrKb8ZwUCxT8YmZ3SK4zk1jie//PSY05+/j626pRwX1fxsoZ0fYyF+DujVimOrj j2s= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="159693858" IronPort-SDR: fmFECU/ozojdAGO4TaFB94S6o/akCQP5Na+pHyxekpThs8wHDa8O2Ehtmi0q7ax0Igbtiu0Shv nE/wwFwlPEksS13Rys+8U5cq8zVV5nlEkhVhIvYArOA9IVZ/2JwX6yjmECTimHfDVRAp/5Ehgi +QoVQbFDbkMq1PIsbaFhPwknOvaTq8yVEhifj8Re8s2LfMiLd2XTIohDt387FZP1fY+9ywMFbs yo7QaRE7MYJ8czE4PCNOYkpFvU3PMlN+24Sx17iDATDVngu8lqKN/8D9Sn46Wu6Z3sGmIxNPG/ vesTxhe1MXqN0GNI+/HLzYtH IronPort-SDR: Soam0z/hZs1yuoqW7i6jx5roOoHAapZwcG8+RboeMSicIzBmOYiX0n71yThGE0I1AnlhuM1di0 VAe/ab59Zj3d54HqeQwwCvYowNBZyfmch3v7Oy4azaqst0BpJQIg4rXG9R5IU/X7180i4BamQI Pdm6cEOWuqZT053sZGwqRvhtwriLsaGVJTX83nQ+r2PwZZdfIXxXkXEJoScfk1suUPevohY8gp ghp78Zzi9GkjGDnNvz6HqiAkBvVb/9awaEDn2T+13/9ul6gQjwyqb4x2IkJNU2l4rR1clxPnay 0k0= WDCIronportException: Internal 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 13/34] block: use bio_new in __blkdev_direct_IO Date: Wed, 27 Jan 2021 23:11:12 -0800 Message-Id: <20210128071133.60335-14-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 Signed-off-by: Chaitanya Kulkarni --- fs/block_dev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 9d4b1a884d76..f3e3247894d7 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -367,6 +367,8 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) return -EINVAL; bio = bio_alloc_bioset(GFP_KERNEL, nr_pages, &blkdev_dio_pool); + bio_set_dev(bio, bdev); + bio->bi_iter.bi_sector = pos >> 9; dio = container_of(bio, struct blkdev_dio, bio); dio->is_sync = is_sync = is_sync_kiocb(iocb); @@ -389,8 +391,6 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) blk_start_plug(&plug); for (;;) { - bio_set_dev(bio, bdev); - bio->bi_iter.bi_sector = pos >> 9; bio->bi_write_hint = iocb->ki_hint; bio->bi_private = dio; bio->bi_end_io = blkdev_bio_end_io; @@ -446,7 +446,7 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) } submit_bio(bio); - bio = bio_alloc(GFP_KERNEL, nr_pages); + bio = bio_new(bdev, pos >> 9, 0, 0, nr_pages, GFP_KERNEL); } if (!is_poll) 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: 12052191 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 91C46C433E0 for ; Thu, 28 Jan 2021 07:14:00 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 5D0B961492 for ; Thu, 28 Jan 2021 07:14:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D0B961492 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76623.138347 (Exim 4.92) (envelope-from ) id 1l51V2-0004lW-8s; Thu, 28 Jan 2021 07:13:52 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76623.138347; Thu, 28 Jan 2021 07:13:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51V2-0004lO-57; Thu, 28 Jan 2021 07:13:52 +0000 Received: by outflank-mailman (input) for mailman id 76623; Thu, 28 Jan 2021 07:13:51 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51V1-0004at-4b for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:13:51 +0000 Received: from esa4.hgst.iphmx.com (unknown [216.71.154.42]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 9b0a8e08-2d3e-432f-a1e1-97912fa5dfcc; Thu, 28 Jan 2021 07:13:47 +0000 (UTC) Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Jan 2021 15:13:46 +0800 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:56:04 -0800 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 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 9b0a8e08-2d3e-432f-a1e1-97912fa5dfcc DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818027; x=1643354027; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ph9rmwEURyYiJjcGgT3e2aApJZNJOSNpUoZqKSV1dx8=; b=R0H0BBlYwokmIFrBez2p9fEC8db94MCPractRJhmKSgF/0N/EwjucYDp eInEL+qyXGnxxTG86wUtt/iEWKav4ntKme4SwWqQA4xGYtFSXhfQ04MxW XXeP/JbbboWTFmyOgcplJH7RHIyoQ1LZI8c5yO/EMTkEIZL2MpHiripYl s4UZ8Eemx2yAV7seL0AUPeyVJbhHX8kgU87L3h3OYpZcIbWRJyLRq1Oue 746ki6pS2w1WTulu1CS4W6DwGVSyHr7vAGiAatIBAiYVoCvGBirxusRFh elZDMhiH/HYtyOToZZ3FiA8wvn9KhpVlfJ7Lb2OK8RdpTD1tLAp+55gUz Q==; IronPort-SDR: PxkB4tEb6SkklkQyJOvN1E/naXNRiNQ3w+3MQVtLtM9nnLJ80dbI+U2blbAUCc97CWeIrJ2YCA biozTuAQqsxKBa177I2FJ044CYNks2OUMpmxfXSHmjZNlEWJHRuABXLuEzpOXsl2/tsEiUZWgF TClexH1InSBvi7yc8VK0QNv8Bn+k9Xs14OjKP5cvyd+5vv+iONmnvHYzgUiSIxVWRmqBhm6A+z eoSM3ogiIMr44jZr/GgH4de1y4DiI8gwGHCsdXC3LE5ukPGRNdVrfoLu9W1a7Q2mqdVF1CU1/o 808= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158517361" IronPort-SDR: LikeUj7PUk3ZLLpc6Px6qO01HqC1wlvZZzrPY7ZnZhHS4w+tCONfQJ+C7YfrTFndxX6zHW701m uXH8Ec+SdAgbEtSwMH5U9R1ttunpWEL+zdgq53HlP7ORRwCetLMMo4J+lv/6fc4rIg6e69PRT+ ZyLqDvhyJE5IUdrq/ZQdKQH1vVHd8Tahx2MUuVziV5zEb4dvc0i6/jOLg1fPJa1DPKyR7HQ4hc zfFZLR6r5pmRF36OyGY/413rw6Aua0a/7RlI2P7jMF0gJ+nwo8MogZ/qRcGExCm6IzLXv8Qf2G jJbi+lLsafIAyOsJhpORr9Go IronPort-SDR: 2qgPwD8neR80/SdtH4pRH50bxmDr7msnaiMmu0nET+XLf24Atsm9LH9w2S7p7pMRphnBeo5pVx VOFkyyTuzt5tWdOljMzaLRlQ/2Y+vBgbMl5P6BLyAgHROT8V3ajdo6WQ+YwR34TObygZuUERZX rfU+sPmHgGS1V+3dgxOeo8REERCKgWHIYxzhiuWRBtY6dBheQaeAr6VP4LTAPeLl+kd1iFUoyd mqKwU7dlwbyE4M8F7GURh/yglDYKxcs47wr8oitkT1bgU4EtSPSZoGcLrNM5tqqKQP8I79UW3Y S3E= WDCIronportException: Internal 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 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); From patchwork Thu Jan 28 07:11:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052193 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 7E0EEC433E6 for ; Thu, 28 Jan 2021 07:14:05 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 2DFE561492 for ; Thu, 28 Jan 2021 07:14:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2DFE561492 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76625.138359 (Exim 4.92) (envelope-from ) id 1l51V7-0004qc-Ix; Thu, 28 Jan 2021 07:13:57 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76625.138359; Thu, 28 Jan 2021 07:13:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51V7-0004qR-EI; Thu, 28 Jan 2021 07:13:57 +0000 Received: by outflank-mailman (input) for mailman id 76625; Thu, 28 Jan 2021 07:13:56 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51V5-0004pI-VL for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:13:55 +0000 Received: from esa2.hgst.iphmx.com (unknown [68.232.143.124]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id a2d2eb70-8fc1-4b20-a3bd-ce1efdabf817; Thu, 28 Jan 2021 07:13:55 +0000 (UTC) Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Jan 2021 15:16:05 +0800 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:56:12 -0800 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:54 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a2d2eb70-8fc1-4b20-a3bd-ce1efdabf817 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818166; x=1643354166; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wUwjN0vBouMAu1m5itQWMc9ceGIiyWjYqyXKNeHEsnQ=; b=nxzJflacH2hbguCGRxCBP9wduYQ3myDzwmPyGdPjQhY6sNVghRPXRdjj ikYM3FqSQvPqimwtOSoO2oHA9krYU8WLH1VbZhvIfVvxqB0VIbnWt4OO3 LW7g5jCWJc7ZeTc0MqfI1dqccsxWNf8I6Oura1JvK8zN1P8yKik8cR+OT f6dwbGrduhi1BWQPyvGXXvhpiIW4yaaL7S9zUQvg0q0cnP2e0VVPuUHdG VnBWfnBrD4AEYV0zSYCnsEOlzQqe4EhIRoLV+6L1B172B43ZNFS//4/TA HIZM/XqVX+pX/lpJcRccqkVnWG1WwsfGXFyUOBT8pzMLENyY84OyQCD87 g==; IronPort-SDR: L9JRq0irKBoR/immUwJJk5MAs79tfhm5a9Nf0efAIcPDlTWveGHJ1lZLroh43J2FSFGVYhLuhG oYHLx3uTX3J8HyT3w+d/qPY4qa9SvOceJ9gjDmjIEh5JLNq8SPyInqvXWdr88m/x9SDGkSjU/x onDlSBVGOTHEwYLuE74oVLzY5nburvJWzJlGjrwxFk3HE40Tn5W9zfy6Df1PpWlI7ekUr+6g+A FtDXuzjsF1UVZ6BG4pFzlAlOcUgT3FImkJvb8ZFLF6XA2aybNi4OSY50Xs/eHJvkAn/YsTUWeU Kpc= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="262549028" IronPort-SDR: bbV/rPEQomMPAyAfzgt/2nDhxQWlkmrixit6zLlYOAQKuYlEsk3dczL1e+4hLz3d5mute5trpt GHvoWPb0+lwuypKor8ukIqoBxcISsuxQA9D/TnsL5Zh2Gfx+oMHDcNF3HurIpxAKrFTKDdG7NH s0tuyuxfapfZock6Yr+n+Jx2miiyehTBngrvuy40asxV2TThbBDwqDkTW/oth+sZQSc9bTisDn IHJaAge3kVg3MpcirmZJcV1wwp3oSVVVBdcEtR/P5C1dYJhvpxutOGX5r1UBMSNpJs4P69nybI XSThmT0YoiKtEkYRtsXeExK6 IronPort-SDR: pB2cXSth9j9iO8qI9kro9aUnzxe7uC+CM4R5ezhi5mkNe3QJ3MeSZh+GGUOxW9ROBr/hgtgk35 3kQYC2KUTB+4qbQnoUg89GyqXiUICL6Lbb6/fLgPHrp+IuvY60iwR3VPtR6IrHib1STZYvjFII G0U9LFUNwbOn5ju9S5MOKHMAKhFoQxnYNKdJKA68HgaqnFN4j9YRc5HgIY3H1XVVcQBHwY13od d8yfo6WXgScVxvO/+aDCj5bBUi8Qq8LHMuAKgJFuukK9k/tSzy9sPaWEv7Xl8jluo8DC44HSzF bXE= WDCIronportException: Internal 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 15/34] fscrypt: use bio_new in fscrypt_zeroout_range Date: Wed, 27 Jan 2021 23:11:14 -0800 Message-Id: <20210128071133.60335-16-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 Signed-off-by: Chaitanya Kulkarni --- fs/crypto/bio.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c index b048a0e38516..20dab9bdf098 100644 --- a/fs/crypto/bio.c +++ b/fs/crypto/bio.c @@ -148,12 +148,11 @@ int fscrypt_zeroout_range(const struct inode *inode, pgoff_t lblk, return -EINVAL; /* This always succeeds since __GFP_DIRECT_RECLAIM is set. */ - bio = bio_alloc(GFP_NOFS, nr_pages); + bio = bio_alloc(inode->i_sb->s_bdev, 0, REQ_OP_WRITE, 0, nr_pages, + GFP_NOFS); do { - bio_set_dev(bio, inode->i_sb->s_bdev); bio->bi_iter.bi_sector = pblk << (blockbits - 9); - bio_set_op_attrs(bio, REQ_OP_WRITE, 0); i = 0; offset = 0; From patchwork Thu Jan 28 07:11:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052195 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 65EA6C433DB for ; Thu, 28 Jan 2021 07:14:16 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 31EF361492 for ; Thu, 28 Jan 2021 07:14:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 31EF361492 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76630.138371 (Exim 4.92) (envelope-from ) id 1l51VH-00050W-TL; Thu, 28 Jan 2021 07:14:07 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76630.138371; Thu, 28 Jan 2021 07:14:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51VH-00050H-PD; Thu, 28 Jan 2021 07:14:07 +0000 Received: by outflank-mailman (input) for mailman id 76630; Thu, 28 Jan 2021 07:14:06 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51VG-0004at-55 for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:14:06 +0000 Received: from esa6.hgst.iphmx.com (unknown [216.71.154.45]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 38a5af84-08f1-40a3-a2bf-279b83347813; Thu, 28 Jan 2021 07:14:03 +0000 (UTC) Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Jan 2021 15:14:03 +0800 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:56:20 -0800 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:14:02 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 38a5af84-08f1-40a3-a2bf-279b83347813 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818043; x=1643354043; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+nCtEeEc6ftLNfXULXJD9MfOSjGF3wrLBEXOv9oezHI=; b=mGMHMACVYdi5FiLtGjJiyXx6tYott3zQopn4qTNBqtOG7JuQ2trtio0O 9aUONhKGZkoO5i0NgCH96neygJdAFv4CT7cIyRIw0xwdBfpzVWcqemvPA xbZTxuruuZjfnRzHoz0Tk4cdeyj+jqwW3U/qqhf11t2OToho4vVzRd2bx zKd8EmnhWqkhMSzVDsmvUdO4mExjkBF1NZyuee6JPZNukp6BlYDmwNyWp 3O3jkCGKmOKR5IYHS9qkyeHfuLASbOdBcpKLzGZ2oAy+z0AzWMaafYaeB hsV/xvUmeFQ9I1IOiOldMW+i31fRKH38Y4R5v6YdEGpTrqnS04wiGBPc8 g==; IronPort-SDR: WffcUY7bvyf0WjRpF8NVaETUrcT9JdLXbdh9tHv7drXZroN96+svLlrLd+0a0rWnxHQ065JZMS KfNc1dL7Z8OwqmLsBjJL0WKVemzGJv6ZOi8PrrSSEXJyXBPybU4MfpAROj6LvlHpktxrIZQUpY Cb1h/rGWTXB0JnosNca8qc8Vfz+bCQKnn6hkvC7/zECT9+VPROmi4ktOYMRKR3vrp3/O31181p 9AHI4h/Hvq5XOaQl7H/9ivEZ7R60mTcJ9yQIWApadU7bLv9wnkRHPIIwzL75B/ooAz1hi2jsfH 43c= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="159693891" IronPort-SDR: BrWFwASdanTfo/yZF9eDLHp1M6QnBBw0rAdQgsB968atZAgRzuAT2HRxDGPaRPxF/4uC/oRssP /87zsVdKOxiG+JKJn7qJn9ZZ6UdnxvgE9xGVF8zXFWDjO8mh1KvlfO7boSfHIW84/xXdvxudgM SdindsHdU0BDrt08w0WWbE1V4occ4a9j28wvGFF6i8+T2ql0SglwySk8Q9O1+FuK01SUtc4lW3 cx+beVEpwlrsn45ABAROEqeHuDxkqEheshirncNHBUXqZcX9mfTFNUucD5cqFJGCiW/IncYv+U pzfjstKUT4tY2mVsi/Pmj8m+ IronPort-SDR: bKh0CeniWKxunCNm+jG9l29yuZPN3D1Gz/JAN/nXUgFIRD0d9U6vumFzntseHSRI/MX2HRMaPA UMPAuzQRLKKctTclKUM2aKzz/TiMAXwUZH3o+WrBdocCIchNR3Uaqkot1vGRPosruVN9zghU/S 4vOkqxWogelsFgsfoTKuGHPXS0UKS78L+4719OXJlLRXt4xtaxkQvpBhG3tmxGAdTiSRUPHfPH NMPtpPqqTRUN1CMc8PtnqpeNKU9vUEZxV6F3t4AwWzk79mqUHtn9Cp1IEV7L86NNsrAMFQsKWR ljI= WDCIronportException: Internal 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 16/34] fs/direct-io: use bio_new in dio_bio_alloc Date: Wed, 27 Jan 2021 23:11:15 -0800 Message-Id: <20210128071133.60335-17-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 Signed-off-by: Chaitanya Kulkarni --- fs/crypto/bio.c | 2 +- fs/direct-io.c | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c index 20dab9bdf098..28cd62ce853e 100644 --- a/fs/crypto/bio.c +++ b/fs/crypto/bio.c @@ -148,7 +148,7 @@ int fscrypt_zeroout_range(const struct inode *inode, pgoff_t lblk, return -EINVAL; /* This always succeeds since __GFP_DIRECT_RECLAIM is set. */ - bio = bio_alloc(inode->i_sb->s_bdev, 0, REQ_OP_WRITE, 0, nr_pages, + bio = bio_new(inode->i_sb->s_bdev, 0, REQ_OP_WRITE, 0, nr_pages, GFP_NOFS); do { diff --git a/fs/direct-io.c b/fs/direct-io.c index aa1083ecd623..6aab1bd167bc 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -397,11 +397,9 @@ dio_bio_alloc(struct dio *dio, struct dio_submit *sdio, * bio_alloc() is guaranteed to return a bio when allowed to sleep and * we request a valid number of vectors. */ - bio = bio_alloc(GFP_KERNEL, nr_vecs); + bio = bio_new(bdev, first_sector, dio->op, dio->op_flags, nr_vecs, + GFP_KERNEL); - bio_set_dev(bio, bdev); - bio->bi_iter.bi_sector = first_sector; - bio_set_op_attrs(bio, dio->op, dio->op_flags); if (dio->is_async) bio->bi_end_io = dio_bio_end_aio; else From patchwork Thu Jan 28 07:11:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052197 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 798F3C433E0 for ; Thu, 28 Jan 2021 07:14:28 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 449A164DCE for ; Thu, 28 Jan 2021 07:14:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 449A164DCE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76635.138383 (Exim 4.92) (envelope-from ) id 1l51VS-00058P-6k; Thu, 28 Jan 2021 07:14:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76635.138383; Thu, 28 Jan 2021 07:14:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51VS-00058F-30; Thu, 28 Jan 2021 07:14:18 +0000 Received: by outflank-mailman (input) for mailman id 76635; Thu, 28 Jan 2021 07:14:16 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51VQ-0004at-5K for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:14:16 +0000 Received: from esa4.hgst.iphmx.com (unknown [216.71.154.42]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id c8ca2039-dd26-45e2-ad6f-4b3d53f460d7; Thu, 28 Jan 2021 07:14:11 +0000 (UTC) Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Jan 2021 15:14:10 +0800 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:56:28 -0800 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:14:10 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: c8ca2039-dd26-45e2-ad6f-4b3d53f460d7 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818051; x=1643354051; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0nkVYESNcCP1ZuiY2joF5zZXurD0RzvJ1s1BM2N7jGA=; b=ZVcxLlzRKElg0u8TXFmI4lzEQt9BWuAqWhttYEhWH3KoMO6Z91dGYaKT a7fwpum/0OmqryxvtnKMyDssyMtKOJiUIbubWZhgY8Vz8e/P8NE+C60X3 MCRdGhtlQjoyI/sMRvEtbbCRzGOnVx8Rzta6a8W1QAd1LL23Sjz+4GMqe JMsUMku4Us/MZaY4oQbQNgiCa8k3sjPor4FoWqSktj7h8YmQmwKqrcmKH Lq9FabIXMnRNE+0zNQttALYDA96Ks6KO6gBOS9QC0dXbIJ+PZMTdr8i1D yKrSefYQpyHmHIY6B7rwbIoACt3EZviclFoYYWDqp/DOd6WbEehLmTI6a Q==; IronPort-SDR: CUDo5p95W9tOieIQT/wbDoPPgXN8QL6mi8l6K2R0rDtA97wKLfAaPMMjBydckHtsV7t+tvKARk qVSf4WtNVnwBgCmyA3Wjb8COS5AviElUuNCTjNXV9mOkudq6IFEMAYE9u9H0FdgZp+/EbWxkTF qgH70VuaZ8G1co3YCGtcEZmoawKxI/9awmxddgWeVEp+8ur85573n+OUdH0vj2yE2F7+0HEPct EmmXzNjkzy8H2XIjARhrTbaVndO3B1S1dX/hvRaYjL6gw2odEHhyPN9NDEJHEqz9FVOMAT9dJf HYo= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158517410" IronPort-SDR: L/VInY705JlXACbJkMGxb7OFP8KHDfxN5GNWTq6G/fmkGM72rSOkp4/mkhVrAue88h19Xy13Bu dyTvQBHPIfHhdVI0CqOA5zMpvfPIn84U/UuYNXkFu5ATTAEoUUqdWYpnhC5YlBBRhX8IMVP2cF 8rA46cizFU5Igu1j/tm/PblN/0JypXqjSh2VZ1I1cG9D4PjEUyp8Xf57PY8arzufsM+eayrqK0 SH9eglD1o7DrgenSU+Dx/vstvHBzNdsI37hKPMPdUiS68bmrfuWQnuMzc6HtIVpnOoYVgv0lJW Ioangw+oCllSWtVekkCVmo00 IronPort-SDR: lKKhoxaMeyOwXqrT2FSzD4wN8uVJ+mvKyFTUKLm7JjK92Do6Pp8LlRaYGgmaQWgAcNgigcbWq0 dr8eH/C5m6jarJyZCPupuIjbqQYzS6I98zkdR7vs+3yNowqMQiZeF1CHZrTo/tpym1SjWfvRXs 6jUItt1/GcDgh349QalPLGcjYuMZ5A1EKw0wTA/1PN33qNlegyypjYwNakr5Qt7Zi77XOTVrdO glPMuXb+RS4OnELTigLzoH/k3P2LKO+/yrMNDKd4LQa/txopqXKI4iyznrBVm1YJBPOgSOjnjZ uxk= WDCIronportException: Internal 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 17/34] iomap: use bio_new in iomap_dio_zero Date: Wed, 27 Jan 2021 23:11:16 -0800 Message-Id: <20210128071133.60335-18-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 Signed-off-by: Chaitanya Kulkarni Reviewed-by: Darrick J. Wong --- fs/iomap/direct-io.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c index ea1e8f696076..f6c557a1bd25 100644 --- a/fs/iomap/direct-io.c +++ b/fs/iomap/direct-io.c @@ -189,15 +189,13 @@ iomap_dio_zero(struct iomap_dio *dio, struct iomap *iomap, loff_t pos, int flags = REQ_SYNC | REQ_IDLE; struct bio *bio; - bio = bio_alloc(GFP_KERNEL, 1); - bio_set_dev(bio, iomap->bdev); - bio->bi_iter.bi_sector = iomap_sector(iomap, pos); + bio = bio_new(iomap->bdev, iomap_sector(iomap, pos), REQ_OP_WRITE, + flags, 1, GFP_KERNEL); bio->bi_private = dio; bio->bi_end_io = iomap_dio_bio_end_io; get_page(page); __bio_add_page(bio, page, len, 0); - bio_set_op_attrs(bio, REQ_OP_WRITE, flags); iomap_dio_submit_bio(dio, iomap, bio, pos); } From patchwork Thu Jan 28 07:11:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052199 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 2FF1DC433E0 for ; Thu, 28 Jan 2021 07:14:30 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 D2FAB64DCE for ; Thu, 28 Jan 2021 07:14:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D2FAB64DCE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76637.138394 (Exim 4.92) (envelope-from ) id 1l51VV-0005CI-Gg; Thu, 28 Jan 2021 07:14:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76637.138394; Thu, 28 Jan 2021 07:14:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51VV-0005C9-CY; Thu, 28 Jan 2021 07:14:21 +0000 Received: by outflank-mailman (input) for mailman id 76637; Thu, 28 Jan 2021 07:14:20 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51VU-0005BH-Nh for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:14:20 +0000 Received: from esa5.hgst.iphmx.com (unknown [216.71.153.144]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id f71a8279-8ac6-4682-824d-537aead0bc24; Thu, 28 Jan 2021 07:14:20 +0000 (UTC) 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:14:18 +0800 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:38 -0800 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:14:18 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f71a8279-8ac6-4682-824d-537aead0bc24 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818060; x=1643354060; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SCctODBcoMVRMibJjtR9kI3GnL0tVZIiIK8qwMLhuQk=; b=qdqyxKe3yUWbRVVnMj8HMLkLfvTUhUlWHfOYDRlZV661tSR3jyHIutX0 70dbM4HVhubEC6O6E+jts1HT3o4JTQSCGSjW7ThucLKvCboeyDv0X7nEW 174nhhrArwDSOaJJO2SWVXYmHoIVTm/z/J+Oota1lpY4usfRL1CWHCPks TAGAUl6p0fhbwr0V7M6Sc+W7dxG+8kME1JlQ12fuIOFmcLLL8lsw8CRub kuOhdJSLKWUGgsZrdWgFNswozYKNWEOaZm7ZNJjOKEaO5xkGDqEL/SxZK XlhuNf4Yfj2TBEs/OKGueemBoUCAmOu08pnRdb4d6ZwvyjMokMrDjbD5c A==; IronPort-SDR: pK692UaIEnP1XIpoIqEh2c3HLlD6x0lnVRSjCfBU9TS6HoDHKsgh/edt/TKkJrKwWPmq0Ua6JT HAbthreXMxsYvvPUNxMLU2JAFNHMFwktPQANSID8hfODguMNLr2gAfLtCCF0UVrye3gEUespHN m2ISnexpHqlYWlr7f6zyfdMJAoforZwGwBc+F4t7VMraQsPO9oxQTgei1cs/+PtIEPFBBsfJK1 xE2/vWe5Im+jy283q+34mky8bB7w0djJlNGuwPSd3FTRk+JlI7Z8cxqcQQrwHjzkBDHBA/vwcD W6c= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158518274" IronPort-SDR: FI+nhGOOuPuDu8M5kbpqnDdZpIcHVCvLVkg0rWAH0kfli3UNt+ADqPUjM6iGp44MF+gnY3IMm7 UU+dUpa9ZamKNJ7EJuhtWvwUvrSG/genpTFYxW1zjHMhXDM2V7GCqTEhnqOY/ELyieYgi89Op5 JUuH1BitVkyjJwK64wIyPxgheR1BDfzc8YHdBBWjY3uisMaGUk1mxi+ZKF9HXrGSV2jQqSqOyZ Uy88ydX8xsNBeE3Zy6xpxfblHQV+4Ntl/ja7k2EVcstok9YOaBizNnGFF6pQzpRtnl05SXn+9t oWiNAHTeXvXKeYupL/xbCnWQ IronPort-SDR: SE/7jhzj8mUN4IuNpOkC3snrZ8NJ1clnXy6y5ds9FsX94ZBtriQ4uRa7QWKdGcnXbjLMCBoUCV muTlW54Qa3qPh6fwMtXMlfwP2+yfKLqOcAu45V7pI+dpenWI0L1OM9udcXtJMTQueAmHig5gDN d6OcRwyGrT7GxH48PliS/P58sqmLq3e242QCy6iyXTMgFXRd2EClUAs64FPFphS/GBkZYgQLMx xAByTj3G42kPYoeBIsWoRZMAgUwhHcuqehcOxGoJkKVhb66+D9X5hujEyFAgPHDC4Sd1jNsKev N7A= WDCIronportException: Internal 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 18/34] iomap: use bio_new in iomap_dio_bio_actor Date: Wed, 27 Jan 2021 23:11:17 -0800 Message-Id: <20210128071133.60335-19-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 Signed-off-by: Chaitanya Kulkarni --- fs/iomap/direct-io.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c index f6c557a1bd25..0737192f7e5c 100644 --- a/fs/iomap/direct-io.c +++ b/fs/iomap/direct-io.c @@ -267,9 +267,8 @@ iomap_dio_bio_actor(struct inode *inode, loff_t pos, loff_t length, goto out; } - bio = bio_alloc(GFP_KERNEL, nr_pages); - bio_set_dev(bio, iomap->bdev); - bio->bi_iter.bi_sector = iomap_sector(iomap, pos); + bio = bio_new(iomap->bdev, iomap_sector(iomap, pos), 0, 0, + nr_pages, GFP_KERNEL); bio->bi_write_hint = dio->iocb->ki_hint; bio->bi_ioprio = dio->iocb->ki_ioprio; bio->bi_private = dio; From patchwork Thu Jan 28 07:11:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052395 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 9FC82C433DB for ; Thu, 28 Jan 2021 07:19:11 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 428F264DD6 for ; Thu, 28 Jan 2021 07:19:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 428F264DD6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76726.138551 (Exim 4.92) (envelope-from ) id 1l51Zz-00072E-Er; Thu, 28 Jan 2021 07:18:59 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76726.138551; Thu, 28 Jan 2021 07:18:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Zz-000727-At; Thu, 28 Jan 2021 07:18:59 +0000 Received: by outflank-mailman (input) for mailman id 76726; Thu, 28 Jan 2021 07:18:58 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Vf-0004at-5o for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:14:31 +0000 Received: from esa2.hgst.iphmx.com (unknown [68.232.143.124]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id acc075e5-c520-4e8d-984d-3086641da3f1; Thu, 28 Jan 2021 07:14:27 +0000 (UTC) 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:16:53 +0800 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:46 -0800 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:14:26 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: acc075e5-c520-4e8d-984d-3086641da3f1 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818215; x=1643354215; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ehPvHcNFObZpIErrj099M/D2lwJDNRsp+vZtBu0oImM=; b=k/Jru1VNjukvwvnvZz0pM0LaZbG8K+F6BQzUFH9Qf1jMHx0aq5ApLu88 Rb8tduHQb5dWDKKlXRj44rBBaKXeXcDl6Txj9hhXUnD6FJrAChKpq1Vfb oanL2XI1ICrkolTcMjRJecKzIA8dvr8BsxJEByutfSpkAxv9nfF5ZUAlM Bp1kUF7CRdOmzo2LnZg3/Rv9p80v2i2se7EeTNdMM5Wg5HV6AdsYYHl2F FJogJwPPr1Ps6OJyuned0ffgeWjG6oX5RNUBVys95X8RP9zmoILZN2pXE cjAsTfUjOYhIFE8SIIP7Sf+KfGs/Fytf/0LEMcdcuZNM2CiCRP5VAcy88 g==; IronPort-SDR: TIyCIEWYac9w41uOVHCx1NlputHnePgau9U4Nio69e774e+y9cOp4h+IKaKCI301hgNtB8yprv OzNvH/7WTp9HgJAKWBfCFL5vppPayTQkk3hFAENtRx52kjln5+RR1BZGzrFHbTG4CDVeqqWHjT sHZteJXFthRUvmtbzVRktJolWtP6ZxivYoDAZ6//uohOXrJ/AeHt4qoVfe5cXbpPCyeAhQh4Iq NpUJaFI0UegbzGqXhx6UsK6U6WC90CBjOhzjwY/+zZXOl/14RnhLTZscq/M21E4vFU7BFXIgcF 4kk= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="262549081" IronPort-SDR: 1cbHfofSamCo/ApmAsljDsCfz4r54G2FUZWYGmNyuiSCN/Z2YbFMK4sTHBY6hI5X9G+hdRKckL MECpSuOA5McwEFqGcWF9fZAuz1wtmgLEfP04Iww38ZdVq/7yvSG85e0GGhFjwhuUeHPHiZ+CA0 KVoKo0o6pkY6maaofqS39ufg6JO/WLTcZRQ5Fkl5MyqYubTWnwqw9qWJ8sa/aAQljenlUfCNNe CGBAKcNX2u0L20dVF1ImlGoD1GGzcPw5ZLeIoSk0Novo+/GPe+cqpPa4nboxjKy0E+3Zuvs8Qn +Wrn6/RiP2m2ygrD+0NiE/MM IronPort-SDR: 8zWpKV1GG73An1zpnhB0A6RHwKcvj53Vuxf9sCqOuA5ZBa5rmYze0QOVvU8HXRv/G7xpZnMIM1 owK+1cH03BzVuf34Vf4nPTxb3MJRxKHU7MPVsfYKBvoE5U6OUm3WvlKRFiuZT6me2l9YBpl9Dw srBAVfHgvdy6RitQaBWTWMkJB+swHKrWKKu/bnpunnMHs5/vTt80z06ovpDFKB7vDmFytTZ38T a/jEmxYBTtNgI1MsJxovm0Lez6j5sfQFarO3Hedm9NgwCWDpXDWzTcx88c/FgbEiOtdVVLfaVV avQ= WDCIronportException: Internal 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 19/34] fs/jfs/jfs_logmgr.c: use bio_new in lbmRead Date: Wed, 27 Jan 2021 23:11:18 -0800 Message-Id: <20210128071133.60335-20-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 Signed-off-by: Chaitanya Kulkarni --- fs/jfs/jfs_logmgr.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c index 9330eff210e0..4481f3e33a3f 100644 --- a/fs/jfs/jfs_logmgr.c +++ b/fs/jfs/jfs_logmgr.c @@ -1979,17 +1979,14 @@ static int lbmRead(struct jfs_log * log, int pn, struct lbuf ** bpp) bp->l_flag |= lbmREAD; - bio = bio_alloc(GFP_NOFS, 1); - - bio->bi_iter.bi_sector = bp->l_blkno << (log->l2bsize - 9); - bio_set_dev(bio, log->bdev); + bio = bio_new(log->bdev, bp->l_blkno << (log->l2bsize - 9), + REQ_OP_READ, 0, 1, GFP_NOFS); bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset); BUG_ON(bio->bi_iter.bi_size != LOGPSIZE); bio->bi_end_io = lbmIODone; bio->bi_private = bp; - bio->bi_opf = REQ_OP_READ; /*check if journaling to disk has been disabled*/ if (log->no_integrity) { bio->bi_iter.bi_size = 0; From patchwork Thu Jan 28 07:11:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052201 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 0C848C433DB for ; Thu, 28 Jan 2021 07:14:45 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 BBACA64DD6 for ; Thu, 28 Jan 2021 07:14:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BBACA64DD6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76643.138407 (Exim 4.92) (envelope-from ) id 1l51Vk-0005O6-Uw; Thu, 28 Jan 2021 07:14:36 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76643.138407; Thu, 28 Jan 2021 07:14:36 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Vk-0005Nw-Qo; Thu, 28 Jan 2021 07:14:36 +0000 Received: by outflank-mailman (input) for mailman id 76643; Thu, 28 Jan 2021 07:14:35 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Vj-0005NJ-LI for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:14:35 +0000 Received: from esa6.hgst.iphmx.com (unknown [216.71.154.45]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id a1b2f94e-f791-42c9-9d79-3621c749b1e9; Thu, 28 Jan 2021 07:14:34 +0000 (UTC) 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:14:33 +0800 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:53 -0800 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:14:33 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a1b2f94e-f791-42c9-9d79-3621c749b1e9 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818074; x=1643354074; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WN34YNrFVBX2exPMiNFaWJshviC5HdAH5Y1CjLjlB3Y=; b=P8OPFyb6+DRO2eMvGrO3ZFdfcGq9gKcZAkTUtEw7UFQiIRDVN6YdJenG qviqep58vKGmHKOk6+xi4akbk8a/fL8hKHtb2XVDVpdZYILhtwEXj+Laj 6cqeWVZo6IaEdBGYSRhAUoWn50bjPdGQcmNj+f2jgJuCB774qpKEiGhoc tKEoYO+uD74GrI30eiBjbsF6T+wpZQZlOyz8tXkuAZNATooJci9g2yhE2 t4ynFIeOFUelOs/m2IAlzwHqCGCEeSQ7h6AO+yn2ArteTzutzJ1yYM0mu 0g8W1XKV4rPS3IoeGXQKXpN7fKdU3IuwS46WqunGRvxCAqm8Tm0RbwCFP w==; IronPort-SDR: 8qaiRkGulLvOG5qjHxDkPJgEjUECT6TYlwGkIeueAE/XAaqMyzBxfuhfMWVXvvYx2nDYhk+dE6 SuN8luAfu4RSWnDeAQOgag+ATZJxFRIbQo2vMg7dMhanwcbYyuoyWUDnbSkzfuWnI01Wgyiu0C xsVZBhzX65T6/osDm9avGeDSvMPRD3wT2N5TMcSNHJyby0BqMCB+/2H0CECX/O4tyTqEEVVqWk 1q/Olzku3hfrFuVQxBkXd7aK3Mvk4ZjM9VxWRfz61pN057aoF1xosz/OHhNF0nwuTzp5mjAn2n 8nI= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="159693929" IronPort-SDR: rUniaWO92UoUVDNasq2Mg01K3ZD6eAX8KX0XBkhBiIhRHFDuaOSQPQAi2AFktih4P0lGSSV6u6 1QJvr1titcHCS+WSLX73NY2dt1EDt0x/2IEl3+6kIi8fCD9JDkcwVkRNbBFaa5GZ7fpv1ZVw3f 2rA0eyHovrbJ82FVztMfe/gs5sERauw4PpJZbjZNEoW1QXf3Gs2gzGg+nhIYH9WIGObuzob3hJ p4bN6g+yuya+t+E2qn1YRDsFrWgx1QPKIG9BafRaNjjRxwnydAGXq7juRoTKLyRxHK7I1bEI7i bLdoBOEHiYOaToZrg7OjMYlB IronPort-SDR: hgdemKPG/3HHgXRADNUaRfIeto8NmW8LEHR468JLI5qNdwJ9I/Vz7EOVIHe6ux2OR8aMkXbCb+ hHmOp4ZL4+H3N5KG2012DyI6S+0eAji83o59kSvMRJsf1lkWorl0McE4AqjKkZANcW6TxQu0db Rg6QKY68t8KKdoDxgIWM8St6Q8n+pLj6fbsJ1LpjtPi/SVOVdnUNhjzT9HNr2ak6ECZBXsF3YT a/oz2zpRpm0NjKofMt8jO2sCHWsfpktQx0L5tGvTxbU6SR20ACdGgmG00/Fl2WObQ2KsI7nqdc S2A= WDCIronportException: Internal 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 20/34] fs/jfs/jfs_logmgr.c: use bio_new in lbmStartIO Date: Wed, 27 Jan 2021 23:11:19 -0800 Message-Id: <20210128071133.60335-21-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 Signed-off-by: Chaitanya Kulkarni --- fs/jfs/jfs_logmgr.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c index 4481f3e33a3f..bb25737d52f6 100644 --- a/fs/jfs/jfs_logmgr.c +++ b/fs/jfs/jfs_logmgr.c @@ -2121,16 +2121,14 @@ static void lbmStartIO(struct lbuf * bp) jfs_info("lbmStartIO"); - bio = bio_alloc(GFP_NOFS, 1); - bio->bi_iter.bi_sector = bp->l_blkno << (log->l2bsize - 9); - bio_set_dev(bio, log->bdev); + bio = bio_new(log->bdev, bp->l_blkno << (log->l2bsize - 9), + REQ_OP_WRITE | REQ_SYNC, 0, 1, GFP_NOFS); bio_add_page(bio, bp->l_page, LOGPSIZE, bp->l_offset); BUG_ON(bio->bi_iter.bi_size != LOGPSIZE); bio->bi_end_io = lbmIODone; bio->bi_private = bp; - bio->bi_opf = REQ_OP_WRITE | REQ_SYNC; /* check if journaling to disk has been disabled */ if (log->no_integrity) { From patchwork Thu Jan 28 07:11:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052203 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 12A7CC433DB for ; Thu, 28 Jan 2021 07:14:53 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 AD4D664DD6 for ; Thu, 28 Jan 2021 07:14:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD4D664DD6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76647.138419 (Exim 4.92) (envelope-from ) id 1l51Vs-0005Ta-8A; Thu, 28 Jan 2021 07:14:44 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76647.138419; Thu, 28 Jan 2021 07:14:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Vs-0005TT-4f; Thu, 28 Jan 2021 07:14:44 +0000 Received: by outflank-mailman (input) for mailman id 76647; Thu, 28 Jan 2021 07:14:42 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Vq-0005SZ-DS for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:14:42 +0000 Received: from esa5.hgst.iphmx.com (unknown [216.71.153.144]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id de89d92e-d6ec-4adf-acaa-b3c2fcfc750f; Thu, 28 Jan 2021 07:14:41 +0000 (UTC) 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:14:40 +0800 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:59:00 -0800 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:14:40 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: de89d92e-d6ec-4adf-acaa-b3c2fcfc750f DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818081; x=1643354081; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1876bf0CQ4oKwKjrcbLTUHkm2JuWaJTsdB558+rHPRs=; b=qpz7jonHFeG1AFZhnniZkdOeJsA8GEE1IDzVyDwYqpbcLbW9W081BCiz +1ZWEiNZrYdqCQ2xBwn/V37w0nTlzVo/o6t7DRLKbse/28pLil9OrRHku HOuLPsn2uqaEC3scPiG0rl1epYXJLj+4EQ7Ta8Iakroq9ncoXMBEaB3Bp F6G+xIqMn3GKhfIcbqKpryHTI9YHFEC0JMAPovoRnx/ftr65T6SVXUZtl 9wEMcKme3sxzXFo4seM/pi8MyA1+4zxIzfpxzXoY4md9e5PsVCdP4hEh7 +DEYgwhOqExwVvKM/nqy+gPwgaVlHPN0Osy8IgrehJhvc6xLNFjgylmRZ g==; IronPort-SDR: RRY+ZGtwij9SsA4Mo57KjtEZ1PgJySsoiQgxfr5BzfAGzPCSGJ4EOiSD9bLbmx6OEWuXdsHG02 Iz/QtfDgCHsvKLUtNsuag8/kpXi5IRusLgaCXkSiwy34XNHeQkqrlQ3uS1HEJK8b3FUbZtQV45 fnGj9qmkrn3caYIgGfVW8j6r+x9vWgG7Hk1lx2Cbqy1adbZOk51q+doWppSeTWIBxGa7d3EVPh BbWf8WfiKbQ9TbmQ3KLJP/AjDLaGOLTV76lzXCtINecKcRcjqcFleaS6xugCHc6Y9ZStdVL9Z5 sKY= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158518314" IronPort-SDR: pnrFcT3jy6zyRhgBO65y9U+V/An9wsNd7jAAA1OJu//w4sNdy3uAVQWKHLytgWqQXWJY2Iw2HB WreAIc8DGfbG7OORiXj1gZRpCheBj5D09oDLSsRznzxd7c9aNO2uFNevBGca7t9dx0A+h07Mbx gptEDUplV9D7deBVMK80s2GrfXVIv6lOFI6IQ/vNKNcEl7B44zv/Dk+bHc77e12lF8JkmnESek iRIjbSHsdtWNFG85HrniClf3XGtfpcnusd1vTQnddIV13SAcuxTu7XYYY6RJrvmuUG4DTXqRVN PALSx/O6llAja0jYxcBNnWZq IronPort-SDR: AZlMO6gj0EkPLCOgk+c5DT4WNDhjCfw45MtadZ5/GiFEmQsvwhsbRFXpLpdTLbQmQEemYM6EDm tOJGHTOsUuwCnKWQp1EvZsc2vVv2mGBlVwctpi8EDm1Wy6X1cWP44qswXm3cNGjgKR2lWgrabH PKyOztqBt3vFXNBi+4zXssLa4rCI5pehsTeRPvX3Q8KhjR216EOs3fiNJCh3n7IcfWfe8KNrrp msksZa1Bq+VYcOk7PDniLMLHnLtDMI1z0ihKaVt3jNoNuACs7lGXhymeE4zWEV78rp7w4D786X hJ8= WDCIronportException: Internal 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 21/34] fs/jfs/jfs_metapage.c: use bio_new in metapage_writepage Date: Wed, 27 Jan 2021 23:11:20 -0800 Message-Id: <20210128071133.60335-22-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 Signed-off-by: Chaitanya Kulkarni --- fs/jfs/jfs_metapage.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c index 176580f54af9..3fa09d9a0b94 100644 --- a/fs/jfs/jfs_metapage.c +++ b/fs/jfs/jfs_metapage.c @@ -416,12 +416,11 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc) } len = min(xlen, (int)JFS_SBI(inode->i_sb)->nbperpage); - bio = bio_alloc(GFP_NOFS, 1); - bio_set_dev(bio, inode->i_sb->s_bdev); - bio->bi_iter.bi_sector = pblock << (inode->i_blkbits - 9); + bio = bio_new(inode->i_sb->s_bdev, + pblock << (inode->i_blkbits - 9), REQ_OP_WRITE, + 0, 1, GFP_NOFS); bio->bi_end_io = metapage_write_end_io; bio->bi_private = page; - bio_set_op_attrs(bio, REQ_OP_WRITE, 0); /* Don't call bio_add_page yet, we may add to this vec */ bio_offset = offset; From patchwork Thu Jan 28 07:11:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052205 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 62B3BC43381 for ; Thu, 28 Jan 2021 07:14:58 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 0D27D64DD8 for ; Thu, 28 Jan 2021 07:14:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D27D64DD8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76649.138431 (Exim 4.92) (envelope-from ) id 1l51Vy-0005ZO-Hi; Thu, 28 Jan 2021 07:14:50 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76649.138431; Thu, 28 Jan 2021 07:14:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Vy-0005ZF-Dt; Thu, 28 Jan 2021 07:14:50 +0000 Received: by outflank-mailman (input) for mailman id 76649; Thu, 28 Jan 2021 07:14:49 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Vx-0005X4-Og for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:14:49 +0000 Received: from esa3.hgst.iphmx.com (unknown [216.71.153.141]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 7078d0d5-27a7-477a-985c-0c358a16cb1e; Thu, 28 Jan 2021 07:14:48 +0000 (UTC) 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:14:47 +0800 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:57:05 -0800 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:14:47 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7078d0d5-27a7-477a-985c-0c358a16cb1e DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818088; x=1643354088; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3pvsXY5ThsGIWZu3d1vhsE8XvMocy29CAsL/BvlC2XE=; b=mPm7CbOZdmLtpobO9yq+nQO72k+7QULfahO5kuNYGQLLSAB6X63SC2d9 CF4yrUPyPLt+tJg2JxreIoEztTiJ7udO2KztyBJFsxmdrY+DEBgSt+B+b GsVvUGzSYXwFB3j1Nqc4PLIJyCn9jPAFaPCLDf9CTKcK8eIOioEbrfdl7 wEysO8uJyun88U9+IOcGefNYsTNIp9OkM6CbwcuFePIByKW/eXC6/sXFW n2GZ0ZA2zRrBDEc/Kd3ttPxBJOC0m0YP5O5kL/iAXrMPpoYBjcPSeN3fP QMxDg5aNPWHHzVln1HdHpuns9NU8KVNZyI5X1wMrCYlP/zhZztHje3rGF A==; IronPort-SDR: lZjp/eMUSsMESHTtCChbwb6VyMiEXmTQ/y/IQ7/ru1m3c5xZhJ5D385B28E1b0tSh4Beu9vc7G 9TFj7PhJXcFCMRjV+nIAbkbUAhDJ7WpFhwmB/x45QSg3Q+eUtWixh+312GHWTM/fzpy1RiU+a9 dUxdl36JdXknm2Cq5Mk9OYJ97XMu1MQebHV3WAjmX8lgZLs+MLlvrJ4eguSPoTvuVbCGCzNL6P fsxNMzzgsqsjZlYCebY6aoOTH+rJuRZ/3da9/7OpqE2Ac1pEhJNFRyIW3s5OoHlcw6La41O3CV Duk= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="162963357" IronPort-SDR: FSKzYQgHZ6rOGMnwTZeg+FPOT7Q3/2ZbeRA8q9SZM92IWDrnODMZ4lGtJxzmYRODLERERayUPK 3McLtC5PipEkgHgTcRuGN1MsaQakfxBTz55VRXDFSVBDHhq5PuN30+p6u6yWh+kpxyg2a1v9B7 jdsx+MbBM88qdHielJhWC7btuG3YgFf25wn9TtuwXg5SAS/5fcJ6yD1tjbgAym1uZmRonGfrAc 2e+2T5j5oWvxY34zHe4DCvu+ZRADUkwfj1LZL8zWiPKNgVaPfSwED8V/JQMYbgtBekqGFuTpkn 9iodV/HRODBVjoeqKHB8hkSI IronPort-SDR: /NPjYa5/vzKcQxwITziayqgew/xym2P+2wPZ/H6tqOBM0Xhb9g154b50VotcIn3s/gPeO6yJQj jaDu5T7BNEIYITi6TAhnovFoYzPUstLQt0EGdLi5t/kGP6Y/bNfbV9+olcDvctAzlPCNttcR2B XcI2j3jvNIAhA1FsWohm0Q1E2hEvaC5Uto6Y7wmXZKJ1CZQCBzspE+8o3ZgyvyjFSagVsi+kvR d3gH64xpw3ry94057Mia9wtqUGJtdB9qbq+w9vxtVohjFozpBIeHLdl7QNCYcftS3gwSjr5dcQ UPU= WDCIronportException: Internal 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 22/34] fs/jfs/jfs_metapage.c: use bio_new in metapage_readpage Date: Wed, 27 Jan 2021 23:11:21 -0800 Message-Id: <20210128071133.60335-23-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 Signed-off-by: Chaitanya Kulkarni --- fs/jfs/jfs_metapage.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c index 3fa09d9a0b94..c7be3a2773bf 100644 --- a/fs/jfs/jfs_metapage.c +++ b/fs/jfs/jfs_metapage.c @@ -495,13 +495,11 @@ static int metapage_readpage(struct file *fp, struct page *page) if (bio) submit_bio(bio); - bio = bio_alloc(GFP_NOFS, 1); - bio_set_dev(bio, inode->i_sb->s_bdev); - bio->bi_iter.bi_sector = - pblock << (inode->i_blkbits - 9); + bio = bio_new(inode->i_sb->s_bdev, + pblock << (inode->i_blkbits - 9), + REQ_OP_READ, 0, 1, GFP_NOFS); bio->bi_end_io = metapage_read_end_io; bio->bi_private = page; - bio_set_op_attrs(bio, REQ_OP_READ, 0); len = xlen << inode->i_blkbits; offset = block_offset << inode->i_blkbits; if (bio_add_page(bio, page, len, offset) < len) From patchwork Thu Jan 28 07:11:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052207 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 88164C433E0 for ; Thu, 28 Jan 2021 07:15:06 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 3658664DD6 for ; Thu, 28 Jan 2021 07:15:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3658664DD6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76654.138443 (Exim 4.92) (envelope-from ) id 1l51W5-0005ge-TN; Thu, 28 Jan 2021 07:14:57 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76654.138443; Thu, 28 Jan 2021 07:14:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51W5-0005gO-OH; Thu, 28 Jan 2021 07:14:57 +0000 Received: by outflank-mailman (input) for mailman id 76654; Thu, 28 Jan 2021 07:14:56 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51W4-0005fl-K1 for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:14:56 +0000 Received: from esa4.hgst.iphmx.com (unknown [216.71.154.42]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 961fcd9f-e928-4591-9cb8-63839c181e13; Thu, 28 Jan 2021 07:14:55 +0000 (UTC) Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Jan 2021 15:14:54 +0800 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:57:12 -0800 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:14:54 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 961fcd9f-e928-4591-9cb8-63839c181e13 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818095; x=1643354095; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XPaYjcRaIFpnYMD3YBMMFWgQznGRHjSurwf/uHFVwCI=; b=SDKTSJBx1LDuT+ovpg7fbM1obKQGt0ELwHjkPJ1R6+e+SbEYeYRSNqqE o+eKG/MzL7uW502w7slZ1s1ufnYm5lsTlfmbxj+yPxIJ/16y6J11jaYpH tAOABVX1/+ObhwmtqOD/DRGC1ZRhOc+XL7cRkcpwzd0U6w3SlulcGnXaf pQgenO7GD/RB74w+nwtOTdKibbPpCnbavE/t+JBP7pwnDF8hRlTAoFvkn Ex/F70h2Yxs8V6vmg3qZBYo9qakH5trmnAEp0soYC9YPc5m6/toJ9Jf5q WtfFQQadH9aV+9okqxsEOMIc4pLqO2SO2VkUjs4tpYDmXV0SmsZwvzVdv A==; IronPort-SDR: hwOLTmryUt0Lx9A36ifW1rTkgfcsCotwfj4Y1ICJ4hQQoAME6TuGizY6WGIaDlQ1gLiy/NxP78 bXLiYWugv0n1dFMGGPewJi6D+daMPSrjKcPdh4s+4/uskuYbXqwD2Mx15ew1C8KyBN8OxylL1g nxfga7ppS0N1o+z1D3DTfd0p8kJtBh9Veyv93oBaYuIZ7L1cvuXv7SvS3fZy/29h/CtfdxXYja l/J4ykj5pvVGyB4AHB7qvcnY8aNsjW9u0CD4z2P6iwPvIx5dzO+VtsU2NnAP1DMNpNg5dSLFxt xhg= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158517478" IronPort-SDR: UKs4V9LardU8lNj40XjaXERGH0tnfgv5OHGYK0r/4K4O23rke65FJhlfLUpqiDIK8Su1GynH4v +Q6xJ7vf5O/hvxGdRZMwhO0D3k2SQLn5LpL0jIncOjSfY+du1cFVCLxOJy3gZP5YSBuctedBlU fPTlFcY5RprWsGUP01xwK1hvUVDyqc16xHAx8h6kaDji+HLrCt3J7NzE9jTNGoHTMtcuQNv3Nx ifKJHJoHicjH8cD8Vmbk5iAjWtX+ES8FSLrP6CEXlvvcRtk7Bzzq8aF8LsJ2/lUViZgwMOPYh0 Q4RjXO1l4LonOEoG1PxSQWFr IronPort-SDR: m1TZ+g0HqYnNuuEaVgIMmloDXGiOQeWVkBatefSwdP931h6/Qc9uK8rnz+JHWAn0f3QBmOsUC2 fXJ41UlgQQnfdBQndrwCq+hQtl7mr6AQW85+ZjLVP2rPUrLfDej915AJE+NjNtCGI740sa3D8g UGQ9bx3fpoJbY98zSPHF13CT5IYtiyfyvVxvvVA5VfTuNLKWU4ZEgYs5jdqkUbRYa6sajX3DSU E+nFYRIRokBPoO+x05JGw6lqTR47HYfSK6LYXKwXfQUKv6zaLN0igntqoauBJYDwbicxGnznwF roE= WDCIronportException: Internal 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 23/34] fs/mpage.c: use bio_new mpage_alloc Date: Wed, 27 Jan 2021 23:11:22 -0800 Message-Id: <20210128071133.60335-24-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 Signed-off-by: Chaitanya Kulkarni --- fs/mpage.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/fs/mpage.c b/fs/mpage.c index 830e6cc2a9e7..01725126e81f 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -68,25 +68,21 @@ static struct bio *mpage_bio_submit(int op, int op_flags, struct bio *bio) } static struct bio * -mpage_alloc(struct block_device *bdev, - sector_t first_sector, int nr_vecs, - gfp_t gfp_flags) +mpage_alloc(struct block_device *bdev, sector_t first_sector, int nr_vecs, + gfp_t gfp_flags) { struct bio *bio; /* Restrict the given (page cache) mask for slab allocations */ gfp_flags &= GFP_KERNEL; - bio = bio_alloc(gfp_flags, nr_vecs); + bio = bio_new(bdev, first_sector, 0, 0, nr_vecs, gfp_flags); if (bio == NULL && (current->flags & PF_MEMALLOC)) { while (!bio && (nr_vecs /= 2)) - bio = bio_alloc(gfp_flags, nr_vecs); + bio = bio_new(bdev, first_sector, 0, 0, nr_vecs, + gfp_flags); } - if (bio) { - bio_set_dev(bio, bdev); - bio->bi_iter.bi_sector = first_sector; - } return bio; } @@ -304,9 +300,7 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args) goto out; } args->bio = mpage_alloc(bdev, blocks[0] << (blkbits - 9), - min_t(int, args->nr_pages, - BIO_MAX_PAGES), - gfp); + args->nr_pages, gfp); if (args->bio == NULL) goto confused; } From patchwork Thu Jan 28 07:11:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052209 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 77C56C433DB for ; Thu, 28 Jan 2021 07:15:14 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 21C5F64DCE for ; Thu, 28 Jan 2021 07:15:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 21C5F64DCE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76661.138455 (Exim 4.92) (envelope-from ) id 1l51WE-0005oV-7W; Thu, 28 Jan 2021 07:15:06 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76661.138455; Thu, 28 Jan 2021 07:15:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51WE-0005oK-2F; Thu, 28 Jan 2021 07:15:06 +0000 Received: by outflank-mailman (input) for mailman id 76661; Thu, 28 Jan 2021 07:15:04 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51WC-0005fA-KY for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:15:04 +0000 Received: from esa1.hgst.iphmx.com (unknown [68.232.141.245]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 32764df1-7018-4ea7-8610-3e6724f698d9; Thu, 28 Jan 2021 07:15:03 +0000 (UTC) Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Jan 2021 15:15:02 +0800 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:57:20 -0800 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:02 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 32764df1-7018-4ea7-8610-3e6724f698d9 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818103; x=1643354103; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hTRBelY7PTDZbFRPdQdHgUhYseaoF0bY2tLyF8ypbSg=; b=ByXjOQviNjNgXtwnqW/T6IzPNeS+qZuS8XIl7jeqlnsAk1geM1Btt4M4 WRoe0Emeatja+qXFuDNDq+qspChDgoKSlT1GVE7O/SmfF5msw0Jevid/a fHlghhurHoF0Hd4L/+89L+Ap40DYT2mwt26PO+Jd3oxo7EKEDa3xNaY9g 39keBLXzYhqgSmaj1f1pdfGU3SKNgPm8LIMgE+EAcNKSTbc3BzXPhXs/2 5izk9S5T/tDVNHbXCScMrOVBzyoop1ABRegzpnDjLzRephGz4WyRPsk3o XoIaf4CJQlZa4AQjO8+3zUUtF/HbPJtOED6zbdqF7oBbQzfq/RohiXWz6 w==; IronPort-SDR: Z5Pu5IFCYXkSshom1iiCgpoCUs78dLPitwcLyKSZ8FrGoj7fjZsjUc2LDUsvhz5qfONN/TPDgC 2bJ25Hul/NR1CppuWgUR7yB+TSxYPSXqR4J5XwbsgbdQnAMVTboNqiFOQUv/BZpmjWNBS0bFCQ hf8rS97Jor6uX+rytS6e9CVLJ88Xl55IFrwl+hUcMJphgOwJNjUBVrHgO7vdX2ngTnGzwWGBcV qFt2xiKjXw3OBW8KQI2QwNWI/X2wsNUYF/4KdhZ2IanlxaEyJj7/PVsGH5ELjnTM+Utn0xUKGb PNI= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="268892608" IronPort-SDR: qt6uqyl+nyhvkzSlBF0UfG9XFFoOXcQij6f+Pgod2v9ir5/eLsSIoYaPnFPnbxUlBn9VUdoRED 79PgF/GbNJxMwwJpp4ICRFwu2Ga2z3tPPNKgWSb+c7RR6W3SavfK2leS9SeR3OPRg/A4FjtT6R Gk9MyKLceK+JzfMX2gvFGZEXxVpzHqCx0M60n6mvO5Sl6k/F4TZqsMe2ErKwnIxDLfsI81nq2m uGsfFFtzoti9NgI2Jfm8fbweiIPQrUOM1cEqtt8A+BIJVhhooc6iJeLSIn9Zlzeal+kxxs3Q1p hs5Z16QWPKoipZC9IVPItcoq IronPort-SDR: RvbuIrKpOmmqZ+oQPbnvg4P9b6yDctCj11PDSHseFUe3NzGe7aNswGzNT7aYrNNymGc7RRLBwA EyS5TC5ya2f1DBzchV289rrRJN4G30R6UcKQHWHLCT1EqyVYm8BdK2p8B74xj927ubYpSXJJYX yqNCzY6cgWt8a45E/OUvNDiMBg+lmhS8FA2ZqgTfl/62S3ZiS0x0JS7q7oikS9hfGQV2kW1Mb+ vR4fnDhlmPbHKapqq2eTmDAeG1Ipck513pFwPBeDtMk5IkG3qgl83KvWp5povuzxSWxrnJjDon 5kw= WDCIronportException: Internal 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 24/34] fs/nilfs: use bio_new nilfs_alloc_seg_bio Date: Wed, 27 Jan 2021 23:11:23 -0800 Message-Id: <20210128071133.60335-25-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 Signed-off-by: Chaitanya Kulkarni --- fs/nilfs2/segbuf.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/fs/nilfs2/segbuf.c b/fs/nilfs2/segbuf.c index 1e75417bfe6e..df352cab7a93 100644 --- a/fs/nilfs2/segbuf.c +++ b/fs/nilfs2/segbuf.c @@ -383,15 +383,9 @@ static int nilfs_segbuf_submit_bio(struct nilfs_segment_buffer *segbuf, static struct bio *nilfs_alloc_seg_bio(struct the_nilfs *nilfs, sector_t start, int nr_vecs) { - struct bio *bio; + sector_t sect = start << (nilfs->ns_blocksize_bits - 9); - bio = bio_alloc(GFP_NOIO, nr_vecs); - if (likely(bio)) { - bio_set_dev(bio, nilfs->ns_bdev); - bio->bi_iter.bi_sector = - start << (nilfs->ns_blocksize_bits - 9); - } - return bio; + return bio_new(nilfs->ns_bdev, sect, 0, 0, nr_vecs, GFP_NOIO); } static void nilfs_segbuf_prepare_write(struct nilfs_segment_buffer *segbuf, From patchwork Thu Jan 28 07:11:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052211 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 9772EC433DB for ; Thu, 28 Jan 2021 07:15:20 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 3E82164DCE for ; Thu, 28 Jan 2021 07:15:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E82164DCE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76666.138467 (Exim 4.92) (envelope-from ) id 1l51WJ-0005uR-Qq; Thu, 28 Jan 2021 07:15:11 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76666.138467; Thu, 28 Jan 2021 07:15:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51WJ-0005uD-KG; Thu, 28 Jan 2021 07:15:11 +0000 Received: by outflank-mailman (input) for mailman id 76666; Thu, 28 Jan 2021 07:15:10 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51WI-0005tF-G3 for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:15:10 +0000 Received: from esa6.hgst.iphmx.com (unknown [216.71.154.45]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 91f45b9b-21ad-4395-be2b-c0b57024cadd; Thu, 28 Jan 2021 07:15:09 +0000 (UTC) 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:09 +0800 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:59:28 -0800 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:08 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 91f45b9b-21ad-4395-be2b-c0b57024cadd DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818109; x=1643354109; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MfH3EN2qKmNoDMJp2ceJniIXfb1rQ8RA/+9VrY6oRvA=; b=i0tcfM8LPDdJD76KNz+KebHt7aNu8dhDBYf/yXb5/+nYgQh0WMse7Sn9 ozH9xc9Sc+UfsdK76ohaCN6GCCqFE6bAY2B1MPyc5DLSfnPLPwFnYTKgo C+OoNr6y2lvG3ysq55KlUUYx0SyWumd7F1WOxvIw9Fep6NoRLLh1itIGY olcxqnkChE8DQ21CN5uYlkYXOgVZGydZPzcofilVELDK1rCglBJtI88zl XslA1BLq6AxPBwEweAnxe/9kwmqcWSX4LyaLSH9Hi5ekxO6pVUVdSUFMV Lfq5RSA+OdcgwBD60MbPkiMMaeX9mBe48U+a84ScWlpFvvr5FvH74xaRT w==; IronPort-SDR: MVQFyYLjFWsAAA5O5Dy+ub6EwOD/aNJuRXmtWJtHkpx69fSabq9PWNhA4FxDA90UCPJK66JP75 SUCZ+lXAWkXE0fGEQoAXxRCOflLe6BF7HdAJrZjLTRZxTWS517/tVlWzqVG+CXikXh4SbTpsrX fEgumkePzcNY+V2PTrjLS4C39+E9NFtSIBoeFiL5N1tAhz3lo991wPrCRZD4H4IhDjeh75R1ny xjffUkofmAR2+iCCyrVoXU13U7jAUHPm2D2Oy/tmwbDChYoS1vItZdjBgDHSd7D4WdznfY8bVn BYY= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="159693988" IronPort-SDR: BexLsnfigTHtojujt4NNUnpbUZb4Dpr0WxeI1mHbhFZUmmDNqVTYCFuGDokUn6FSASlG4XNmTg qRDNgSRrQ6L1qSDX8VVpwplpHJPhOxLsH05KRtXfEiPRfqpPyy8+7qVEPSUz1/HMkRighQ/CYp fjjpcr+H0ymjhdpHCTu+WAUBliYbfJsm1h/VzAnS8cBB/1EcXFszaOrjnDZ01pSuxctuPRQgVW EF9Rc8362YVHWEr75Cj3gBR4d+ylTR6JIYO3Vpi31EElWL7zz9nAcsCBpgv5hGpt9Mc2xZmzlz gtXVorEVhAlw3yy2EJFBxkbq IronPort-SDR: +1TgXZ9HjoaS+86zh+aLwx6S7ZpAYQ4FpPhwS5t1uQfka+31mML1LQsLKCwFYYGr030vY+BCmC AGfrPosPVl95WjEssU5DCDJZAyR1khEX1jpqrqTT8P7u968xhLua2/lVUN5jQ7ABVZJAwAp2MY 3XKOPyoMsT52VNuagfol6rCenkg2OIsIErUkF58mfwGPLsAlDeR+kVK0eqUX532NsUF4ctVre4 Iqd0vyO+udw10x//vZBdiK4usAo9yvQxvOxxYG203IoYDBmyGC3oa9VGSQBs+2yVysQ7ZPCJPH kDc= WDCIronportException: Internal 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 25/34] ocfs/cluster: use bio_new in dm-log-writes Date: Wed, 27 Jan 2021 23:11:24 -0800 Message-Id: <20210128071133.60335-26-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 Signed-off-by: Chaitanya Kulkarni --- fs/ocfs2/cluster/heartbeat.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index 0179a73a3fa2..b34518036446 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c @@ -515,12 +515,13 @@ static struct bio *o2hb_setup_one_bio(struct o2hb_region *reg, unsigned int cs = *current_slot; struct bio *bio; struct page *page; + sector_t sect = (reg->hr_start_block + cs) << (bits - 9); /* Testing has shown this allocation to take long enough under * GFP_KERNEL that the local node can get fenced. It would be * nicest if we could pre-allocate these bios and avoid this * all together. */ - bio = bio_alloc(GFP_ATOMIC, 16); + bio = bio_new(reg->hr_bdev, sect, op, op_flags, 16, GFP_ATOMIC); if (!bio) { mlog(ML_ERROR, "Could not alloc slots BIO!\n"); bio = ERR_PTR(-ENOMEM); @@ -528,11 +529,8 @@ static struct bio *o2hb_setup_one_bio(struct o2hb_region *reg, } /* Must put everything in 512 byte sectors for the bio... */ - bio->bi_iter.bi_sector = (reg->hr_start_block + cs) << (bits - 9); - bio_set_dev(bio, reg->hr_bdev); bio->bi_private = wc; bio->bi_end_io = o2hb_bio_end_io; - bio_set_op_attrs(bio, op, op_flags); vec_start = (cs << bits) % PAGE_SIZE; while(cs < max_slots) { From patchwork Thu Jan 28 07:11:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052213 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 3F4A9C433E0 for ; Thu, 28 Jan 2021 07:15:28 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 DE63164DD8 for ; Thu, 28 Jan 2021 07:15:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DE63164DD8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76670.138479 (Exim 4.92) (envelope-from ) id 1l51WS-000622-3f; Thu, 28 Jan 2021 07:15:20 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76670.138479; Thu, 28 Jan 2021 07:15:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51WR-00061t-WB; Thu, 28 Jan 2021 07:15:19 +0000 Received: by outflank-mailman (input) for mailman id 76670; Thu, 28 Jan 2021 07:15:18 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51WQ-0005xp-Cy for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:15:18 +0000 Received: from esa5.hgst.iphmx.com (unknown [216.71.153.144]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 6fd3f813-19de-4249-8083-77ee226e691c; Thu, 28 Jan 2021 07:15:17 +0000 (UTC) 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:16 +0800 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:59:36 -0800 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:16 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6fd3f813-19de-4249-8083-77ee226e691c DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818117; x=1643354117; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Oh6V4IvaBATnJjcr0mcg+O0k1fwwkwTxUMEnAmiYk7w=; b=N/9xsZ4vaUqT4FOnsamVd0tO/aQtqkb2SkD9Lqw5RnvjLL3jaD5MzkR5 +Kke1qnUFvRlpJzQI+sSe6H6sUN6iGFdjl9jqpGX2mjPG6wZ1jk7n6+Tt 4QyAlu2458qBnQqPRGCFSYmi6NLhhDeBHtSjX68uOIf1Un/z8/FkLlu1q h7Ecg9AsPAKbYSY8QsKN32WQyr2E2duO2g0plsYxJSpyrpcthtYPbHtpv HAZWy6aj72kMtxTeXIXumTxoxrKZZjNitFc7fFtBJJdZdeWfcrVBvgeAb X6kYsiK11Dw0t5Bf77LLh0vlmjjFLh3+8h01K7b8QsCM6uC7ZymXjU33t A==; IronPort-SDR: Z+JOTqyRzYtcry0F0dAKXGe2PYMHZgI+MMobDqmrZPh6GgGjOpfG3TLJMVEuNRUKjqELDSDF81 7MC1fT0EYMLkcZ8R1L2r9LlqMYTQw2nI4X9Pj/EI9OS+nlysaahx9piv0i/lWwUnjVmC1hyjh+ lXmfQmtvmAVUYIYSYxDAkTgCWwbh5L/hCVtJIOsPy/jWXKdBfTV5HSTS9cn15Ws5IHdN1/s+hN PQGrRECLaTyMLtku2Cej/wUTfmoAm6XJjbGpk99k447avo0qBZCSWAV8v0e3goBjbOeY+hMpW4 Ly4= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158518390" IronPort-SDR: 6szTg1BcMnTAmpFuggK4CSsHi1QnQw2SeD6YY8vs9Mho29fEl7YQ0OHD0eK8hRBny/QzZ5ZM4t ozeYVmIhGkHoeP0Qf4tRhCjSaBLgJ/ZDpYJPi9J4N6OPLXKBdrSEclHA/yrnKCDIIgXJ1VY9t7 JSs2stogFLgY5P+o21xh/K895Eto2JO+cwB3Rj14zn1Cz13Qo+TM4Q6S3etzrqJjk35Pr12cVQ 4/RM6Gp3X19y9CV22gPZUQciRp5T3qdg9GyCM9KvCdatgq4gZmLLagoTDoc01qvv1Ypy2OwKu1 VO8V7fXSbH3vVenfK/ktJ31J IronPort-SDR: VKPK85FFDQ0ubYH9k6Rw6wieHrPcfl4K1hBg1VEjOVVMtv+Wn9OrY3VfBreYbEOSh7D7aOPUjq dJWJ6VlQs6sIYpC3Ssc6YP0uwWxx1b9TT9J1h3Z9GJWPAkbpd7nwyEHzf2X7DKDqvOlXI3kZN0 S1wmdVHTrX+2YjnNZtTeKY+gTEIX2ZCvjrzBqJLi0bsvbsghiV571IsEQgaSLG4TZiYK5W8fXC DCDkO56zOq766cZD9jubbH+fYuelJGqJtYeO7naSGnNxMZmGQNaOGjq3DEnkrTfIYty+jvU6Mh VMc= WDCIronportException: Internal 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 26/34] xfs: use bio_new in xfs_rw_bdev Date: Wed, 27 Jan 2021 23:11:25 -0800 Message-Id: <20210128071133.60335-27-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 Signed-off-by: Chaitanya Kulkarni Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_bio_io.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/xfs/xfs_bio_io.c b/fs/xfs/xfs_bio_io.c index e2148f2d5d6b..e4644f22ebe6 100644 --- a/fs/xfs/xfs_bio_io.c +++ b/fs/xfs/xfs_bio_io.c @@ -26,11 +26,8 @@ xfs_rw_bdev( if (is_vmalloc && op == REQ_OP_WRITE) flush_kernel_vmap_range(data, count); - bio = bio_alloc(GFP_KERNEL, bio_max_vecs(left)); - bio_set_dev(bio, bdev); - bio->bi_iter.bi_sector = sector; - bio->bi_opf = op | REQ_META | REQ_SYNC; - + bio = bio_new(bdev, sector, op, REQ_META | REQ_SYNC, bio_max_vecs(left), + GFP_KERNEL); do { struct page *page = kmem_to_page(data); unsigned int off = offset_in_page(data); From patchwork Thu Jan 28 07:11:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052215 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 3630DC433E9 for ; Thu, 28 Jan 2021 07:15:36 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 D4A4364DE0 for ; Thu, 28 Jan 2021 07:15:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D4A4364DE0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76676.138490 (Exim 4.92) (envelope-from ) id 1l51Wa-0006A0-Dc; Thu, 28 Jan 2021 07:15:28 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76676.138490; Thu, 28 Jan 2021 07:15:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Wa-00069q-9H; Thu, 28 Jan 2021 07:15:28 +0000 Received: by outflank-mailman (input) for mailman id 76676; Thu, 28 Jan 2021 07:15:27 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51WY-0005xp-Vt for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:15:27 +0000 Received: from esa2.hgst.iphmx.com (unknown [68.232.143.124]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id de3721ab-5efe-4fed-b2ac-84e902b80b09; Thu, 28 Jan 2021 07:15:25 +0000 (UTC) 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:18:21 +0800 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:59:44 -0800 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:24 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: de3721ab-5efe-4fed-b2ac-84e902b80b09 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818302; x=1643354302; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OE6wZQGKF5NjVuNViqgkr5UqZUb/ZMMrnmgRjBTexFA=; b=J4yQ9x4UhN5yHX7HbGUn1oNI6uZ51thgU/0lHJHljjpLc9lAON8JS6D7 NiL3m5x81H9Br0IFTOHML5clYMdxuPVBBatjpvmKPk1y/LRm4uGvhRgPi x2j8fbWSrh3C6oVunjkEkTm9zTnq9llUnJednZUek8Chcdfv8FclNy5u5 Flp4DR3QxxqohX8TS9UGgm3uDpB4fuDPWRh7BLPRONd7Cj/IwtjKjhbYP OyzNb9RJptgxz1t0S4FyDvX3l7z4/CeLkF5sXmTvxvPANTSr9JD6r7Get h3UN+6WjtQYrNTqFgzBRIwEd/wVUhl6rLjJNuqH+jJQqKQQLBMslSpedn Q==; IronPort-SDR: 3yDyQv1HB00GnJQRZ9GOQS/N00lDcFhPw0hURtA9ASq7uEWnljV6cgZ1Wjs4bAS4wBk2XxVsyL JGHWQcOidpYfN36agSFFsYn6a1bZaTQS4NVqoTtgw4Slr6AVEq8i1dd0FEgWmDS0rENuKCn6GL YdE67Uo9u1e8uwBrRvzlPnlXQqr7Vbypo34HBqNqQ7XUCiM8cHJgsXHDOLgCQqoFoGu6LlE5sn 4FscXZaLeRTE90M0ZPHylpW1Gh3wkbrhJe+xwV0l+3wfUasdwqX4DnBfqNg2fJU/23m5Xl38M0 XrU= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="262549181" IronPort-SDR: 9nz1wDPSH8MmDi/ehAaAxWmXqAMaCcUOEMuDJu46+7Iz6V9keiiEAICpB5vdurT/jC/nOjUgNc hUCOavs6L2SYxxLJzGa0n4t96TL5Go1lqMgZf6bcqEPOb1sSa4DPgXCQ7md5/6tNkj+aOGLp1t VCfQbFoa4WL54zggLKEz27AxnjZK7ZmClmW0pUqNUeIa3t+egcu80y0tZcb0y/ARUL7+Op5h/2 zQlJmKC1SpKnlJ0sZT6ZP8JRALdzaIIJxqcIZZ060Kq/PjXt6xY8f4Hk2q75yK0+Hf3ZNfpOXV KpPWkET4aaDKd3Z2KRRKwD/c IronPort-SDR: AdKYJH34AY4CiVzOXrR15FurWGZi/qDC6z/alYko7jfVcX/SfFhaxUFqHY45DLkP4HiXq60mY4 qy4n2aJHjpVtmV4fSh3ShuNif1qvectRI2b9x90Cd2PVCzWhg42ZluTJX4mv+bwQtY61xYcAp/ v9bG8JoB/eY2HEcD52Jlws++S0SYBgnZiIiDuQlpbjK+vhOG1JlBdY+QSI5Hl4fkjAcjiES8aY m35tunBPrJVbQ/UTOrTX0lDDjwM/GyWBlapp84/HLby91yE2yFuR9fqy9YimXKC2AojA6XdL7Z KBU= WDCIronportException: Internal 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 27/34] xfs: use bio_new in xfs_buf_ioapply_map Date: Wed, 27 Jan 2021 23:11:26 -0800 Message-Id: <20210128071133.60335-28-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 Signed-off-by: Chaitanya Kulkarni Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_buf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index f8400bbd6473..3ff6235e4f94 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -1507,12 +1507,10 @@ xfs_buf_ioapply_map( atomic_inc(&bp->b_io_remaining); nr_pages = min(total_nr_pages, BIO_MAX_PAGES); - bio = bio_alloc(GFP_NOIO, nr_pages); - bio_set_dev(bio, bp->b_target->bt_bdev); - bio->bi_iter.bi_sector = sector; + bio = bio_new(bp->b_target->bt_bdev, sector, op, 0, nr_pages, + GFP_NOIO); bio->bi_end_io = xfs_buf_bio_end_io; bio->bi_private = bp; - bio->bi_opf = op; for (; size && nr_pages; nr_pages--, page_index++) { int rbytes, nbytes = PAGE_SIZE - offset; From patchwork Thu Jan 28 07:11:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052219 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 1D67FC433E6 for ; Thu, 28 Jan 2021 07:15:52 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 C67D764DD8 for ; Thu, 28 Jan 2021 07:15:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C67D764DD8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76687.138509 (Exim 4.92) (envelope-from ) id 1l51Wp-0006LY-6G; Thu, 28 Jan 2021 07:15:43 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76687.138509; Thu, 28 Jan 2021 07:15:43 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Wo-0006LH-T5; Thu, 28 Jan 2021 07:15:42 +0000 Received: by outflank-mailman (input) for mailman id 76687; Thu, 28 Jan 2021 07:15:42 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Wo-0005xp-09 for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:15:42 +0000 Received: from esa2.hgst.iphmx.com (unknown [68.232.143.124]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d7a66c51-aa5a-4519-bc9d-05b32741e4b6; Thu, 28 Jan 2021 07:15:33 +0000 (UTC) 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:18:33 +0800 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:59:52 -0800 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:32 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d7a66c51-aa5a-4519-bc9d-05b32741e4b6 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818314; x=1643354314; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cXmRF2Su1ZKio9gUSME8BeoE9pXLYvn976s4DXPYmio=; b=QIacUKU9yyuXrFsLNOJ3/cAlWaM/YNuVsLyI0jzb5iCD9id30IEx5d8g Qg0WZBSLOZld9Ugspj+PCSDQ8DC+vwQQz6ivTxMPxiYJP3vkqA8ePHb17 mKbz675BbNRcr10onze8EhQ3PnP7KQcFfIlLJxjpdK3L3p/b+l5c7mS5r LiutP3d9tF1YIRj2SYiEJbbHo5zbvOGzpzDQXZKXoTb9dS3qGw0WdScBs 5Kn7zuVeQHe7R8HweBDaOMEtJ+iKkT8W7KlEMg63obkTa8/fLlpjnxF32 rdii4tLmI8stVf4d0Q4Hpcpp2ijDTfg4ePIcK2XMfeXCLP3KNntnxWl8j Q==; IronPort-SDR: +DeOHSiPuYXzZqiyAIX3LDlBHW0KIsbf68EHkSE9GrD05QRZOrlk03Yfgm5CJwWUthdVGMbUwy dKZsvQTGYjdKmFmEg83qwiiRFxPWI7aLa4+FXj2MY/vEPxOX3vp5N5vxIeB2c1JtSyJ5jEXqCI 8KGIicmmBmGNtkYRzYBdcUmu2Tu9Xmmr+qNb9zdN7bUCxUdIxqypReAimH4dVO50H9zsNjMO0M HK1ikRb+vDT3qfVV0QH7h0g0VxE5KpEk31o9hjw9aQmVscpEbk6AuB7YGDErOxL8wJjwiCr/NG fjc= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="262549193" IronPort-SDR: 9ERyHW2iXRv3pJTiHfQ6FCkvxQIn6RJoWyH5LT+UwXZT6ya7nLIzPeXSBcUtFJlYLbzJ1jDzxN pHV16noZdfrJgeYrFgZiSV9/HCaVgGMNxhaPnz3oXfu0fVwYpGlTH/1bmIIXWjjR2b9nT1t/4l 0Z2IC1wX2I3hVw8IlpAjOMZ7GJogy47Ic6kGXndqejrVNVoYa8f+ikzzvDphAHKl1xbxW+pbly uH1WBsmk4xtsYcu3MZd4HwNMp+vBKja986bP94zC3xKVEq5SqQYTyn/o9akXG36Lx7xn5fsdTW aUf4tCGYfqHI98qHkVuQcnZn IronPort-SDR: m+UU9TJBIXCvSyFz/7O2vaYmlOCexk8ewW0e2kOKkWSuwpQEVFGI+DHENO7Q1Bf8IQzN352Mi5 5dDETfg3/zd0aL0yHDjcbUD/eS6byN5dveWHS0JlUn01j5YdJYnuzvRhCyGEwEvsPLeiwlo6h7 h47UPjLb7UDOPAPFC4EqcqtJYlkeHUwpVqBF6C8WUdWbiBbzIaj0jcLgB21R8kA1PJHycwAnr3 51c0CVR8EMmKQ6pEvymjZcIoINYcADZvl3xn96JSQjk6KW59eeMqwpBFLuZiCrCp4Zkdz1bD1j kZU= WDCIronportException: Internal 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 28/34] zonefs: use bio_new Date: Wed, 27 Jan 2021 23:11:27 -0800 Message-Id: <20210128071133.60335-29-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 Signed-off-by: Chaitanya Kulkarni --- fs/zonefs/super.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c index ab68e27bb322..620d67965a22 100644 --- a/fs/zonefs/super.c +++ b/fs/zonefs/super.c @@ -661,6 +661,7 @@ static const struct iomap_dio_ops zonefs_write_dio_ops = { static ssize_t zonefs_file_dio_append(struct kiocb *iocb, struct iov_iter *from) { + unsigned int op = REQ_OP_ZONE_APPEND | REQ_SYNC | REQ_IDLE; struct inode *inode = file_inode(iocb->ki_filp); struct zonefs_inode_info *zi = ZONEFS_I(inode); struct block_device *bdev = inode->i_sb->s_bdev; @@ -678,15 +679,12 @@ static ssize_t zonefs_file_dio_append(struct kiocb *iocb, struct iov_iter *from) if (!nr_pages) return 0; - bio = bio_alloc(GFP_NOFS, nr_pages); + bio = bio_new(bdev, zi->i_zsector, op, 0, GFP_NOFS, nr_pages); if (!bio) return -ENOMEM; - bio_set_dev(bio, bdev); - bio->bi_iter.bi_sector = zi->i_zsector; bio->bi_write_hint = iocb->ki_hint; bio->bi_ioprio = iocb->ki_ioprio; - bio->bi_opf = REQ_OP_ZONE_APPEND | REQ_SYNC | REQ_IDLE; if (iocb->ki_flags & IOCB_DSYNC) bio->bi_opf |= REQ_FUA; From patchwork Thu Jan 28 07:11:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052217 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 C1B78C433DB for ; Thu, 28 Jan 2021 07:15:50 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 7374764DCE for ; Thu, 28 Jan 2021 07:15:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7374764DCE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76685.138503 (Exim 4.92) (envelope-from ) id 1l51Wo-0006Kw-Nl; Thu, 28 Jan 2021 07:15:42 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76685.138503; Thu, 28 Jan 2021 07:15:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Wo-0006Ko-K1; Thu, 28 Jan 2021 07:15:42 +0000 Received: by outflank-mailman (input) for mailman id 76685; Thu, 28 Jan 2021 07:15:41 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Wn-0006K0-CL for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:15:41 +0000 Received: from esa4.hgst.iphmx.com (unknown [216.71.154.42]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 55264d12-e0be-46d6-b9ac-490a0d653ba8; Thu, 28 Jan 2021 07:15:40 +0000 (UTC) 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:39 +0800 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:59:59 -0800 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:39 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 55264d12-e0be-46d6-b9ac-490a0d653ba8 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818140; x=1643354140; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mX0lBXgZV5dDDUNO5/xUPQTxA6WXojrnDbaB4rJIAQ4=; b=aaVLORsEGRgytiupj+H8u8Nwfro8Wh3jnZGjXcDD4jt2HKyp/W8ERIXp fQEmB8ar99oys/4QKD4tcrrQUi5sGkoM1TPci77eg8niu4H/UQKRJF7xu KazKuO3tqz61g7nyfZl+sAsXbjSqmq8Iz6yUbq2cwh0J/GKqg6NTTlJUW Yub6sZdsFGXQTXwUA2NDFDHVC1hcVkngxwoRiXEyhK0L/ACZRPo7hEM8+ UIGoinidpnrqFz9AHnIlAtP1yx7dx8L79GJwiNFw/pIZ7nWLPgL5W3r8F xsuNeovEl2ICMMBi09a0/fuW2gsLkovlx87gPzzhca5uipPwjfQQJ7fW5 A==; IronPort-SDR: NAk5m52GoaY29bds24u2KQ1qBvFn8Wa+/LcNmDWFgF8OYkvl53M7tYgY9bsXTvcF2Xrk0r1Vbg ophQVnMAMJZf/kH5eFdEYq+vuv/6rfLZCDAsFQyDSXkXnH3aOlX1RngvMkFkhvQuhC7vCMEB/q vgC1NmBLrTFqW45C6WXqsHW3S2mCTSD0EvptpsgvF6ieg4XJFhZ8qmlIywZFjX1kEhxKdx39Wi 4Y6Hxoyq/TBKKU3PhCHJ5yoJCSfUM2g7Wp5LzVs3faRk2SCoDUVkhyFf9P9vAlR0H+k7mKArmh jV8= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158517545" IronPort-SDR: H5QB8oH8qT7CGwyeMbvP6Jex1n5Ad0nKeXTChgPOMt6L0rK5j7qcLv9+EF3MyWUSHYnU7Vb/xL WPEi5+iUvwCnx8AG/EOFf/ZvPTkBTClx1hJwvbj3cxA2vxv/IJ9hR0FR51lJfElrqEL3cCpAMR Dd9DLyTrHZQcFYU9kC8VgFO2EUUnG6Zt7GttE/rX9wfuCG0LQnMSoqCU/cGPe5vzGAcFpnc9xe frL7j0+g+G9cL5BN7yx/sOJzbv9rL//AiKkqMYIOR9xHTytIaBnIotnHxqH3Visks1zAwVIFdH 3j3B/8WI312Hk5JgkTqx7Sx/ IronPort-SDR: +tiKd6++/IklFSy7iDJaHbayhG5AQMYy46sQaNwq7O80dac1IZ8ZNlxjx4DxYbXvKYV6ua9+Jn RJlpIO7cWN3eoJjRXIKMWDgWPb2hxGv4A2WF6qkOCUmJWGu679NggrholDw0Y/zhUvvPmDPwT6 YMwbiHmVzfz4ihKs4Lc84G8Ml2oUugQkKwA3saHG7RouPgTCEOWIbUjZGA0E7lav6RMiRyuWgb NQVibBmtLzaPM7sNDSYSURpVt5muhPgCfKQdUKPwhH4mY9hUDkI5QyIoSDd8h2S0Ai5kAfU9pn AHM= WDCIronportException: Internal 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 29/34] power/swap: use bio_new in hib_submit_io Date: Wed, 27 Jan 2021 23:11:28 -0800 Message-Id: <20210128071133.60335-30-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 Signed-off-by: Chaitanya Kulkarni --- kernel/power/swap.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kernel/power/swap.c b/kernel/power/swap.c index c73f2e295167..e92e36c053a6 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c @@ -271,13 +271,12 @@ static int hib_submit_io(int op, int op_flags, pgoff_t page_off, void *addr, struct hib_bio_batch *hb) { struct page *page = virt_to_page(addr); + sector_t sect = page_off * (PAGE_SIZE >> 9); struct bio *bio; int error = 0; - bio = bio_alloc(GFP_NOIO | __GFP_HIGH, 1); - bio->bi_iter.bi_sector = page_off * (PAGE_SIZE >> 9); - bio_set_dev(bio, hib_resume_bdev); - bio_set_op_attrs(bio, op, op_flags); + bio = bio_new(hib_resume_bdev, sect, op, op_flags, 1, + GFP_NOIO | __GFP_HIGH); if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) { pr_err("Adding page to bio failed at %llu\n", From patchwork Thu Jan 28 07:11:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052221 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 78080C433E0 for ; Thu, 28 Jan 2021 07:16:02 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 E7D0E64DBD for ; Thu, 28 Jan 2021 07:16:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E7D0E64DBD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76692.138527 (Exim 4.92) (envelope-from ) id 1l51Wz-0006Vm-Kt; Thu, 28 Jan 2021 07:15:53 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76692.138527; Thu, 28 Jan 2021 07:15:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Wz-0006Ve-H6; Thu, 28 Jan 2021 07:15:53 +0000 Received: by outflank-mailman (input) for mailman id 76692; Thu, 28 Jan 2021 07:15:52 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51Wy-0005xp-0V for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:15:52 +0000 Received: from esa5.hgst.iphmx.com (unknown [216.71.153.144]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id da9bff1e-c501-457d-9cf5-275f1f36d2d5; Thu, 28 Jan 2021 07:15:49 +0000 (UTC) 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:48 +0800 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:08 -0800 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:48 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: da9bff1e-c501-457d-9cf5-275f1f36d2d5 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818149; x=1643354149; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NNQh//SoJS4GqMqJS7HaqIWs/nAFaMjGpU2K0hvKGW0=; b=fQfK9wUdOyIrIsfy9RLLvC5xPgYcSXg3MNYnHSc9IsYLZx30nRHzIAUZ 294UUudQQlYk8gJcK/edZROZYlJIE1eNrjLm1JGiz/Q21FfSGShI1OpDG AVL3nWWtzIN++jlZ98TQAnqMod+6Ql8ECPGPLXwk9xo2jd9Tx5vttBp8A MKW1qB5k/Qt/1N/OTPnz9MYuOySMfX9ETamQAGkN5rbbeVBg424fAd1GQ hDTtCXp/Z9hfKKx9hoSKub7BrBRCs+yLmSqVgpJS1F86spUPwH+/QWj7g HR1yP3TJs98ynx2C6xmfLztXq4e7yWbpoTlZnnY6hLXY72FFMg4KLmomH Q==; IronPort-SDR: FIV1m0hqMjPv7EbDoudd3IU/sfM4dtIXVcOrfZP9FG6QS+qNV/cpHr7zPfe6cikVTuMAIWMrRE 1CFFIA3M2n74FPetnuW4UIXhHv04+NojRtALLIm1ShTbRzoMpJzodse0FT7TKA9rmpzDk0hf2J osqfJT1Hw13QCXwtTqc43/JeIOacFqdvj3uOE8wdnBhSuCJtni52KCfSDmNsSyMqak0NZQLmhb RVqXLrFPttVmJHYuA+DRTQ/CQCt7oxoFooNbcGq7LXUqJAFun/IgoGhOb61ZyQh4tY4TVzWgoL SfQ= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158518450" IronPort-SDR: s18G1HC83Rr3z3ZHjRbyNRB84D8eeJyfxEsQsWugvQYNm/5tp9Bykx2d0PDD1lJnqQ7n3ROCLB YSWyg9J7I6HqnB2NgFwMU4ssoB6tjGH/79230TWkDogzAEgyRx4yPiMRRDGGGJYtPzQqzrHfUY iO3zDWOiwemtUczZcPdewa4KogxATq3ygZIiw6li+/J7dkvbfEn3uGzNA0AnmVFzdIkRTnkjEr NZyMm+4X1MpeNq7dOG+OefxOr48EAZ8pX3UG1xjxSqFs9hl07ia08o8M9UC0qFD/6LvMa4wq1F GfS04fX+yByC8zurUKSx9scr IronPort-SDR: QLHAdyBGhpMGQ+9sBMvXF0omk88B/E7BRqUoQLtstkadK8XTqcLBOvZ/pjpZSQe5Fab6+IJLIs ck58Xl2YqFxcQH934VbGmHAxVZYNpxUZEqIAo35K+cwpiHURts0rCHDJ2TNufJwwd/0szVEfZu V2kbFpOqLyVucrhtvqpRhrkBznCSCkx3a3rZqsYu2xJ2ZrJKihugfXyvxYjD/F6eNL2QYyPhq5 GySOsYgZ6Jfrk4o/qsLABBe1b7+pVB/jDQ0aaMBZEhc+3I3KzSll4D3O/V1q5DDbYD+ht9Zxf5 kSQ= WDCIronportException: Internal 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 30/34] hfsplus: use bio_new in hfsplus_submit_bio() Date: Wed, 27 Jan 2021 23:11:29 -0800 Message-Id: <20210128071133.60335-31-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 Signed-off-by: Chaitanya Kulkarni --- fs/hfsplus/wrapper.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/hfsplus/wrapper.c b/fs/hfsplus/wrapper.c index 0350dc7821bf..8341ee6c9b31 100644 --- a/fs/hfsplus/wrapper.c +++ b/fs/hfsplus/wrapper.c @@ -64,10 +64,7 @@ int hfsplus_submit_bio(struct super_block *sb, sector_t sector, offset = start & (io_size - 1); sector &= ~((io_size >> HFSPLUS_SECTOR_SHIFT) - 1); - bio = bio_alloc(GFP_NOIO, 1); - bio->bi_iter.bi_sector = sector; - bio_set_dev(bio, sb->s_bdev); - bio_set_op_attrs(bio, op, op_flags); + bio = bio_new(sb->s_bdev, sector, op, op_flags, 1, GFP_NOIO); if (op != WRITE && data) *data = (u8 *)buf + offset; 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: 12052397 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 5096FC433DB for ; Thu, 28 Jan 2021 07:19:58 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 0172464DBD for ; Thu, 28 Jan 2021 07:19:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0172464DBD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76733.138564 (Exim 4.92) (envelope-from ) id 1l51an-0007FG-Qv; Thu, 28 Jan 2021 07:19:49 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76733.138564; Thu, 28 Jan 2021 07:19:49 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51an-0007F7-L5; Thu, 28 Jan 2021 07:19:49 +0000 Received: by outflank-mailman (input) for mailman id 76733; Thu, 28 Jan 2021 07:19:48 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51X8-0005xp-0u for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:16:02 +0000 Received: from esa1.hgst.iphmx.com (unknown [68.232.141.245]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 6c077183-3313-4dcd-9118-ffda31c970cc; Thu, 28 Jan 2021 07:15:56 +0000 (UTC) Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Jan 2021 15:15:56 +0800 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:58:14 -0800 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 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6c077183-3313-4dcd-9118-ffda31c970cc DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818156; x=1643354156; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Y9+Mnjxua+V7f2wybPN6k7Lk3+3v11itMxG4MZ3QMkM=; b=CsawMGiqvoAV9E1wzdlqWHzFa/o/XTDpW+RwCvV6hN5B7lfpJX3nqqqg IiwDkVPjYFNfvaPy4ZvlyQAC8SSwLkvUl39gPNHV4Y2KySVtVmf2G/21K rgtqo5PZyyusW6hD9cXQjLerpVixKAUp3XCf3d03f5wH00jGJcK1HgiFw n9mvFFhsFY14nG2/yx/+EpZ1U6tGLPFivP/qBIAJqnNnlmma5XXLfop9H 0TW4Ols4UePg9AdlsX8kunQ+grhQ6ue+VMUZius0QI4fuzLcerS3QxwnH FvBm0N0bmWPIN1T+EY4U+CtmvzvVNrPCSh/CSvwHx+1oWhPo6OY2kqQe2 w==; IronPort-SDR: 8EemiGUR/Lt+s9KCVSzppInI5P2SsG2w6RJRXUX0+HLYGkqpb+IeibZbb1m8yqLJ8rE1QNPYDc TG5iJoHgw8EYFfoff/LCvPiHkbvPZNrVQxe74PkI17nBMIt9bHfhSt/2l3jnPWJiAfTK3LpoZe E26lQya24uGpGgRyzBcF77l49GQj1hvkoD5fRIlBj3UlyFC5pIOevvxPF/49IJLyLUigijBDf7 /XRnRXheRwVMRXxvYRPrF71nqBtb2w3cpyrannM8XumLS7K7YkbmEu2DNGHcoFuXVOMXUTGNsl qcM= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="268892708" IronPort-SDR: Hk7obHlDXWo91j7YJHosOOiKVsPbGtO7cFr8RDApjJ+ffY/3xP4Er8cCd9NrMjI9U2UrQdbZXk mDC0jlUQ18cOryhI1Upz8EVoEwm3LJ0ySK9ulE3meo1/rIWuP6CBfNp6Y9Hb8KmLVRynSCTfep EI1XdxpdJRe9lhlW0Xau0ca866/fUBaVpwpIK/HMif5/AHGaHJjCdaYnVd7F42TtPFk8+hK3dC HMy5P4MvPRDY5suNXoidrxC76XpQ1SiePw7B0IzOKnp9/2ATeG//8Fvj/qqQZvvFkhdBPm4Fzl G8eeZgDmxKQSkr1MHtNIRmok IronPort-SDR: MJghY7CI3VIGR5/IaW1FKfL3TP8YTcGZMlKgwb78Me3B/B/3apRuuzh9zoIBvsafPZo8P1zI7O tvlMLEPWxNEsao+d+OWmeAfzkHQtyrR4CezWVDYJlrvLmf+2864qvNG9WiZqHSu38lUOwqOgWr BwUEJ5wQyzZ3OCyeIORv7uUc6VzLa9ZZ6RiC/IlKAQuXNbiGRl7btRhvnWciISjEw6c6WHvSr7 U7MWRK7LEz7DNkLYA3LIdhi5N4PJW+ftjhgTNZ5eyVeVGIhgT6If8NwOmXnpUTI7IymY6dp08v 5GE= WDCIronportException: Internal 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 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; } From patchwork Thu Jan 28 07:11:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052223 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 8AB6DC433DB for ; Thu, 28 Jan 2021 07:16:15 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 3451664DCE for ; Thu, 28 Jan 2021 07:16:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3451664DCE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76699.138539 (Exim 4.92) (envelope-from ) id 1l51XC-0006gJ-WC; Thu, 28 Jan 2021 07:16:06 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76699.138539; Thu, 28 Jan 2021 07:16:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51XC-0006gA-Rt; Thu, 28 Jan 2021 07:16:06 +0000 Received: by outflank-mailman (input) for mailman id 76699; Thu, 28 Jan 2021 07:16:06 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51XC-0006fc-0X for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:16:06 +0000 Received: from esa3.hgst.iphmx.com (unknown [216.71.153.141]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id e38a72d0-0936-4680-bed6-26e690e5690e; Thu, 28 Jan 2021 07:16:05 +0000 (UTC) Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Jan 2021 15:16:04 +0800 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:24 -0800 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:16:04 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: e38a72d0-0936-4680-bed6-26e690e5690e DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818165; x=1643354165; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gllqHMP2deuE0vZ0qLUvAasM9UgJt1wGssSRSahQx/E=; b=hOGHLilUmvGxftol4u3kaHh/IdpbjeATrhmzK2p5u3wlcOEAGVolUwiC ijbbza2rMpSD0nIG909thINsbBpAouH+uSekpnwnBUg93ZAO3U5auD88H CFORGFo1Pr7Xk67T7/tcRqjkXscVFk6dzsxMBM3CoKEb9K0KOU9o7mBFJ IsOW2SrDDadHEZSq75JiQrHdn930EF8m8WAAkQvrdsRQfGVQoLs7M15rS eZRPONG5dBLWI5EafB+spMp9kR+MX7PmUiZNoXZcTeDAEJLwPYPyQD0aK YM92r0meR2GBK9vsqgfmuJsMzaGILCu1X5kJ7zgepRUgzohRH4kNV/HO2 A==; IronPort-SDR: PwpobEfXVFVYNxMCZW+s8LVBPiIroXcPwZX8FsLdcKpxpVwRvuvW8IxtYWUzqCVHRY/5nTUVrA bnFe824/o1W4WGh4wkGnbGNJbZa9ZH5hGcRmZ0tVfK+77nknCuBKmONRJLJVmlhJz9zFkAZq0D 2QwQUoWX/E4ZB1cmKz3edOYGQlOaoAFpFOLU1WpssxuBMvNRjbWM13gmN+wwsxJjKdRrM6WC+v z+rQsbXUnmuuv+oPaLMjcsox/TTCqFa9HnAWZszr9ScwmQ91U6TTDiXcQhPfuwXgTeFTwCoFY9 BgE= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="162963502" IronPort-SDR: VEKRuFcsLm/Q0MjdY0M9eudgf0sjdnap8GzqN+mYX7s9bFJ6JK/Lk6mcInC89eqa6HqMn5b3CL IS17IOKmVfx3NQgvZS3LzAlRy8oM8E9oU2pCPa/gjLxWlriFnUHrqdWRe4L9kT9hiDYyT0vSYK gQLGKep8e3Fl79Z4Lp0Xxpl+AiNbkB1UyDUpzVgBvh4gB9gB4J7ryDFMtZsmhFJXwVqHB3Nwl7 mPvIp9iX6uaPUswlkKwt0kv6hofeW7ceB/FrBvyI1QGxbZ4wnrkGASe4PQgYV+CtK0omxAC8DS 3ee4eekYGKVP0QITOlQYPj6y IronPort-SDR: Grws0RkRukNGo7nyou8ZmIctRPf+YpsLcKEKHc3Y9j2gH1wu+DvtqTycxE/+Um75XSsvYHsJz2 XuCl7g+xJPknbJtkfE6+aL2ksGkx9esZlvJSCaOOok8lPoOpNpuMTJUvJF76PXh6twtzc4hV4l Ck271Nzyl0bN3jPxPpXSp854weGQ+wyoheQ1qJh2ewh7GEZUQlec6Cx5gMyzUS7NDfOacpsNSA i4cQzL4qbQiTmP11yVUjlWBUXU4/5eKNIGO+C/0onsAsvTsPxAAYkHYwd4fug7gJV2TpCU6JnF 3ZY= WDCIronportException: Internal 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 32/34] mm: use bio_new in __swap_writepage Date: Wed, 27 Jan 2021 23:11:31 -0800 Message-Id: <20210128071133.60335-33-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 Signed-off-by: Chaitanya Kulkarni --- mm/page_io.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 92f7941c6d01..25b321489703 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -342,10 +342,8 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc, return 0; } - bio = bio_alloc(GFP_NOIO, 1); - bio_set_dev(bio, sis->bdev); - bio->bi_iter.bi_sector = swap_page_sector(page); - bio->bi_opf = REQ_OP_WRITE | REQ_SWAP | wbc_to_write_flags(wbc); + bio = bio_alloc(sis->bdev, swap_page_sector(page), REQ_OP_WRITE, + REQ_SWAP | wbc_to_write_flags(wbc), 1, GFP_NOIO); bio->bi_end_io = end_write_func; bio_add_page(bio, page, thp_size(page), 0); From patchwork Thu Jan 28 07:11:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052399 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 793BFC433E6 for ; Thu, 28 Jan 2021 07:19:59 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 2AFD264DBD for ; Thu, 28 Jan 2021 07:19:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2AFD264DBD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76734.138571 (Exim 4.92) (envelope-from ) id 1l51ao-0007GA-5x; Thu, 28 Jan 2021 07:19:50 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76734.138571; Thu, 28 Jan 2021 07:19:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51an-0007Ft-UP; Thu, 28 Jan 2021 07:19:49 +0000 Received: by outflank-mailman (input) for mailman id 76734; Thu, 28 Jan 2021 07:19:48 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51XN-0005xp-1b for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:16:17 +0000 Received: from esa3.hgst.iphmx.com (unknown [216.71.153.141]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 92279879-bade-4780-a7c9-ef19f5d031bc; Thu, 28 Jan 2021 07:16:12 +0000 (UTC) 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:16:11 +0800 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:58:29 -0800 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:16:11 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 92279879-bade-4780-a7c9-ef19f5d031bc DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818172; x=1643354172; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mzuBJgEjO7736zP2e3T55gtpCfO2cszPJHhO/o9ayC4=; b=lsRfQ2jjI5d+6cWPC2TCr7VUcGR0BLYsaMFCDVh13NuenqAB1zRrkp61 UAk4xXhQTIV7XwigoJWAs3IDCuvgRVFJVU1g8+iC+62x9siVnRA1fXkod 3SWLcVn/92/412NUkzW9l7Zpj0zvgQ9wk9aA8pBdindTEv8tXXFHdmRkZ o5LcrNs1ktImif77vfkak4sLfu6k0uMg5YAS66Aszdu+5uWtn16cbnIok aNVuDNv9SlN7tKBq+EVYV3d20yoe2xJeNxon1GYpJW+wMMETb4y1tcIhf f6PxGkORJV/9lsxiwo/znPO4n912EkzsFaHmUcHdRMur604l6RvGfbvfE g==; IronPort-SDR: 13aMzD5B30suQ0EUA9uB0xrjaohxw1peRDX2LmTYLbVLBLKrUk7f/OqoS1E83lhys8wXZ9SCwt 18tluODWPypY6UQGOgCEeCPtiVcMe/1Ks4y3TFUYjpF5a7cfKutqA2GYNg7WZ3D1z9oeTMivdX oqoxJth5ZpQMiRDvxeSmTSylJVjCJpwSmneqJO1GfqwIPH/DK9gJLWQ1qjGM2UlrhoekwM5A1t Db+T1QLrJ/ZpOdROIWU3s15b1JBSpaRZqQ1pqlMg4IdansaV23awPZinV03fP+62vcPWAzl6Fe 11Y= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="162963517" IronPort-SDR: vyex7oJdlSE9DmCxe12rWZzf7D0IhWESRbEnG+ugtUGicSX77dov+e4iAzm6McZTQnYMWdwNxO se5C9grs4q6fHPCIUcRWczidVREGeItmthVWHgJp6WWTx2jUU+UO14Dn+SpUmbJmz9tUTu5SLQ GburUybr11twBzaAP0Qhab5s2D+qKbUEJiqpZFbj0ewC7WCTB2OXL4X/xrFwsJQ6HOF3gCIgO3 smJGb/hRLxrQZxjk0/PqZ0a4UIifATCY5pL7iOAxeRvRVE1fzTutX4ZHk267Q9Lg7fCZb1+57Q 86wub+K/GVDYJSPHHA8Lw7eh IronPort-SDR: g9DYrZw82vrtcoqwLuT41C5LPwtay4x47njX4TQvn100PG3qzIQDYIPSbD2aKZ0nambVfkCSmu JHC6z8/1ifbcXhuz1R2nfguMjBFRQ4RaTCr3wehJDb3ERuWQ1NBrP8es0szoYDQyY3216WdfEV JcMopMzzk+/Wudlq5O10ELulyKCOeTk+PuDGw5+9rtJas4CG58lZZY6nLuQYmFyKdDpDYbQYnL x05lIaxi3M2yfAJSgs6mfnc20aeVZIpUbieSq2c4z3+si2ic8ziehclZMxZZAWaM0XsUZa2+hJ /C8= WDCIronportException: Internal 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 33/34] mm: use bio_new in swap_readpage Date: Wed, 27 Jan 2021 23:11:32 -0800 Message-Id: <20210128071133.60335-34-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 Signed-off-by: Chaitanya Kulkarni --- mm/page_io.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 25b321489703..7579485ccb5e 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -342,7 +342,7 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc, return 0; } - bio = bio_alloc(sis->bdev, swap_page_sector(page), REQ_OP_WRITE, + bio = bio_new(sis->bdev, swap_page_sector(page), REQ_OP_WRITE, REQ_SWAP | wbc_to_write_flags(wbc), 1, GFP_NOIO); bio->bi_end_io = end_write_func; bio_add_page(bio, page, thp_size(page), 0); @@ -406,10 +406,8 @@ int swap_readpage(struct page *page, bool synchronous) } ret = 0; - bio = bio_alloc(GFP_KERNEL, 1); - bio_set_dev(bio, sis->bdev); - bio->bi_opf = REQ_OP_READ; - bio->bi_iter.bi_sector = swap_page_sector(page); + bio = bio_new(sis->bdev, swap_page_sector(page), REQ_OP_READ, 0, 1, + GFP_KERNEL); bio->bi_end_io = end_swap_bio_read; bio_add_page(bio, page, thp_size(page), 0); From patchwork Thu Jan 28 07:11:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052401 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 B4B5CC433DB for ; Thu, 28 Jan 2021 07:20:12 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 605DB64DBD for ; Thu, 28 Jan 2021 07:20:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 605DB64DBD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.76736.138587 (Exim 4.92) (envelope-from ) id 1l51b1-0007eL-Jd; Thu, 28 Jan 2021 07:20:03 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 76736.138587; Thu, 28 Jan 2021 07:20:03 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51b1-0007dk-GF; Thu, 28 Jan 2021 07:20:03 +0000 Received: by outflank-mailman (input) for mailman id 76736; Thu, 28 Jan 2021 07:20:02 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l51XS-0005xp-1n for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 07:16:22 +0000 Received: from esa3.hgst.iphmx.com (unknown [216.71.153.141]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 46873ac7-7b59-4e8d-9007-43eeeef2532c; Thu, 28 Jan 2021 07:16:20 +0000 (UTC) Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Jan 2021 15:16:19 +0800 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:39 -0800 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:16:19 -0800 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 46873ac7-7b59-4e8d-9007-43eeeef2532c DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818180; x=1643354180; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KxHF3VRS1HdpvW1dkgXeP6+bfyoqSsbsdMU7tIvbgNk=; b=iu5ToMmjT3V+P9Ny1GeOrvLZwd+2H25WQCLIKVqZdtQm2MU6AWv/VyAi Es0cUQMeQmJ2MqKkhhqEHSN5xcjDOtoQLLRP5JxEf1Wc7Ej4EMLam5arl WNOG96BPaDQCyl9GlZkLEtiT82Y66Q9d25A7pvjMUw03MfQcQiuBpVU8s NoMRDzR51Ppb+LXMOMF3hoYx5l0ddpKdoXAuCpngqtxkiKepXH0FDHeTc EceQlN1sRSPUcuzt19KSnLgAggitJagrFoZHxxZo312+mfgwFabcpDFAu TFJjk1SHmt5Zo51SvpH7JSWFJPh3R96+Wkp4CZUEEgHScfQy5iTdEzkqJ A==; IronPort-SDR: 3pkBAcaoGuzV06ZtFef2zlOmet03jibTng12LemyungsglWByqz0lAOXHs/dgDdf6Hmxp3U3mK 2PBv0jXUnSSZKC2hBxLtb8U8XgKI1ypp5ohV8zjEND2/pwge+FS3O6eVrd8bV41JaQ/4Ozfmao EnR0W4YVvaNDpqdNFQZ/eHH36r+Zf9857F1cLnc+pFS/4xjmdd7zTscnH0/o42q0UQD/xCBwm0 9Lj9jZn75uxqMCSvHQM8eJI1DeQzDDMqshwRvne7lh+FXFp0wLFu/wZyw5AsOqqGxzt8mHZQg2 cXs= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="162963531" IronPort-SDR: 1LA7JLuevG4sT6KnJTsZsAaEQzYUxu0PSeh4AyFNx6wcL6cUqYUDuodSGWXGu2OHuYZeBHfVoe XOjZBvQNOEyVrm6UpvGNZfqUgyWtMvIc4dq/IA/UQhv3FWQUbbtIYkr7LdaDowEmx/blflCYQj h3wDra5qkbM1aFk81MrE+9gb1+MnImKxNX1fi2j6J6FU9D7psBjL1QhZ9rMIs5kr9QGVfHOB+7 KCKhpgru2+vjZTcck6iQM7J28RwtRjHz5UEHrIVsJkXjru9KqamZhA4MnvUaGuOX0TgXZGzFoS p71m4ds5sYou8SgOWEM253xh IronPort-SDR: e2VgktU8Igp+G/4kwCau3Wofn5lcroMY0YPC7tNcu39YNL7JBNMa1+cKXT86WcuzihvSj94J7W 8sv8AfyOojzHeLFV1vgVT8Pm71/iwcQAmabu9Ufd/jwBkzWKoKpTzhJn2DWIwNp2e8mqIx3G5A LS7tN5JWZnYOGTkwZ/LMhdAEhsm6g9R10Edu6WiLHx+xz1R0nO/OSJcMH5j4uo+XVYn8ORNhbv mynrcW4WJ2Z8dThUFTylCCg25lF4TIegFSZNE+eSh2Iz0rquG/Dk4lImC2ZggxF5isWDJ8MWSG Bw0= WDCIronportException: Internal 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 34/34] mm: add swap_bio_new common bio helper Date: Wed, 27 Jan 2021 23:11:33 -0800 Message-Id: <20210128071133.60335-35-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 Signed-off-by: Chaitanya Kulkarni --- mm/page_io.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index 7579485ccb5e..cc30c9a0b0a7 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -287,6 +287,17 @@ static void bio_associate_blkg_from_page(struct bio *bio, struct page *page) #define bio_associate_blkg_from_page(bio, page) do { } while (0) #endif /* CONFIG_MEMCG && CONFIG_BLK_CGROUP */ +static inline struct bio *swap_bio_new(struct block_device *dev, + unsigned op, unsigned opf, gfp_t gfp, struct page *p, + bio_end_io_t *end_io) +{ + struct bio *bio = bio_new(dev, swap_page_sector(p), op, opf, 1, gfp); + + bio->bi_end_io = end_io; + bio_add_page(bio, p, thp_size(p), 0); + return bio; +} + int __swap_writepage(struct page *page, struct writeback_control *wbc, bio_end_io_t end_write_func) { @@ -342,11 +353,9 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc, return 0; } - bio = bio_new(sis->bdev, swap_page_sector(page), REQ_OP_WRITE, - REQ_SWAP | wbc_to_write_flags(wbc), 1, GFP_NOIO); - bio->bi_end_io = end_write_func; - bio_add_page(bio, page, thp_size(page), 0); - + bio = swap_bio_new(sis->bdev, REQ_OP_WRITE, + REQ_SWAP | wbc_to_write_flags(wbc), GFP_KERNEL, + page, end_write_func); bio_associate_blkg_from_page(bio, page); count_swpout_vm_event(page); set_page_writeback(page); @@ -406,11 +415,8 @@ int swap_readpage(struct page *page, bool synchronous) } ret = 0; - bio = bio_new(sis->bdev, swap_page_sector(page), REQ_OP_READ, 0, 1, - GFP_KERNEL); - bio->bi_end_io = end_swap_bio_read; - bio_add_page(bio, page, thp_size(page), 0); - + bio = swap_bio_new(sis->bdev, REQ_OP_READ, 0, GFP_KERNEL, page, + end_swap_bio_read); disk = bio->bi_bdev->bd_disk; /* * Keep this task valid during swap readpage because the oom killer may