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: 12052249 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7AACC433DB for ; Thu, 28 Jan 2021 07:11:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 629D864DD6 for ; Thu, 28 Jan 2021 07:11:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 629D864DD6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EC3536B0075; Thu, 28 Jan 2021 02:11:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E72326B0078; Thu, 28 Jan 2021 02:11:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D3A146B007B; Thu, 28 Jan 2021 02:11:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0064.hostedemail.com [216.40.44.64]) by kanga.kvack.org (Postfix) with ESMTP id B6E936B0075 for ; Thu, 28 Jan 2021 02:11:50 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 8102A180AD838 for ; Thu, 28 Jan 2021 07:11:50 +0000 (UTC) X-FDA: 77754313980.16.seed23_39002252759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id 5F8FD100E690B for ; Thu, 28 Jan 2021 07:11:50 +0000 (UTC) X-HE-Tag: seed23_39002252759d X-Filterd-Recvd-Size: 10232 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:11:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611817909; x=1643353909; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eWet3+GOqUNRw+dCyihtl3LTOeV3gTTJDd7Ea4w+clg=; b=k9B9ZABnOJcIfonxzYAKg1ENMhTQqwGMZI4RCE3B29YMvMShhCRUrCyH 1QlpTOOTWAuYx6+RA+5f8W0iYR3hqSBkfRccTtMEhIefeg0SJB98iCfbF GEPgWxYQRZ3cX+LvAZffpQMrxwzifFxczx+9f/E3bZaxAQINEmRvevGsh Qf4SQ0czNO/gaotZfWHnF0y6hFeh1qX6oBgOs4f0eqPLRfTNpqThCI1Ip M68xieSYvAq1B9gA2mBmS7vgnvQYQu0+0quXFHP8PcmsVM5V/sPzSdZdQ eZDkECLvPwM38ybXOqR/DG5Yd1kC+f8n9FtLzuy6GYv7pvrxUt3dsHRpH Q==; IronPort-SDR: BGuhBrCaR1buvimGq/xz3hO+byuXmNvjhtyv+TbMjVMvRRcR6+JRCyab5X+ZLzU29iW7BOG/0S NEJ0N6xAdEIu/5D8vcetI+dy6D3xvNvUXNNKrF9/DidjJRbq7S8FjO7Tct4YcM36l8TY8ZCKOP WkqW/gY/paLXzx2Erw3G0l4nrw56k9xTC/I4dvHa25cguaVbATiFEsWpnDLPPYJhXOCblv7FAt KOVgPmmXE/2OpdKKf6ajwEgRRnu+oSmgfWOQDPllfMEpwTpEeXiKjCbSpndweXeud03pZKLSji AK0= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158517986" 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:47 +0800 IronPort-SDR: wmJHcj+7WqNqNidnPMdnETCfGxUdC4fAzypwspKJcjlG5mFsoTzfB0WJ+DTxAXe70lIfehYng8 rg5iSWh/oIdBsaXe7b8f/9XiXpiV710rim24t6Z6EOB6Tzrp/4nGqc3Mn4kl15xThq4gNv8fhB HHQQglaJ6Y81A+nxVKvLLKlL9yUapzL+siJI5XArwLgcpw88lmhEFO651BbGBWbK/hXL+jMhAU 3AVtVg2yt5Qoa3vF+p6bP/n0t/IoRyveJGtkocdIiVlL4nuLzD07N1w+vB0JYN4x2+dRl/4eki g9sinxv6ZU+Bj47hEqSsBdJe 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:05 -0800 IronPort-SDR: UO027L+w2LmrSv+r4jHc7V6MfhclxochZ4q/gKoOnHb/alTZT7F9/4KjZrNCZAKJPJHjEl8zjQ btfDHq8ntGB6arYkxikoGObA79gqCi3nJZAFBbpTjKtHzOWqNheZit1SHeKrnOkOlZqda10wHA lKzVa+peWlZiSXNoZnitf2s3YH424/Lf6Od0Q5TvGZLxtIxoLSsxIGie29rcLN/atLab1ULG9S UmjXPLLRWItiporouoLkwAzUh8fELyClcBeyT3S1PWdOuFAmZ6ShYxhRystXSbBeBsPW0LixEL geY= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:11:46 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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: 12052251 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09E68C433DB for ; Thu, 28 Jan 2021 07:12:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9322D64DDA for ; Thu, 28 Jan 2021 07:12:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9322D64DDA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 218816B0078; Thu, 28 Jan 2021 02:12:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C7F86B007B; Thu, 28 Jan 2021 02:12:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 08F336B007D; Thu, 28 Jan 2021 02:12:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0152.hostedemail.com [216.40.44.152]) by kanga.kvack.org (Postfix) with ESMTP id E44396B0078 for ; Thu, 28 Jan 2021 02:11:59 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A5512181AC9BF for ; Thu, 28 Jan 2021 07:11:59 +0000 (UTC) X-FDA: 77754314358.26.heat75_0703af82759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 77CE01804B65C for ; Thu, 28 Jan 2021 07:11:59 +0000 (UTC) X-HE-Tag: heat75_0703af82759d X-Filterd-Recvd-Size: 6648 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:11:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611817918; x=1643353918; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1Q7huJyMDOVynURh2o3jolV4xRilOq3cl8xkF29/liU=; b=U+cC16W/Y6rD6CKWD76T1+MSeGGxh7IGRgV/A/1UujQdP5WxIL5Dgom6 c70i/H2LgI2Ir6aeXOHEMWa9cL8/WI7sRlx+2kDPqLF0KVYcGzdg+ei1H EyO/ed7YrSmIfN2wpMXgvFpD2xVtCOfKgeoxXR1k73Dfxuv2vUh7gpHXf 6mZiel/GuYrHgqIbIw0P/4QGjlUuFdIT+yTg9Kj3pgCaavPzsiKEPx5vS hlnImhuMQjLxbMK+0d1pnVCNA16aQnkCIBoFXQq0aThQ/IyYaexCTZ3ct 66b3eT0i7ZP8tSxt6Y0Ob3NA/58Q/UZts14XoIHG8NvIZkKFdFpbgAOyP A==; IronPort-SDR: Mt2cz5r/c15Qcx8q2JVPXPSTbE9ePu2Q4Isk3Cd2Ar5ibn7ppo4Ec7Rczx/PGvJTYWqpUbXXe0 xguRImpEvvYUl4Vv9uogiQ0lyEuJbf3TOEwKtaJrvWD1Q++ROtv+kolo7LtZpuAtvkjPrpxCqv XAUmx6NGOjJX04ae61LImYpJgyZ5cViGgv0kKmyvpvn1K3yq6INdcrXQhrbofLi68BWLp6MLmy PzdwkikfR0gSoJwcY/OmSA3p83rKzwLfnIO6vdborT1l2SfgzHxXC3WiuNNWajy5nAPrl7Q6rI 3hE= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158517994" 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 IronPort-SDR: HtBuIYRGChnvhUJh1zbP2ISMEuQoXK4EQrt29gDUyuM+f3B+gnRi21iLib8nl8jbeI4hQ2S69s G9w4rWXaNrd2FwByeLF90UHUyP7wf0Hx8Ogodq1+f9LscdpiCz0BYouBA0UFsKyxUhNdYKJ7SF SrIOgr7Lyl9P/jpA3haBCQVhAZgt0z4HjWqjCX/UdQt5HxpMizbxAzpC5mwQGugwRbjWprJhTx PqYJ6hlNDM0Iad95gK1lQHNcRQgZcM8VlB9jepMFKrE65KgfhUp4ZnqrJWADogcCYtaPqFq3uF /Jopj6/D7uAILbV6TTValpBu 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 IronPort-SDR: HYKG8+pmcZ9KZ4KZ0ijEvKFdi7W0dgGDXHFsWIaWNxW3zaOZulAuYVmKBU97gor6eDg6ylP5Ni 6/ahnxe6yM79ewZwsqKvrfMjvqQiAhLVOYCtlxS8Bh1Gz/vhwXPlVRnl4SwtLQD680yYKL86EL o3y724i0cbqHM9ChTIb0swq0MYuYoJx+iwqVjQ/XkVzNSKEtJ8uwRbdybmRUPVMHWHGtPAl98+ IjNd0sVxBZiY+I2eDgAQpiJ9r1dqmBNoZAqnfBCkqleNy/DSVZGKQaXDO89s0wR1FlZS/ZCSSd 5w0= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:11:57 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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: 12052253 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4338AC433DB for ; Thu, 28 Jan 2021 07:12:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DB73364DCE for ; Thu, 28 Jan 2021 07:12:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DB73364DCE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3EDD96B007B; Thu, 28 Jan 2021 02:12:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 39BA96B007D; Thu, 28 Jan 2021 02:12:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 263D26B007E; Thu, 28 Jan 2021 02:12:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0199.hostedemail.com [216.40.44.199]) by kanga.kvack.org (Postfix) with ESMTP id 08C206B007B for ; Thu, 28 Jan 2021 02:12:10 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C544D8249980 for ; Thu, 28 Jan 2021 07:12:09 +0000 (UTC) X-FDA: 77754314778.08.sleep48_580ab9c2759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id 9F1501819E621 for ; Thu, 28 Jan 2021 07:12:09 +0000 (UTC) X-HE-Tag: sleep48_580ab9c2759d X-Filterd-Recvd-Size: 5742 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:12:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611817928; x=1643353928; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jUCaPFeDv057fdkiILPSRkCuXPSAzqxSiECC+FKJaMI=; b=pc8+QBXzBiwbZ9gbiWD0mw+OnUAm5yg/VBC1y8ntqAVVshIaTzr9Vbwz gG4aOQx3iHdSmEPX0YH6pjzGLmifiIyKN6YhfSXr5fEULrE6AkKFchwTz BS9NHmtvyyCj3RbNi4Lt7qIKc+tzD+a6TNP5s6wLtbp0c6ZTGGbVorC3+ 7p2KZRcGtr5vvZc0KAMJFPtIL87pfX4Spy1PSQKM/lERX2ewq3XgHmr/T MHb5WfWC9GIMel8QyHr4hM8dZu5lyzYfR7c5GqWKsdGoIiNV6EhfH0+GN Xol2JdBr8BIdwx0JqKgubwo92NC/F4eyJV+h0CfPzIlqhWnTbpyPOQ5fn A==; IronPort-SDR: krN7rtbePNVNjQAriJkXP6FS9WK6ArhIVPB+cHHSVwANVIdybhm1vx/h3jBkkEIGdf81awa2Oh x+QnzhnRjTiEdnIsWGFg1CQb3X8nI/blP9fRZ7R9n5WFwqDMkKUGcopf7/m+UIORiaySvSm55b 17InxMTfXvTEqlnRzmzym6Fr+C+pSgViPcmiqjRp02kvAGUMyQctmfatZQhpLssL37sDEvIrYJ gqjLI6h6VrqRAEpQXWlQ+ZvjYqbdopMyh83Aay4JLBDfLqAkiLiSqz7+dYyMnfkx3IXezsGQCh CE4= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158518029" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Jan 2021 15:12:06 +0800 IronPort-SDR: WNswR5ikoGqaOEK60eMyJNEYabruJ/iGyYE3L7jJSv9Zo8UydWHP2nvjiJcS0fczt6RVniDpKq rBLECI2r1agOSy1y4Bww+ISbFUyFF5LduGPCUZyqAKWDqm3U78u1CXxs/xXbGAzHifts+AfrPJ Dg1JGtL9xVq6E/ANSVZgYFmwzNhy/tBGE/SwCjtAAfZWG9jgRoO89tnAql7MLfJKLU/oB/nKym RvVNElu4iSG3N4fh+7O4wB2KwY84Gju6rH8rR1sbnKQV3xZUItuSwM3SoayZQWNg64j3uGO0oc lGKY5n2cdJPTy4J9XD2gjfwl Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2021 22:54:24 -0800 IronPort-SDR: d5xTirF8Ys37shQjxL90xQdmAvrvSyaDd23k+ldZQk6g8Gmyh3lDvEoGm16xcyp5mSBaZTpxOa PvC1PFp6twA2TpPlG+Ql+/AG65S9RMLgGFawcQCbg9J6k/x2AMPUiKYtsSCC84Z+EGYfmFKoID N3xp6Srvi9c6y+EZp98pFBd59WcY1NGSO1F5aHMorlNIT26uZMyL8pegMXpgjACziNosRf/+TT qFeHE9fwJbeXCBkPpJ7sXhYMSQdfV8ojzZIb3gXAYZT1zkKG2mcOAVOk/sf7gRxWJd9WgQISSA lhk= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:12:06 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 03/34] drdb: use bio_new in drdb Date: Wed, 27 Jan 2021 23:11:02 -0800 Message-Id: <20210128071133.60335-4-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210128071133.60335-1-chaitanya.kulkarni@wdc.com> References: <20210128071133.60335-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- drivers/block/drbd/drbd_receiver.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 09c86ef3f0fd..e1cd3427b28b 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -1643,6 +1643,7 @@ int drbd_submit_peer_request(struct drbd_device *device, struct bio *bio; struct page *page = peer_req->pages; sector_t sector = peer_req->i.sector; + struct block_device *bdev = device->ldev->backing_bdev; unsigned data_size = peer_req->i.size; unsigned n_bios = 0; unsigned nr_pages = (data_size + PAGE_SIZE -1) >> PAGE_SHIFT; @@ -1687,15 +1688,12 @@ int drbd_submit_peer_request(struct drbd_device *device, * generated bio, but a bio allocated on behalf of the peer. */ next_bio: - bio = bio_alloc(GFP_NOIO, nr_pages); + bio = bio_new(bdev, sector, op, op_flags, GFP_NOIO, nr_pages); if (!bio) { drbd_err(device, "submit_ee: Allocation of a bio failed (nr_pages=%u)\n", nr_pages); goto fail; } /* > peer_req->i.sector, unless this is the first bio */ - bio->bi_iter.bi_sector = sector; - bio_set_dev(bio, device->ldev->backing_bdev); - bio_set_op_attrs(bio, op, op_flags); bio->bi_private = peer_req; bio->bi_end_io = drbd_peer_request_endio; 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: 12052255 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0ACDC433E0 for ; Thu, 28 Jan 2021 07:12:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 73DD961492 for ; Thu, 28 Jan 2021 07:12:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 73DD961492 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 01BFA6B007D; Thu, 28 Jan 2021 02:12:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F0CDE6B007E; Thu, 28 Jan 2021 02:12:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD4DF6B0080; Thu, 28 Jan 2021 02:12:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0125.hostedemail.com [216.40.44.125]) by kanga.kvack.org (Postfix) with ESMTP id B01EF6B007D for ; Thu, 28 Jan 2021 02:12:19 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 7B6F13635 for ; Thu, 28 Jan 2021 07:12:19 +0000 (UTC) X-FDA: 77754315198.09.play54_290a9322759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id 5C0CA180AD830 for ; Thu, 28 Jan 2021 07:12:19 +0000 (UTC) X-HE-Tag: play54_290a9322759d X-Filterd-Recvd-Size: 5705 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:12:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818020; x=1643354020; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=H5WYNiBvrNWIzR/dDsyAI0RzKPxZxlDuB4vWYUDlMrE=; b=pEUYduiFJEYev3wT+eqp3ife4RmyBNAz7QGPjHfy0lxscMRvDj8wPG9N Ht062n82TyURS96yi5DybaavhTm6LoLkiBa47JbAi7nnbFvxLXfrDzvGt zO1s4yf/qcFjb+wHj9ULoOBFv9qNedAVL2CSA4s8q1vUiSGCEgBw4roZZ 0tCtfKCrI5s4ylos7uQhnnidnp6hTgHv+Vd12+Lh4eKD2rnhsT69iYigs EP5Fm++MdLVvChOVd+Xysq01cy3/GkHRaOP7NoykYSQV08kDUo7uHOgy0 ppfF80M5kAOZyqNPUvpdQop4ccN/mXproI+RZbqJv0Rkbnhlj1k+Uo0QS w==; IronPort-SDR: ZSdknzIH39ozSBAFUjlAjBl3Hbi3USbdDclsWeRU8Xj7Qgdah+ygAFOcnEnLszmTvf/YXfJ6jN Y51JUEXbueToOiXfO2TQmSegh48iYacY07ai1PtYIpyjA2S4XXI2u3eNeheZZCgbuok2SQ8xrK CIw08NLqOdDpW+ySV8zgnGEkDEvo+aiOMyjfJT/03GeiFWOHuRaHMTFOPzwDqStt+XDb30mMhJ mG+VZPAJc1NNuyF0OeY1+OWhS7keMvX+6CwzJyoYch3ha+7Jx6j4BexzxNNyhhPOZyHpGPYRM2 Xlk= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="262548894" 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 IronPort-SDR: FsFSBR/SqoNxpW8q8deT7VZvvPzl8+sQFlKbebGUr78NLwiKABxlVaQNZLWtrgreG7dDDBKRsS DrqUtaYh8Q8wY1J04RkhNOVBqJ+hbVaqKeEQ0AGFar+ceBhlxOOFdIYMH8/C+0h52te7HE4Xrb 1W4+vbuz0znK0vWg1a0vg47JfQm0+BXq+n3g2OMwTfMl70lnqo4UxF51Yj22uwuUaiyYll5vtV 4zRvdKftvc/cuGXQAjaFl/Jjw2UYi/LnmjpPZybamMfzZiMIDitUbAQoKEnpJv8AEShb2UzRRJ kgh33vvYoDOQPhstgTdKeXbb 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:34 -0800 IronPort-SDR: sJ1sB4+NIXrk86BqB2mBiNRkLb2CtaUtTUjLUptuVolKqncgiWgms0hBmEnyXBHOe2LGJgTWAc Mtkqx7/Ji/KEF3P2zVgoCc4AZmvUpaw07sB7pwwqNDwBZIjeJgdIawB6xDKz7hKZuinbJ6FPFN v+digmuqEID+qvvg+Pvdb6mLkPbYX8es6TqyRNtA6iTBnQbrstI0JA9CgrvLf0RhQ0DnF83KdI QwpSDAYi/vWthDgyxzldo4sKChZfQfmY/MjRYeTOvpJG4q5JRSujoZAO3KJfZIMHz0OJMVK9L1 YPQ= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:12:16 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- drivers/block/drbd/drbd_receiver.c | 6 +++--- 1 file changed, 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: 12052257 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFAF1C433E6 for ; Thu, 28 Jan 2021 07:12:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 99B3764DCE for ; Thu, 28 Jan 2021 07:12:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 99B3764DCE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 350216B007E; Thu, 28 Jan 2021 02:12:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 300766B0080; Thu, 28 Jan 2021 02:12:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 19FD36B0081; Thu, 28 Jan 2021 02:12:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0095.hostedemail.com [216.40.44.95]) by kanga.kvack.org (Postfix) with ESMTP id EDF106B007E for ; Thu, 28 Jan 2021 02:12:28 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id ACA1F1E11 for ; Thu, 28 Jan 2021 07:12:28 +0000 (UTC) X-FDA: 77754315576.29.dogs02_0d17d052759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id 8BAB8180868D9 for ; Thu, 28 Jan 2021 07:12:28 +0000 (UTC) X-HE-Tag: dogs02_0d17d052759d X-Filterd-Recvd-Size: 6601 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf35.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:12:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=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: KZtSzoa4bofnFSLELkzBnAAIICHsAaaUaulZ+5O6aCGC9BgTs7UrZt1z7/U3YOZ3nMuMljfS+J U+8xjxvh69tAROId2RnaJSYr6sxAcU7m0oGNv6bkqNCwzmgI6YB6p8CASp3gYy++kOBIMv9wic rORu6Yc6Wiy4i9yx/p31q9unul9uIRkoNikTUerQ6lCOHwS6dj6a6Mv9JGxn2AN/jL8UuUuMBT ETtQRevja7r2PuFLd2kfHw31mbl6Ok9kGYErHIlzRcIdW/fH+Pri5wq/cCofhHI/yQMg3m8gcD q50= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="159693757" 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 IronPort-SDR: wGWynrI7IDM4OTzciWsktLrWGwsJJu51B2VZQP+CECfL+wGN7loWh13URnvSc8M3BR4/lMH5oo vqavdct2OaG3y24tqXBQ2LBoJDdN9oMDVjcIvZfD6vnlxtuVqhROM7h462IqC7pEFXKFxnwauI Gx8YNI4fXF7PYBqZtyx4SDIVR51JlXprotShiCO3CQGilEx6h6UHYL5K7xpirvFU7bX01ma+hC Eh943fbwKGSPyoPKYpZA32dl7ZyhIe5iq8N2EceuiEbDIOXNTXB76vFpWcbI3FyRjQ+yMrYdff qEe7ojEQ+ZhwIGwmP51nSNx6 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 IronPort-SDR: AXyfJ+0DzRblLd1C2a8i26F/p5ozSimYWSlSS31hVM9ZD6XicSUM+PrSEKfC1Dird0dpCST4jr RH8MY1sbvDVq5P84PowPihV3IFXmyzQNH7jhgBGPCvDUQHmJMRxTWJczw7haMsXH6G94Is8ChW 3Thpc5BIBnKiKhlT74BApZ+91+Tr+DAOOck7bXVmzNs8yvwHiSmvLe1vToPqpHXLGvuEQ8CHDc wMtFD3vO2n6mQgoI8Yf56mEPo6oNIWF003bHhQMN3DD+ikOw4kJGblAZl7I7M30srcHVxOHbPk wqE= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:12:26 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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: 12052259 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77C6FC433E6 for ; Thu, 28 Jan 2021 07:12:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 235EC64DCE for ; Thu, 28 Jan 2021 07:12:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 235EC64DCE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id ACA2B6B0080; Thu, 28 Jan 2021 02:12:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A78006B0081; Thu, 28 Jan 2021 02:12:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 940E96B0082; Thu, 28 Jan 2021 02:12:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0242.hostedemail.com [216.40.44.242]) by kanga.kvack.org (Postfix) with ESMTP id 7E9516B0080 for ; Thu, 28 Jan 2021 02:12:38 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 4E0CE246A for ; Thu, 28 Jan 2021 07:12:38 +0000 (UTC) X-FDA: 77754315996.06.egg61_0d091912759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id 26BFA10049842 for ; Thu, 28 Jan 2021 07:12:38 +0000 (UTC) X-HE-Tag: egg61_0d091912759d X-Filterd-Recvd-Size: 5153 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:12:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611817957; x=1643353957; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QAiSNZxQXn+fhhqJHg770cKqGnQ7j5esbXKR/QGBS14=; b=WVKWuS/embGLyj7oV4mMY0aKX8etbP1hi3TqcSaFxO9QMRwJOSIWEzZ1 aNtXdIyI0T5glOYX9f5qy2ZPGQHAOy0JyjDD1PJLfWzQeX8gKCvCi1qfT A6R7LcWP1fPYYfnxmIyTfq5SnSS12Xn44Egoz3WCJ1XtlfbCZTdLslDuf IEL+R1z7nSVF/A/epU3VaYg9xVoadbJEgO4MH21e5SY15JwS7nVUhJWX+ 4Rvrj1eA5X71tvQ2RqbcUhL+E3zcq9doYHzeYZZxw/kPAJPxqN1oxnXQs qrXUflP9YNalIlu9xq4XHeUIQnTJCYO6yno8GlAdyUU6r2MfZTHKEQH33 g==; IronPort-SDR: bmt885B7sB42qyUFIg8Ai+nA99pcYSk1NpujNG3d52mQb/bR2QwrU4h9E9YNOTkkhclsoPjcXn 6mFPh61n6Wkr+n9cT/GduH7J2VSnBj3x2LcqDHdDqkb3kfHrMJCJHHIfUn008bKj4UcDHKvL1V vgDMxUSvkoeVki7VixXg8Ifns/K9uHbVuY7e92n6nauNQo4SlKGLJ8dWbkJMGQ7gDFMVLdfeov X/crQcPswjjZjH3UZGk0WC1YMFTTsFJLt0nXhggKZjiyCp6ScOrTMVvhyFzz1Hzpr6DD13FUFR v2g= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158518090" 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:36 +0800 IronPort-SDR: IDZiMJOlR0+VOY1BNQaARFfYu9OarHLLsVonfFyPXl23zo35odQhgMmfO4kE4VPYKsY+JJiS6q q9jaoN5yUNg29lAe+5M6aOgNPY+vyQFvS1LRen2A0GVS8Z1uRNxF9RTO8S6+4SzRtSVqdMlqlX AP3GAQ3XY8ByxIxbwNN9TH/m25u1gVMooNCMaZLdxpwBcvN9NIziTxpOmNboi77ZZmjclOc1qK Ph77/4p3OETsRa3p0SDjW7eGnujIlX61OeHpf9zBKq75rtapi1JdaKfckOtoqDkXPXsDbqMV93 IKSP19vwUbpQKJr8mfexR6qx 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:54 -0800 IronPort-SDR: Luc6lg4Pa+bVHOb4HzkXJiWLGqMg6JC6Nyg0Lqb88ZIBDNylXDUPHvAGuri+ui5nWB8hV8jug9 qFWTXFaOWHAL0oehOyPdERabJ1LaG9aVOt3b6RTgmVCVF9xZaJrmkG+mjzow98LgNG5t1Hjoni gqXmojTILo9AyCGo2PpCozas3remWiyjnR1rz1m7Heq2aoYdQ+f2mWDUtJhIIR3UJyQKknW4V+ XZO06It7hG6XcBrRwkAZf9a8HSkB5bDSC1ddzu75XBYoKVtN9lipurMfP/HgqVuXVuz/kSCAwn InQ= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:12:36 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- drivers/block/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: 12052261 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE29DC433E6 for ; Thu, 28 Jan 2021 07:12:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 81EFA64DCE for ; Thu, 28 Jan 2021 07:12:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 81EFA64DCE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1EFA46B0074; Thu, 28 Jan 2021 02:12:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1A80E6B0081; Thu, 28 Jan 2021 02:12:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 065F86B0082; Thu, 28 Jan 2021 02:12:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0239.hostedemail.com [216.40.44.239]) by kanga.kvack.org (Postfix) with ESMTP id E391D6B0074 for ; Thu, 28 Jan 2021 02:12:47 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B213C181AEF1F for ; Thu, 28 Jan 2021 07:12:47 +0000 (UTC) X-FDA: 77754316374.06.bear11_30061e82759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id 8F7EF10049850 for ; Thu, 28 Jan 2021 07:12:47 +0000 (UTC) X-HE-Tag: bear11_30061e82759d X-Filterd-Recvd-Size: 8132 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:12:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611817966; x=1643353966; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=A6gWT2+anXyYq2Hv6qVI+iojoFiSM9Vb51ZpjBpkhPc=; b=bOHtMxkTG2v+CHUqITtmmBl473wU24AkhqG09BYDpak6cAG94rrx0HEu ygQSLZQHju3OQIDmFhcYEBiMbmgSGn4OjSLrXF3MKrbbGxgINSWlGUppJ VH1CVIq4yjXNpWckT+9nQuAEnlaz5Xa37r8ubk3ZaPsqweXW1s5aYwdRZ l+QhxF0aJj9JF9jE4NVLH9Wunqi7AQi2WK7fJmJRam2pysqyXzxn6bJc/ CzgMHGuXls6Q6JF+zURa8dCUb/9CA2sURwO3Dg53nmnfHL88lA9uppPKP FaR1TTRsXoq0V86cQkCySb1NPEKHpNo76dM6TyJC+WPR2z3NZMNOWrr2x w==; IronPort-SDR: Zj0BsuSYOwCfUH3plftuu777m4H3A698xjxGczOIWX39SQFZgsgTE6isOJ12QU1QjAFzhy0W2o AXNAkNhaP2NKyUkOj7iBHlqPLjMAG29gUSGY/aZJCTd7XpjhhkyH2jnBeeaSaAHhCyAW3eW/B4 vmDxrZKLFZWlQxUBlBa4/BSeGbMZxPSJXhbqxc5/4EqIIhoDw3qFubKR+DJxX6fqrbdEdo/H4o wo7cWBcY6DKNiuxcncVSeq8Z5TIkCUXuyAYpaC9+pdZVGNPFzz8xH7u8NIFo1QrK09FH/bvzQN 69Y= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158518106" 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:45 +0800 IronPort-SDR: ec0IP7thZQ3EKUUUhrg6fkao7FUn/Rqvznn6GXGluYSHqIutNkCKRhPxUF+aEfLs8A1BNIJ05x OeAg+Uy33u1OfSFOaREheBChtJumHLrVkniNjNZFPNx0DczkcZDMCuj9stmDqrQCwAvevfGdc7 clTVNSSJCxqKLx9ju9FulVBMxJXl1n6anUytrzJ00BKREsvBpg8Usyhnx+as0MXglfgRB7dUkA YspNfXBm8GO3f0Cp3jah4YMG8ZpigQcEiLuQLLDs44xrBk5D16Mcz5hxWylwmLuCW7nSrXcNp4 cBnili6MmMLmenoefulT6+2k 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 IronPort-SDR: iX0HhBu+61xFa7EtRWB17G0RFoDdFxtABLHP5yHe733z1qMOeQszsqPYXIq64MFQkReY48/RWk FOClHc2dhNxuRM1QyLpF0KtQrhnCpVvcpPgq0B9OecXrJpCL8UYdCuDWFTL9LdxFS6qWHXh51B DNrP6xQEwjJPm/GL/W/Mv5XtvThzXYCRCRRzvICfBStun4/LN576oOtiFYHwzWMShhTX3BjqKf c8icNJold/1bdh3xf4xqkQcFwP0TJ4M2AqZVo41MRst8Lsv9bfR6qeue7iMnlhLF3vJJuSRBwu WXg= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:12:45 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- drivers/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: 12052263 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 921E6C433E9 for ; Thu, 28 Jan 2021 07:12:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 355AC64DD6 for ; Thu, 28 Jan 2021 07:12:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 355AC64DD6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B8B2C6B0081; Thu, 28 Jan 2021 02:12:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B61D66B0082; Thu, 28 Jan 2021 02:12:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A50CB6B0083; Thu, 28 Jan 2021 02:12:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0037.hostedemail.com [216.40.44.37]) by kanga.kvack.org (Postfix) with ESMTP id 8D0456B0081 for ; Thu, 28 Jan 2021 02:12:56 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 590538249980 for ; Thu, 28 Jan 2021 07:12:56 +0000 (UTC) X-FDA: 77754316752.08.ray89_1e103642759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id 4780F1819E621 for ; Thu, 28 Jan 2021 07:12:56 +0000 (UTC) X-HE-Tag: ray89_1e103642759d X-Filterd-Recvd-Size: 5504 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:12:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611817975; x=1643353975; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ebUREFacDD1ljG2MqWB5dUmMjUM91D8UhGi2M79Y0SA=; b=iKwRoV4kZFxqWxtL4wvglepMxAuEAwtrYZO6ba8A1Phsyz1363i8mpJp /DFxpkrCF5bKtm2/2j8l61huVMwWK9Ev3nMEhyYjYwzHe1EzeuoqzTvFG Tbsn3+ZD4rcj86hOUrqxJDrvFLJ2ivWR761u8hMBycjxh3kPU+MtoCIgU vaX3lfvSnMqHWKd+92TfRkOF3L8YEfvDQqK65lEdKOEazA0FYmb4oXZO4 alDzYW39ilDLylAHprWwD+StXVfYwayT5fV+KH4/aGrUIUyAbU1UiQymJ tVfacoowmpNASbyTNlkb2+v5eSkHEvh90UD8KIDld61CkFA3ribjZjpCQ g==; IronPort-SDR: 1+q5cbhy1f8ThyiM4doMRvMlO8xW1wiFXXFv04maRkI2GeAu7uajcL+18cBbnDGqNZbJCjMZUK VZlcT6fqPQOkz62jJiOqKzAtS0TLcc/HC1vuh4JJ6y5mhPzt+EQ53bcL0vkBloXyYcguQwN/s7 /QIRfZVkZg15p0lfZVx9iY4xwCyvo2aqJwavHUIvzJzCf8JKD3bOcLlXHRSB1aSwll4ZNdTRNF jl4GUViBBsdTPeAXtTEa4oUoCzS3fuA466qKJnfid7fQd2cZq8ZqPOiXaSKbsSYNzusotDftd9 i9w= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158518117" 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 IronPort-SDR: 0OwvBmjx3k9Sa52X0+wSKsMz+NWNQ6FRW1mogpnlHc7sQH+ofZRNNE0cDBKVP3Ukr+q/Fy5u5n fEfyFApPqwWIxCPhqSWmfdm47NDx+6jX/4ATANEVLC62U354cCi/lATVm9iGOsbZmaOUNITm6R Dq4/RgD00Z4ZulEgHpsXpo15amTyfcqxX06Qdqvn3OFn4oWdntCeq3oTIHI78p2NhBeSM+6lT+ skocbCvQPf++lz3tWXqGcoxgeeV/DEuNfzCz84+FaoxJK+ciXJtLRX0GF6J2Vb5RsupV7QmL4f 0mpQ18n8qI8sM2o6T3vcZl3t 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 IronPort-SDR: PY5y9iQTPaVno0Uv+vDzXalBIBo52CYeNhdpn1c7TxoOle28qWYUG06GBXepBaS7SSBSs9yjco 7juMCiLNAFC5Fl7+86T3v8dT5wViZ/r3nWsFgtnjfanPUZXEs47a6Ez/SVmFCas+uBcEU4K0rz 829GMnmof7Vria8o+CPxuoND3CfaQPgb+QYuf0lvO7BAPoDvQAY10VoO7lep1Qta/l6nA5+vbg ht+uppfjRckOmE5ekZUsc4vMGzhgqqwVxG/dC7eG99G+et4hw+q4h30FxFyz73HjopgItSw/2N PHA= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:12:53 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- drivers/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: 12052433 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71E35C433DB for ; Thu, 28 Jan 2021 07:18:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EE8BC64DCE for ; Thu, 28 Jan 2021 07:18:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE8BC64DCE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6C09C6B0093; Thu, 28 Jan 2021 02:18:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6495B6B0098; Thu, 28 Jan 2021 02:18:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 474E66B0099; Thu, 28 Jan 2021 02:18:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0075.hostedemail.com [216.40.44.75]) by kanga.kvack.org (Postfix) with ESMTP id 2EFAC6B0093 for ; Thu, 28 Jan 2021 02:18:41 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id E6783181AC9BF for ; Thu, 28 Jan 2021 07:18:40 +0000 (UTC) X-FDA: 77754331200.03.776B0E8 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf01.hostedemail.com (Postfix) with ESMTP id 1862A20001EF for ; Thu, 28 Jan 2021 07:13:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611817984; x=1643353984; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OzcT2XWni+wbNY2uowp8HTdSyU1JsS57dIOzGLP71ak=; b=fPr532zdPgnZK5HA03NEpKzVfq55AzVA6KvMrOd+uaHlT4MBSDpUaV+j 42xcj7KPgE5tJuxNAllxuKG/P55JTXO4y6R9MRlX61ArX1ecJXhDGKVGD xrR4jMxsrJ6OXzlwohReWM1jWEZHQhIotq1/SbTwtG3jZPBDCJTXYnDLX 4NtXQsAZV2gaFZv8cWc6S0+eGUbV6ZlrO6kMX0HwhGO2+zGPL/+yvT8ZU iWAZkysRIX5qcMVEGtHynvjeJyq1mE6YUG32cwEh/igl1JITnVcc7EpUi 0lYvMlEsMDSlC8H5Fy0Z7fe/ZMozZSeWint37F73fgheDWYHIMomnTO6a Q==; IronPort-SDR: sL3Z0AYmUhxLIHBz3MuGYG5T8BT4j97OYG5VIjkilkY1gUnXdOCSCMCxmun/Ry2SfhHE8khPdX EGdhfhA1/q1XjjBCQwlq5D6QFWyBP3GECKD+5NB+3HOg1L/o2JoDpj3fnzII++QKk4n99CrH0y nn1C5Ptc73qSEZE1hAUR8PKaQMN+WZlktyWr2L8plwtShRq6/hMZDLLVCw6TsA4vEDLSfxqMb1 debNdyGJkBSjwdsGnkfjWhfcb7ExeMzjen1jI4JKaLAnPdCNTLjy3ahOdeitKYbnXwjrggcwuV jAE= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="162963199" 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:13:02 +0800 IronPort-SDR: pu1uyxPcty0EovUHWHhAVqQFhUMmKJb2hCwyVQk1cKc8hy5RPk8mvL7OuGrfltUp8Leh1eKRmI uuNHpANJhfuyVD3RyDT+6jR5nytLuyShvdFbNG2M7+eKSSGHoR5j+DvjHJgmipE+LEDFpbVh5B V8tL9Sj7XGAHT1njM7SpLMBI/1kZy0NhAyVssntTx+WTuGs9RiHf533bcrSo/DrJpCnw4tTKZf V+czgC0MDEpJ//F9AFEEm7JUgwVED64hfjTqvfoEWolNc0YJisJE03fHlSPOda310Q6L9HUbkA aSusbIcCIH4+CGgYoQ1yYKD9 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:22 -0800 IronPort-SDR: m8MWhLly+Q/ggpFQoQazEvRAK79hMprrsJeibomNIX1/4xtKgak83IDhV3hY33IYYgETWfckla 12cflgJcZOLhtYF332W1ZeqMwkaZsc7uQahEN2f8ydynExvlY4KkvRqWC31LBbVv2+B3KXuSeg s9mXwdZWg1TGYc2w+IbnJALYEzC776WPgdLPtLGdrMUnCNPoz5WeDSYQd/QZ1Y+MzxJurZd/eC 94O7CZ/ZfohxaTfsL58Np58+H9TOWMfDJbBI8BFZ4728SkC4ncTHu1ybMvyhjmP7gPrroYjKqQ UWE= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:13:02 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Stat-Signature: cdknpwz1fcaxk441yon345f8djy1cgyf X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 1862A20001EF Received-SPF: none (wdc.com>: No applicable sender policy available) receiver=imf01; identity=mailfrom; envelope-from=""; helo=esa3.hgst.iphmx.com; client-ip=216.71.153.141 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1611817983-771845 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- drivers/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: 12052265 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06290C433E6 for ; Thu, 28 Jan 2021 07:13:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9954364DCE for ; Thu, 28 Jan 2021 07:13:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9954364DCE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 34D216B0078; Thu, 28 Jan 2021 02:13:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 322F16B007B; Thu, 28 Jan 2021 02:13:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 212766B0082; Thu, 28 Jan 2021 02:13:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0222.hostedemail.com [216.40.44.222]) by kanga.kvack.org (Postfix) with ESMTP id 0B67A6B0078 for ; Thu, 28 Jan 2021 02:13:14 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id CAD4C8249980 for ; Thu, 28 Jan 2021 07:13:13 +0000 (UTC) X-FDA: 77754317466.18.mark85_010dc372759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id AC28D100ED586 for ; Thu, 28 Jan 2021 07:13:13 +0000 (UTC) X-HE-Tag: mark85_010dc372759d X-Filterd-Recvd-Size: 5251 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:13:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611817993; x=1643353993; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Co0rYGelfI2tueL8o6ihJdxL5NS5pM4BZ/hI8135Y8w=; b=fBS8Lx+o0Uxp/DO927I084MPokQSYssWSvItedmJEB+mR9gNG87qy91z MJYzH2dOePhcnV9qZzI63KOUZ+7fyZ21kcyTZYU3qsGBqQ+a5G40TqP+q huZ/+nycjxB9rI7Xbmfm5XvZZt9XX5Dms4qFv149q/oPPJyWoL/a4iIQ8 MgGxvOOJ3GL3pcM4xIzIVyvv7+rqr7iUn13TtkcKDQ12VI156VT6H5wNF M8T7EMD/3IF44lMbVp+qoV+nhRnLGUtcs4Mer8rnzL/mLwEGJ/TCK2BFY rDtexu3UmJG4B1k1FvbyxMRuz15CTOqmICm34CDGaauReg04UFfbcwJkp g==; IronPort-SDR: Fbsu++efPUW9iUnYTSS9pfEnvBC8cuBJa6Jn5/AZ4Ty0qnzZmV/O354zARTVnoLnX3pRwPcB/6 wGaykXf4HaymuGFVHNLHJIhprb56bd3XQAA6En4utNIVd0Qo2+ds2Izi8mZI0ysg1/QsvYL3f4 Dy44+joZrCLHwEwpHnE9nL3cU7BhYUhmyGhsSB40utKeDQXIOYGhrsD04HsQSdtePUKzU/+3d9 ubAuiRpvObsKH+dgYREV8E2vG2ISyN79GZjROnxNiuAHRzPb94zbmZczMJvb884+ZO71Wb2PCT n7g= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158517322" 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:11 +0800 IronPort-SDR: dCvkQZgVD1unzowwatGuXuPeXl2RQnC4bqxOMNl+nmwOYodlrEjYtJBM1GJhwXQaiNooeAQR5Q uNTZmFX4fVAhVtY+b8Wq5J+kq/JKMChjdi951RApgtfyK0d3aqs883XAI9huODKm6K/aZbKCFr ZsBLpovBYqU3JDK3SPDYa9dGLnyP0mjkxLcJfaKLRlyYYcUBT6zX7Uza7d5f3S3tjIUTJCcBXE I1LqzWsZsYpVFBUf1HXN+jDIEbNalt7ajlC9LuzxyVdHD7APsE7tf+iM18MC66Wivw6k7MWIBS MnyYgKJZWmKRaPenxvSACT6H 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:31 -0800 IronPort-SDR: B3g2yURiLlkRDJQjiSw5Axb2Dh2vXpaNrKE/QAQl3YC0d9KYF6ZY/2WEGrs8Ad4s6CTMSYijlI As81DRh7fxTUcG6XscFZ0dEUGMxghLXCUSNbFTul1lhg8N84M173b0zoMSc59+C6RPGCZyVbXT e5q9NGchuukS+6n/XolnPl9CgZkf3lpSTdPe2xwj7IsZkLY+Q3H2m4972b6vr4aHe8P7F7VrjW YTjKY9EpCmYYdyolrCzI7bP6MpRPHgjkbRdfoyYEpwC7inxXY41c/i8ke9uNT4EC8+Q8lA/Kgh 6rI= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:13:11 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- drivers/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: 12052267 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D309DC433DB for ; Thu, 28 Jan 2021 07:13:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 796C761492 for ; Thu, 28 Jan 2021 07:13:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 796C761492 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 14FF26B007B; Thu, 28 Jan 2021 02:13:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 101396B007D; Thu, 28 Jan 2021 02:13:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F09AF6B0082; Thu, 28 Jan 2021 02:13:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0056.hostedemail.com [216.40.44.56]) by kanga.kvack.org (Postfix) with ESMTP id DC3D76B007B for ; Thu, 28 Jan 2021 02:13:26 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id ACEC23635 for ; Thu, 28 Jan 2021 07:13:26 +0000 (UTC) X-FDA: 77754318012.25.cow40_26005aa2759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin25.hostedemail.com (Postfix) with ESMTP id 847321804E3C5 for ; Thu, 28 Jan 2021 07:13:26 +0000 (UTC) X-HE-Tag: cow40_26005aa2759d X-Filterd-Recvd-Size: 5705 Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:13:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818005; x=1643354005; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=g8HJbcPmpqxtxJgQpVgZEQpuhn8q+oe36W4m3E0vxow=; b=QGWy/ChlKL4ACFV0EuDU/0swHaUL6YmVJFHjSz6BIHuJwifnoh9fyuvn eiNEZHtCUnEPa8JWKloVeVkJFI+O30pI7kqysAYrk/YG14t3LHW7NF0Ru 2CiWj/dtIF8ee5rNUajnixFcKZ3Fh6mQj7OaoLmJKtqrRIQEleq96VQmM MJZgBH1AflCPTm3X8iYFHPlXZsjESXD6uGdRSUdtP5xfBk7560FiSgRjh Wy6ylXrCASGjSe/lEtKq3ZjZpFACMbVE6XUaNNCHflhSiJL5c3+ndHp5T h6ydtRz+qhBRbJ+OiHGJlb/iTptS4ANE9lltPNE8qEL6Jp+MvX/usn+Su Q==; IronPort-SDR: LTWqD59u+bdctdOdrjpjR+UCqgi8Gf60fNBRMd4+LUskw3itUg3eJLHFgiI6IiDZ5D9rGgTZnR nhXrlmVTpAqNC9jos0lDcoIdh8rz6cjsXJ+5svpSZ2nBBXOTbjjKGSmoThwYZ5lBhyeqUb2ziQ iK4Za3XCb7dRGfzrbwvhYJrM8RGWRjy9KdXxJHQ/n79OeYpaOvvnCxNyN7+TPKhzIM6P2l9T4K SR/wwhATd39y08SdZIaFpJfBVo+k+dKWYJfM+yNwFq91LLXvnoOPro1ZrNbs/mgn8TXzpBDpP3 Atw= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="268892447" 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:23 +0800 IronPort-SDR: P9PKirVAJBIHJKIwFJAKRSt127L02VR2OaGQZsKE1yssF0n4kFFUoyV6KajVy/YExe+htsyJ9j Dlz++1qPT/4Aah4bbMFk/G5FMoZj7YaeQG2C+pHqkPQWME3BCVZgmWJ+Jv5JaQa9A80rzdBJkV 4bvXIlM/qxelnGMnIsw3wkkXK43w6iwaMpuItfT79OHV0PIcPLtVPnpJxMT5sCbzi1D1FnXU5r lrE7Jifuop6+T3OizBHhKPFoM4pM8+UhtwC4Qmv8GcATm8ghq07QpMku8oVIRDDYr3YX+vB/CA 8shGKqrLvci125LCtzkQ5KaG 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:43 -0800 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 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 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- drivers/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: 12052269 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28C3FC433E0 for ; Thu, 28 Jan 2021 07:13:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B16F864DD6 for ; Thu, 28 Jan 2021 07:13:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B16F864DD6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 39BAB6B007D; Thu, 28 Jan 2021 02:13:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 34A726B0082; Thu, 28 Jan 2021 02:13:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 212346B0083; Thu, 28 Jan 2021 02:13:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0074.hostedemail.com [216.40.44.74]) by kanga.kvack.org (Postfix) with ESMTP id 0BC6D6B007D for ; Thu, 28 Jan 2021 02:13:33 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C423C181AC9BF for ; Thu, 28 Jan 2021 07:13:32 +0000 (UTC) X-FDA: 77754318264.18.park46_2e1255b2759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id A3E31100ED0FD for ; Thu, 28 Jan 2021 07:13:32 +0000 (UTC) X-HE-Tag: park46_2e1255b2759d X-Filterd-Recvd-Size: 5165 Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:13:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818011; x=1643354011; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5eayPzy70EKVB5mFbuCcXtyHCS4v72l8k3GegXWivXI=; b=MxMp9F0gmz9gIDYLAWeuWGL/1ph0RMxW+Qbh6kNULAMZgPNIArOc3Zlz GS5QF3nu/u1Lq4xra1q+6RSDFHVB0S/pwGXv2GlWmIs0y/GXyFYJet4E1 llBmmEW7tJvXRt2tYDzNKS0Kld8VwYB0hjCruzH75eU9DmNajztsi9FTN yGxR9jEsCkc7dBqhdbE4Agc68cYG8pkyvsmb/AvIzzlzRqd4CEoJKT2MK y0/I7JsEbdkupBt7jR0vs6MAvcsnFlan66W2lPOsFAt7Uuqc3FKXKQhix i610FAaAxRWbX5hT813EDGZlw6xGSJuxxw4GLpJwa80IbTlfBC6a0dRrI g==; IronPort-SDR: bdNOcMQz8rysaCxD0+eEwyK/2ZmBavz55xhCBvicERKkXw3XZrs5WMGxjbEU2lSmVhc9dzrmQ4 8hk4pr5H+Vtdu1+UdTQ5NtWJZ9r9DaiZRLxIOo2xUN/SbjamR9F1TPbq4/ytDptnkeSBUFGWWX TAAg3zM6AHtdfH3SSQFEGzvtYktzcpNTg+3dScpfbuB4bYH34TDWAUXZgMtOvKoRuCCqOWzL09 tg1ppoDgJUnl5NcoK7BGBwCn5N3Uo50A+YQizabb2l45CJMrKIYVzVl0jne3Z/tZW4qa1RiVxb Awo= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="268892472" 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 IronPort-SDR: 0ZxxkyMwb7vGA+3WwhgvuHFnsLL2WWmBR2b0D7OFET4PCfEMQnWrnnJPy4PPQxqCPkqANRGofD N26fGnOUT5o61YD3jGRmDxjo8jaaxKch8yJ5Fbrxd/TanOawHL532kJTZ6QX/ZO+06PQQ53lR8 TvbczNHH2GMzonG5OjY67WUwOv6byVy0M8nyMnUB672nDSiYpfuhzhle21lU3X+m8d6m0Gg5Q0 TAasECPMSy6f84yz6avpTbrGW/nXsdFIpklTitttEMktdxi3DErw5C7pMtNXs55LrCRm5hA+CE jWjrSGyBHYt/C9eUA033QFzG 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 IronPort-SDR: VOVmzSzF+PFJ5cIlwEfer9zopXRJVevtkqTAdV/vkmWi5tqY25x0d3LuGTyYENdxWXzay1z5UI 3lglUXeUdXrgV2kjosRDVsxHgPX3JmYCMkybSp7dVFiY2NtJizGeP3Ns2Zua+ztPSx29L5AtLA s1r4WqMcMEF5NenjfW/yptNoTwylDj+qb8oKvyina3WsNVkg0wovZeJk89NSPRf5yUzOMPXVB7 hd4QqToWmHIoH7o5yPqPfXS+LYwCHRus+XuP8hoEESu425XNxiI+t6Xi0EnlRBN9AYDyemp/IQ NGk= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:13:31 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- drivers/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: 12052271 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79FAEC433E0 for ; Thu, 28 Jan 2021 07:13:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 04EEF64DD8 for ; Thu, 28 Jan 2021 07:13:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 04EEF64DD8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 87C516B0082; Thu, 28 Jan 2021 02:13:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7DD656B0083; Thu, 28 Jan 2021 02:13:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A4C76B0085; Thu, 28 Jan 2021 02:13:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0191.hostedemail.com [216.40.44.191]) by kanga.kvack.org (Postfix) with ESMTP id 53F976B0082 for ; Thu, 28 Jan 2021 02:13:42 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 252A83635 for ; Thu, 28 Jan 2021 07:13:42 +0000 (UTC) X-FDA: 77754318684.10.badge28_2e0fcca2759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 013E516A0C3 for ; Thu, 28 Jan 2021 07:13:41 +0000 (UTC) X-HE-Tag: badge28_2e0fcca2759d X-Filterd-Recvd-Size: 5557 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:13:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818020; x=1643354020; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OdHsUuhLqy4MrzmNdd/tdpH4dcVzXnQrrHk/wuqLVYg=; b=pCc+iMrJXxsf/D1po2KU4ObdaQYHuYk0fLNPjO/2fs6fT1b+9ak0t6c8 vz00YqvKI8o5EoPgXqO87CaGfWjLFZwYGN3qRItyxPnrXpt7lBSq3TYA1 +KcxkljQ1L05u21jIiIggsQ9VIayd/82+vWeDiyxOSopIEhcrpcu53dC/ UdvjM/mRQn0z+3B8oej6Lm3LFG+05hvDUQ+E6+49abvDd9zf/8YX0BIhy W3BYx09Hor/Wi7OPS7EzG3qSzLdVH67+/NO1iuBUHazV7ViHHZhLXaT49 qm0OeMxEil4Uxi60lE6peSgZ+hVEZETNReg8/6OPD20lDFleGf7XLwUnw A==; IronPort-SDR: Tcnm6NNeb3Tb2Dx8EzTRrEf/McZ7lOjdDF7f4TdP4+fArWH69FwuXfDw2cSWHeu16vaiq3fPwr zf+wqWt2UJp1DbjGVzLwbNXtq4BABrJKn2euIqF8X+t49h5R1M9GclK/pmJ7gcmHPELOdkUj0L bdVNuKmcYSDr2L8sZk7ZhDm0nH34dxBE0yCgmprn74opNe5kFjShdJK2xikni0IENFuRQ8lSo6 snzku6EkQiYnyuUy4iF1YLWYBbLyoD9Ep3hD2iNOKIxs3SHtvqJZ0w92nRWbYP2bLfyq8ZcuZV qfo= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158518213" 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:39 +0800 IronPort-SDR: f0wzcCEs0Qr2gVboB2apIKRcqSh/B+lzUWxyTgWN7RV7GKQ0gzb9E0E8OD8pGBgya3J43oWVJd YdDlueckc9qeIeCB6v+LUfbJnY5RWb0Q0vQ30zLSu1py4o6pjPTXaqSltzeF+kXVHziXp0OXDi jfoV6q3Os8to6QXhg8GYohZ879SyPs3Ew9Tv2j8oWJLlAlbPO9fKezXyHE8FW8AMKJszucNB5A SJyvAPb14DauJ06r1a6mupnWFF9XzzdCKWgNkO/G4VrF2sSWqnxaUy+iq6yZEiX4swmKSELydX FblMeYZSwA66BvDeZL8uF3pz 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:58 -0800 IronPort-SDR: Soam0z/hZs1yuoqW7i6jx5roOoHAapZwcG8+RboeMSicIzBmOYiX0n71yThGE0I1AnlhuM1di0 VAe/ab59Zj3d54HqeQwwCvYowNBZyfmch3v7Oy4azaqst0BpJQIg4rXG9R5IU/X7180i4BamQI Pdm6cEOWuqZT053sZGwqRvhtwriLsaGVJTX83nQ+r2PwZZdfIXxXkXEJoScfk1suUPevohY8gp ghp78Zzi9GkjGDnNvz6HqiAkBvVb/9awaEDn2T+13/9ul6gQjwyqb4x2IkJNU2l4rR1clxPnay 0k0= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:13:38 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- fs/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: 12052273 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D00F6C433E9 for ; Thu, 28 Jan 2021 07:13:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 67BD561492 for ; Thu, 28 Jan 2021 07:13:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 67BD561492 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F0C216B007E; Thu, 28 Jan 2021 02:13:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EE1D96B0080; Thu, 28 Jan 2021 02:13:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA98A6B0083; Thu, 28 Jan 2021 02:13:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0019.hostedemail.com [216.40.44.19]) by kanga.kvack.org (Postfix) with ESMTP id C5FC66B007E for ; Thu, 28 Jan 2021 02:13:48 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 8D28B1F1B for ; Thu, 28 Jan 2021 07:13:48 +0000 (UTC) X-FDA: 77754318936.27.bag27_5311ebe2759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id 6B25A3D66D for ; Thu, 28 Jan 2021 07:13:48 +0000 (UTC) X-HE-Tag: bag27_5311ebe2759d X-Filterd-Recvd-Size: 5703 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:13:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818155; x=1643354155; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ph9rmwEURyYiJjcGgT3e2aApJZNJOSNpUoZqKSV1dx8=; b=ExwFIyxzmQ/UYQM68qMh6Gkvf3hD1PDMBoygoanjtaB22DsrG6hNhrBt CUofJzlbKVcR98l+PlEKOV9N5n3Ly3Ig6LWMFoWlq+izlyl0OU6CopzPd 65eEC3zWwQlIhHuf+RByCHTMmeUNfxjADGCq+YavFMO8ilHjPM/z5Dl3X SC4ZQMTunzWtnxI/xYykCT+YH6Nf3y3Q6he17GRRAUxnDfglUj1XRylTa uKl8FvItTFfoZFzhOnYX++7a3emN+4ZCU+h2qfWs+TMM+T9FhFRXmraEI S0wYiPx4/2En7jehubWox05woqCODPbP0S0vk/AirvXDmuCkEqM1J2aLw Q==; IronPort-SDR: MEHq05Yb48QuUGOFrqdflKz9j8ysUOhq+RAugXSRqfbePssEdOVa0n2Tktt9G3wON8BIv9p1RW Cs1wosZs+kZBS7u2ebqIFrDRf6Vj2bkbbBJozYNeJp0cnBZhWCQ/hDcKY0JusUptKfQ79S5yDB 3xgfNqKv/rRJXb7WyzcxFdXbJr+aV0uZ2Vj9vzkKg6esG70yYyym9P8L9jte/iZcBp1TdiiuzA JByzZkyZJYFupqP+9OdByo5Yj/t6Tek4c0aH4rYAiEGBQEUMkkWkXbJTKDCdrpWQZ+AkJrtDdb F7Y= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="262549023" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Jan 2021 15:15:53 +0800 IronPort-SDR: P0e5xJQfjcxZBg8RFzIQg7eV/a6ukFkmoW9FBf1Ncj8zuRet2AFxqyyXu7kUlC0v7JwinqJ7tY pQKTqc5Lfvw+9mKLTnRA2RXAqCnNmlZ92wIOvTWHacT0Or1KR3GCYf1du5DZ4CI4ueHo4iRe+c yJis6YgjnwRsUu4xJaMOtl5gErr0HAbnDBGvsYULOXjNwnW4wP6oTh+ZsJNzCBMsWQ/HsS6SZd Cx8Ct16IBzSdBSFel5NOkHoNrorZoM0crxjQsIJgjjy+mkjHgeLpavcbFoifo+OjSZz3O16QhN I+uK8LhpvchoT7DFtYDW+/a2 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2021 22:58:06 -0800 IronPort-SDR: 2qgPwD8neR80/SdtH4pRH50bxmDr7msnaiMmu0nET+XLf24Atsm9LH9w2S7p7pMRphnBeo5pVx VOFkyyTuzt5tWdOljMzaLRlQ/2Y+vBgbMl5P6BLyAgHROT8V3ajdo6WQ+YwR34TObygZuUERZX rfU+sPmHgGS1V+3dgxOeo8REERCKgWHIYxzhiuWRBtY6dBheQaeAr6VP4LTAPeLl+kd1iFUoyd mqKwU7dlwbyE4M8F7GURh/yglDYKxcs47wr8oitkT1bgU4EtSPSZoGcLrNM5tqqKQP8I79UW3Y S3E= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:13:46 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 14/34] fs/buffer: use bio_new in submit_bh_wbc Date: Wed, 27 Jan 2021 23:11:13 -0800 Message-Id: <20210128071133.60335-15-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210128071133.60335-1-chaitanya.kulkarni@wdc.com> References: <20210128071133.60335-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- fs/buffer.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index 32647d2011df..fcbea667fa04 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -3023,12 +3023,16 @@ static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, if (test_set_buffer_req(bh) && (op == REQ_OP_WRITE)) clear_buffer_write_io_error(bh); - bio = bio_alloc(GFP_NOIO, 1); + if (buffer_meta(bh)) + op_flags |= REQ_META; + if (buffer_prio(bh)) + op_flags |= REQ_PRIO; + + bio = bio_new(bh->b_bdev, bh->b_blocknr * (bh->b_size >> 9), op, + op_flags, GFP_NOIO, 1); fscrypt_set_bio_crypt_ctx_bh(bio, bh, GFP_NOIO); - bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9); - bio_set_dev(bio, bh->b_bdev); bio->bi_write_hint = write_hint; bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh)); @@ -3037,12 +3041,6 @@ static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, bio->bi_end_io = end_bio_bh_io_sync; bio->bi_private = bh; - if (buffer_meta(bh)) - op_flags |= REQ_META; - if (buffer_prio(bh)) - op_flags |= REQ_PRIO; - bio_set_op_attrs(bio, op, op_flags); - /* Take care of bh's that straddle the end of the device */ guard_bio_eod(bio); 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: 12052275 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC180C433E0 for ; Thu, 28 Jan 2021 07:13:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7B43964DCE for ; Thu, 28 Jan 2021 07:13:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B43964DCE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0DA736B0080; Thu, 28 Jan 2021 02:13:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 08AB06B0083; Thu, 28 Jan 2021 02:13:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E6C6A6B0085; Thu, 28 Jan 2021 02:13:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0082.hostedemail.com [216.40.44.82]) by kanga.kvack.org (Postfix) with ESMTP id D0C336B0080 for ; Thu, 28 Jan 2021 02:13:56 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id A271C180AD838 for ; Thu, 28 Jan 2021 07:13:56 +0000 (UTC) X-FDA: 77754319272.03.books86_4810ae62759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 85CC228A4E8 for ; Thu, 28 Jan 2021 07:13:56 +0000 (UTC) X-HE-Tag: books86_4810ae62759d X-Filterd-Recvd-Size: 5123 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:13:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818035; x=1643354035; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wUwjN0vBouMAu1m5itQWMc9ceGIiyWjYqyXKNeHEsnQ=; b=gF0L10dA/HhLioR05YC1Utd4WfyVLshYrcMUq+YKF4YeDmV/ZVY9zBpg lGqzCIFk0K7ydUrRBBG33ut2PXDF/60o0ySwAfBtJ+zc1+epzka5OrYAQ 2LR6M4N0Ydt3ZvODw2z3y6QSfUBlLHZdo+4WAWRWfX0r3bYoCix6pl5Wz lC2DL1emS4B6TIDbzVTNOXPMQOO1i5KjRn7+RFHSi3bBQ6Q1DTU30s2Eh CCrxm8YOMBj6+nyAM4JVOyWHnd7sIoeZj5Lgzv1Velqe0KoF2e2rNL4KC Dzi+Kxszblf+Y2JwlEhSSZenXZAdkj13X6JmeYDhKFOwvfK7KPe9uiv0R A==; IronPort-SDR: Wc64/qH6+cRHUGLdYdXnq1ZEZ2FFmUYKyg3dvVF9FqyIWhrb2AeH0WiFv28pXL+bD9u7vjGz0G QDpPpwVWJoZUNQXK/6ICoTnL5XDprzF/xCUTk6JpeW5C/eMiYqw7Q522pZTJEOgd14cnZuuOpR GB0mLqTLjld+evK8Bmg/h6EaKKReh1vcOJSq4dsPPlMyjWr7gao6vKzmaFjGiS2OvelFMGymRd KRaQSpukLzL5PezVmzXxDtwjpQoDeBg9Rkq46df2aVZUe2L7y6JnyWwsQUlyAWvvYWpbocANUt dAE= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158518237" 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:54 +0800 IronPort-SDR: WoGQ+tP1Clyw8fm8lO9Q7OS8WkgOWxwpXjIqkZgwP6tY/vBz0Piusn7ySqZU7dGPhj448VM9dz USO50m7+e0Gzj8vzBrXRQkRMLRalS8hQN5pvixYXI9qHJll0EoaN9VfJ11N5jdC7ut3u2WGzgi jN3MF70miU+oDFDhUWrpt71KJd7/AkoQQEPoy+NS/B/aEMDIWuHkqiix2rJC2Jqx6IyCms5h8n FqeYKOW5tRL8V1RBPcaGkoWS2lAAKA0oJHnhxE88/tqAPSIJ0k8UtH8AAAlbQMIdCcWCVvuNqQ 85PPlYjOAzFezRyUkHAYQ+2C 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:14 -0800 IronPort-SDR: pB2cXSth9j9iO8qI9kro9aUnzxe7uC+CM4R5ezhi5mkNe3QJ3MeSZh+GGUOxW9ROBr/hgtgk35 3kQYC2KUTB+4qbQnoUg89GyqXiUICL6Lbb6/fLgPHrp+IuvY60iwR3VPtR6IrHib1STZYvjFII G0U9LFUNwbOn5ju9S5MOKHMAKhFoQxnYNKdJKA68HgaqnFN4j9YRc5HgIY3H1XVVcQBHwY13od d8yfo6WXgScVxvO/+aDCj5bBUi8Qq8LHMuAKgJFuukK9k/tSzy9sPaWEv7Xl8jluo8DC44HSzF bXE= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:13:54 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- fs/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: 12052277 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72B44C43381 for ; Thu, 28 Jan 2021 07:14:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0BC0E64DE4 for ; Thu, 28 Jan 2021 07:14:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0BC0E64DE4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9B4BC6B0083; Thu, 28 Jan 2021 02:14:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 98A496B0085; Thu, 28 Jan 2021 02:14:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 87A4D6B0088; Thu, 28 Jan 2021 02:14:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0117.hostedemail.com [216.40.44.117]) by kanga.kvack.org (Postfix) with ESMTP id 7132A6B0083 for ; Thu, 28 Jan 2021 02:14:05 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 40F11180AD830 for ; Thu, 28 Jan 2021 07:14:05 +0000 (UTC) X-FDA: 77754319650.07.rub83_160ea372759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id 2731A1803F79C for ; Thu, 28 Jan 2021 07:14:05 +0000 (UTC) X-HE-Tag: rub83_160ea372759d X-Filterd-Recvd-Size: 5659 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:14:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818044; x=1643354044; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+nCtEeEc6ftLNfXULXJD9MfOSjGF3wrLBEXOv9oezHI=; b=ioqXJg3phYOt/ADdi9ICQbsHuq75iqTwxH6b9keF7hRvX2fE1KVFW9gh Lj0qWViwN548KLBSagsehsTr8KdcSOZkav+S997lstSf4cWMRq3/Qoj5E P3ECahJn/sO06q1gTEH8Pz0Z1x4ADjH0s1nqoeTqBVsUzuAHekWsr31O8 L9ctt7DaOv0WMzLrI6MYgLpb8SAfGFvvNVUj90sgb+z+nsTHHIGvezp+z ezvnoUtI6bTxpxgI3UHCkvaX/5r5Le73TWnAkfm/iofG1ZqGP5e6giANI At2vBvuZZnzExaz8W6oePEDE7JGsaevA5b2e26u85WR3tsKxtFME2nZBk A==; IronPort-SDR: Erq1dY5PPwZzwbhU26XHZD2RSqN+3qrx9NKmch9+0XaJYeO9nqKA9poJhZY++IftCbQkqYBDv4 2ctDStdDyECI2IclezKEp1cXm73Kbh9n6Lbq2Rp1fq0BXe2oKHrBqsG2WpEhixLCxSnyTqwFmt e9EzEYVZnCSgxQguJzqgbPfHu8vD/5Hznj2DBMdYx5yiLJDKKYep8w5JAQ7UXZdXVCPEsjlwt1 l34h4vQm55a6YEUKpxWzxoZuI6H9E1uf2Ktq+AztKyAN8J5hcEaF2EtrV9jnje0VUrIbWre63R /QY= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158517391" 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:02 +0800 IronPort-SDR: HKTTjTOek76n2sUYP5JMkQ3LGqyR9x/q6pZpaZi3PAr88yQqItbAMmt6Jr/83pVxUt1a820vI1 I2nVDj+ng3H8zqtDjyhBwBljejbx/gW0pEPOCNKUMx83xsPBlXJvI77SiCKWh5tdLrxVDx5i2k nTC/SZkpFQNN8/eC9sSsEvO2wgNXsqlgk4FO9GLml3TcThUeISw/WIicLiTjUhM4ykdNUQsUD9 URe19ff+wTgU9fKSWjLoJ0/JnkvG0dwYDEG6a96vXr/AqMD57w54wnH0yetoY0bk+wfF9ls8ex 0LFjj1I+pBdn6XZyrGb8ptdB 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:22 -0800 IronPort-SDR: bKh0CeniWKxunCNm+jG9l29yuZPN3D1Gz/JAN/nXUgFIRD0d9U6vumFzntseHSRI/MX2HRMaPA UMPAuzQRLKKctTclKUM2aKzz/TiMAXwUZH3o+WrBdocCIchNR3Uaqkot1vGRPosruVN9zghU/S 4vOkqxWogelsFgsfoTKuGHPXS0UKS78L+4719OXJlLRXt4xtaxkQvpBhG3tmxGAdTiSRUPHfPH NMPtpPqqTRUN1CMc8PtnqpeNKU9vUEZxV6F3t4AwWzk79mqUHtn9Cp1IEV7L86NNsrAMFQsKWR ljI= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:14:02 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- fs/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: 12052279 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32671C433E6 for ; Thu, 28 Jan 2021 07:14:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BE1A461492 for ; Thu, 28 Jan 2021 07:14:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE1A461492 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 594596B0085; Thu, 28 Jan 2021 02:14:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 56AF76B0088; Thu, 28 Jan 2021 02:14:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 45A066B0089; Thu, 28 Jan 2021 02:14:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0116.hostedemail.com [216.40.44.116]) by kanga.kvack.org (Postfix) with ESMTP id 324976B0085 for ; Thu, 28 Jan 2021 02:14:13 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id F3C7E181AC9BF for ; Thu, 28 Jan 2021 07:14:12 +0000 (UTC) X-FDA: 77754319986.07.sugar81_20172282759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id DB0061803F79C for ; Thu, 28 Jan 2021 07:14:12 +0000 (UTC) X-HE-Tag: sugar81_20172282759d X-Filterd-Recvd-Size: 5262 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:14:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818052; x=1643354052; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0nkVYESNcCP1ZuiY2joF5zZXurD0RzvJ1s1BM2N7jGA=; b=rMw7f5Zfn2aszxVHsLN3Qco1ldO1RNt7emlTYxUGUbj2hF9oAK7RGyba ScgtZngT92PDvxz6wgZJ04aPukVLzQzLK2asd6cbLGSY2xnd8rUPfOTOO y7mvqxs94YpRN5whRiG/RRhb3+Ve/dctWlV304wUkOj0P4cZ+L7of96E/ RmBQmLAJfPEYolvdft6jYeVirnA+u7W+h4Dpu/wgBeQYHBkpck2KpjQk2 Uey120noChYiyoLe/DdzslrfTKpuRiq+vynqCf4goTDjGk4SqogdqNX0q x0LmbCtTfgKohW/Ui5IsPo4YqSJhc6CnAOcPz8XEHznbsaXFaO38Pbbsx g==; IronPort-SDR: xGrYfamLkIUoXwhisEgXAhi8FB29s9aDWPFrMwLTVkrBIyuvBl1AHKmWQ2oONQ12OFdG3XJqaM 9pVNhhYtK44bx671HW+xeQtj9e4buedu5kJR+UJbtH9EsISxugAoOoKc/EyAT+1UgF51L78vvi 4sal0PBrk76KNHD0A9S4OnVgA2pjH6DIi9iSR1/muRMWTGEHxith2trTW6pmDkB7qUgaXhBzgN Vv5Dn4gKGOcYN7Jo5knK7oKro0dIgMIRyuRp3k2w/J3CUOrWcAQeSdmHH3PsWQ+W5AcBRBVDjT WXs= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158518261" 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:10 +0800 IronPort-SDR: sKjTNISRMFp490/o2EYyoo+BNPgp77yvD8q2MO5uJ4ISEm+R1n1Eqmkhb9oN0Fp6qZjq+NpvUy WXU5NAYn+vyQLB0K7PbMmdJeTuESEKxXB74BgVokt4nkTlP21kG2D11YiuoCb93ehAguxdB6US STgKD/GYHU429KgpEML8LnpwEXzgWd1yALp2RyS/FQcX1GE7ZzwGynVVor5RhdhT0LBwZ269nK OM0pCTHFRTz/zkk4FBXPGS2VNFfmiXaYeAUO4s1ZSYd1qTIXiIrEn4uqJMeqDwm9NJRlwFjXSF GARyPSPYXJlwOLtzN8rTLlOd 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:30 -0800 IronPort-SDR: lKKhoxaMeyOwXqrT2FSzD4wN8uVJ+mvKyFTUKLm7JjK92Do6Pp8LlRaYGgmaQWgAcNgigcbWq0 dr8eH/C5m6jarJyZCPupuIjbqQYzS6I98zkdR7vs+3yNowqMQiZeF1CHZrTo/tpym1SjWfvRXs 6jUItt1/GcDgh349QalPLGcjYuMZ5A1EKw0wTA/1PN33qNlegyypjYwNakr5Qt7Zi77XOTVrdO glPMuXb+RS4OnELTigLzoH/k3P2LKO+/yrMNDKd4LQa/txopqXKI4iyznrBVm1YJBPOgSOjnjZ uxk= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:14:10 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni 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: 12052281 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9C88C433E0 for ; Thu, 28 Jan 2021 07:14:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 56E1964DD8 for ; Thu, 28 Jan 2021 07:14:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 56E1964DD8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CC0556B0078; Thu, 28 Jan 2021 02:14:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C96106B0088; Thu, 28 Jan 2021 02:14:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B104E6B0089; Thu, 28 Jan 2021 02:14:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0074.hostedemail.com [216.40.44.74]) by kanga.kvack.org (Postfix) with ESMTP id 9C5706B0078 for ; Thu, 28 Jan 2021 02:14:20 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 706A1180AD830 for ; Thu, 28 Jan 2021 07:14:20 +0000 (UTC) X-FDA: 77754320280.27.sky71_33105dd2759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id 50DD03D669 for ; Thu, 28 Jan 2021 07:14:20 +0000 (UTC) X-HE-Tag: sky71_33105dd2759d X-Filterd-Recvd-Size: 5115 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:14:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818059; x=1643354059; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SCctODBcoMVRMibJjtR9kI3GnL0tVZIiIK8qwMLhuQk=; b=cOKyFWkbBi9CZrFlJmsZSrWLB5j8wNs9ihrDN6JEwNeTK5qDlPfozPEe ee1JdS2HjObxooI4cJARykbCY/s0Ne67eAu/LRj+M95Z1GQGJRqMlgcCj GDhHaYgB9XGhvLWzgKLUqN5Tnwbjh5JnqN5WxboMWy1jOmC7T6ySp1xeW H1bxWfmCFAENbJTndjGyVKAsERHw1e8VO/nVKx4OhFKPV9KjfzNnMwfQB uenhzsTagMApsuxSARWjkFiKWUFnyndSMye4ISaL1iNm5VMUVHFaLJxDi ua0sSaZShVU5Oub9uqI7a0Pz0UIyFpC736Ppr1EJXtPvmoGwFRGf6DcU7 g==; IronPort-SDR: cY6KBaPgUT5qOLIqAbG7/mcnOLqkLDzuW/6dWezSPdKql3t4Ifpt0zhhgBokUvUWT/5po1SLhu IRq5pz2DSng1TDg1kpzRNfgdrAVXmk8Efv7yqzV6HXe2vwbzZhMQeceltApWGYGADENjw7jyuo wt+HJOxLzfbD7jG0Jc5Uo8hzjyK2gqgii5wbgoWS08aAQpJ6FOoAPdIBI/FMv98hNUP2L6VOUN JvzX4RBqCZstYqFhK6tbk3eSlRfLF5sqiVjHK+3TFiof7UtCJAmtn3xFrG7P65U3JZikoGdpvQ Tio= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158517422" 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:18 +0800 IronPort-SDR: gLY1ZeOW3bcRo+1Yk2zXGAPnpa+CMfALpYoVZCWpPsnA+IvKa5bP6KYDAiAfRlD0/F463FHgt2 pzoH9UZ9C/3nv1fLcIn1oqGlRdrCki4wu6agqOH2IkVJLJjuBwq8G3IiGFsUHG6V3GTXa4ioip RqJ+AhZk6d9AQGbwqFjyl3GaJrRdKQHnp2lTNkK9Pq4ltaiZEACiUUcbbOVkzv6I8NoW+/4OjK W/wmP/AK9iDpjnbiD8XtvuVNmUS5eEjfmqLIhFzsmI1v+vuHO/VqE+Sk//u1w/X2kL/963HO46 8OLMK9biClZqyBrODbaDSrsH 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:36 -0800 IronPort-SDR: SE/7jhzj8mUN4IuNpOkC3snrZ8NJ1clnXy6y5ds9FsX94ZBtriQ4uRa7QWKdGcnXbjLMCBoUCV muTlW54Qa3qPh6fwMtXMlfwP2+yfKLqOcAu45V7pI+dpenWI0L1OM9udcXtJMTQueAmHig5gDN d6OcRwyGrT7GxH48PliS/P58sqmLq3e242QCy6iyXTMgFXRd2EClUAs64FPFphS/GBkZYgQLMx xAByTj3G42kPYoeBIsWoRZMAgUwhHcuqehcOxGoJkKVhb66+D9X5hujEyFAgPHDC4Sd1jNsKev N7A= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:14:18 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- fs/iomap/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: 12052283 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F833C433E0 for ; Thu, 28 Jan 2021 07:14:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5D2C864DCE for ; Thu, 28 Jan 2021 07:14:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D2C864DCE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DD1536B0088; Thu, 28 Jan 2021 02:14:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DA72F6B0089; Thu, 28 Jan 2021 02:14:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CBDAE6B008A; Thu, 28 Jan 2021 02:14:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0244.hostedemail.com [216.40.44.244]) by kanga.kvack.org (Postfix) with ESMTP id B6C5D6B0088 for ; Thu, 28 Jan 2021 02:14:30 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7FCD51F08 for ; Thu, 28 Jan 2021 07:14:30 +0000 (UTC) X-FDA: 77754320700.25.store71_2d080872759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin25.hostedemail.com (Postfix) with ESMTP id 600041804E3C5 for ; Thu, 28 Jan 2021 07:14:30 +0000 (UTC) X-HE-Tag: store71_2d080872759d X-Filterd-Recvd-Size: 5318 Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:14:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818069; x=1643354069; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ehPvHcNFObZpIErrj099M/D2lwJDNRsp+vZtBu0oImM=; b=S0LQro8pZAcocX5ASQbzkWAaZpZHgQUoVMgsC8jum7XqBVfiISG9pvg1 A44DoMNXtDMDUoCRM+8EiNy2XRfVlXaXbkS4QcqgRCmLZTd1qtKfEfci3 FX6i+ptfraKc6XFIY4wRw+IxKtaMKPcZpo+bf11+Jorzo3F3zAmt+Y3Mg TbppOvsQ7jh7trjS1fJQOnx25dmqPa4aqYgUIIXw2HD5XhZqS/AsDk86X ua0wO9Kh4pDHqMqJjdgxHvqoSRS01nxEvh+fl6svfNd0NB9/Et033MLHb 5t+oCvaVKDbYr/m7tkYpabPwXOUBNedUoLUKR4fcsmOV9HmTn2gxehP4z g==; IronPort-SDR: 41GXtTTtkfH7+rPPkf7m5yNlWINA22gw8AAfIRsZKtUGc0qxq7RT9Avv3pIkq34sWBxU0WdqAI ct8a22/2MBRfhwtBI2/Gt28CC1Z1MtRqLcK6Fh6n21piCjfTJ8cx0SJgdHM9TcCiI/c6rznfS4 BUN5gcaLIQvkJzFFt5Acow8m8jdZHI0x14/vjLo6Ipz0Mmz5ln2CLOR7UHPqymfqZRMun3CjrK OVO2RhdL4bnbXow89HvWrlJ2knHQc2XtVqku6bU7AfHi18HdRRUHZRq+uN+Xb80kYOOlvhQiVD iQg= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="268892553" 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:26 +0800 IronPort-SDR: M/QOULpgc2r2sFkXrjGXgRJtKQwVEL47GbR5nKq4wbRsZ7ane5AuOvz0xE0xZUY4gd5OtHIYPN tVc1s9kMyJ8X+U9SQCZa15XM0ZUVdJNJLDVuy5zSOJc77YX+4lg6KMEhPqjtRb35TRj7AT47aL Vz6A2/bGHL4UTkI3FR2jO8NAQ4vytSq/0XyvPthW9J5OAc50xYkDw7zK3gn3PaZ/VmQkuVrEvz YEBpMR5XZeutV+3WvK2g7bqPUnV3W2lMneynetzdIPTNm3poSm9m4PW7r+o8H0NQKgX8HH2MWl MjvD3910wNBJ3wiP/gRzMRec 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:44 -0800 IronPort-SDR: 8zWpKV1GG73An1zpnhB0A6RHwKcvj53Vuxf9sCqOuA5ZBa5rmYze0QOVvU8HXRv/G7xpZnMIM1 owK+1cH03BzVuf34Vf4nPTxb3MJRxKHU7MPVsfYKBvoE5U6OUm3WvlKRFiuZT6me2l9YBpl9Dw srBAVfHgvdy6RitQaBWTWMkJB+swHKrWKKu/bnpunnMHs5/vTt80z06ovpDFKB7vDmFytTZ38T a/jEmxYBTtNgI1MsJxovm0Lez6j5sfQFarO3Hedm9NgwCWDpXDWzTcx88c/FgbEiOtdVVLfaVV avQ= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:14:26 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- fs/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: 12052285 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F25EAC433E0 for ; Thu, 28 Jan 2021 07:14:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 87ACA64DD6 for ; Thu, 28 Jan 2021 07:14:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 87ACA64DD6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 14F446B007D; Thu, 28 Jan 2021 02:14:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 125236B0089; Thu, 28 Jan 2021 02:14:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F2FF96B008A; Thu, 28 Jan 2021 02:14:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0197.hostedemail.com [216.40.44.197]) by kanga.kvack.org (Postfix) with ESMTP id DE4A66B007D for ; Thu, 28 Jan 2021 02:14:35 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id AD5F01F1B for ; Thu, 28 Jan 2021 07:14:35 +0000 (UTC) X-FDA: 77754320910.09.unit26_4a106f72759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id 9636A180AD830 for ; Thu, 28 Jan 2021 07:14:35 +0000 (UTC) X-HE-Tag: unit26_4a106f72759d X-Filterd-Recvd-Size: 5289 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:14:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=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: RubSP1M0vTeIJj7o3hkg1iFO+apIFOwvmsGzjobC6eSzswN2sRs6WE8EgbvkqMrPt6hxrJL3hD qKsiNEGG1R7UMm2n96xhEmLDVU4KeQxqpPhAW5kfrk/52xwahMdWyHBMwcuB33vT+JB/FwViaA fKIyWO4wrjkNqDDNDpKjfYuTCuiyzVK8TPpn4xw18/MuckcBPbyLPY14lCFhNPO/lmGTvInRou iBoHFyTuq5Ou1JBpaYYD2BRCdxbnBFe3CoJNN3GUbLvEiciKA8OOKDjwk7PMsw4OJMng1UqgCK cRg= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158518292" 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:33 +0800 IronPort-SDR: VRXBV0qbc10Zk0kpIT3dx2Q+6WHTaSQeG/pHHSSBHXw7G6dzCQ0E1PgRPrxIzh0rFf0cOOqlcw aw+AJ/tTEYanOt/kug/+G0cn3KOyKTd87DYd/cVJwEUzp0F9+tRO2/n7n5h9FfEcIai1Pilu0j 9CQ9hMITjCwIiQ9hM5T9ITtOZ1ORsELHujkQlAEtf4QrkL9g6QS/kNnAT/JVqvEoxshu7H9YFT 47+Zckk42TEDyRUM/jCoxD6KxnbznJpZC36aGjlP67ImCoo9V8Qu3kzVpcu+VH+cL9JP+sA9fO DuIwvZ3m9QndIHlf+Sx1XGO5 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:51 -0800 IronPort-SDR: hgdemKPG/3HHgXRADNUaRfIeto8NmW8LEHR468JLI5qNdwJ9I/Vz7EOVIHe6ux2OR8aMkXbCb+ hHmOp4ZL4+H3N5KG2012DyI6S+0eAji83o59kSvMRJsf1lkWorl0McE4AqjKkZANcW6TxQu0db Rg6QKY68t8KKdoDxgIWM8St6Q8n+pLj6fbsJ1LpjtPi/SVOVdnUNhjzT9HNr2ak6ECZBXsF3YT a/oz2zpRpm0NjKofMt8jO2sCHWsfpktQx0L5tGvTxbU6SR20ACdGgmG00/Fl2WObQ2KsI7nqdc S2A= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:14:33 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- fs/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: 12052287 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C87C7C433E0 for ; Thu, 28 Jan 2021 07:14:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 735D364DD9 for ; Thu, 28 Jan 2021 07:14:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 735D364DD9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 063796B0089; Thu, 28 Jan 2021 02:14:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 038C06B008A; Thu, 28 Jan 2021 02:14:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E92666B008C; Thu, 28 Jan 2021 02:14:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0006.hostedemail.com [216.40.44.6]) by kanga.kvack.org (Postfix) with ESMTP id D35626B0089 for ; Thu, 28 Jan 2021 02:14:42 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A3283181AEF1F for ; Thu, 28 Jan 2021 07:14:42 +0000 (UTC) X-FDA: 77754321204.04.tiger46_4f14d9b2759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id 7D7818005045 for ; Thu, 28 Jan 2021 07:14:42 +0000 (UTC) X-HE-Tag: tiger46_4f14d9b2759d X-Filterd-Recvd-Size: 5322 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:14:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818082; x=1643354082; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1876bf0CQ4oKwKjrcbLTUHkm2JuWaJTsdB558+rHPRs=; b=JENJpQGSYuWBzg9Ajxkz/UkTlNQNQE68BdPIiQhqIKV0sTZvDfP4TM6r XLOGf+VozD5arC/FKefpe47rK1QjtDS45CzWMaywcL9/1tQpuL/tBLWxB WoESMq3Cx8UKxDwtjew6jNQ1Coz86oWtlnUnMAEJqw6NsPhtSIHXEKnX+ Mwf2db+nk5yK54qrdPWX4SAKvgQK6OZqyil0hYDzRZPDksd4PelqCy0O+ CKhdf0/hh1cO1+PyyF80BoCCoKnuKZsV6EscfGCsXOMTMksJDgRBKFfGh 1x8hhDh5wxEr5ekUd3gyJLr6zbXMwRj/DiGq+n3oH3q0PSC2UEvQk66V2 A==; IronPort-SDR: IrbI7/WrrAKng7EkJ4wDrArwuXu6c2mR9HAoAbtXQzsoa/EhAC9K+nx5Nqj26xoIsiwDwEmAls osQ3mkRjXd+9TrMft12ygbfWbHsT6oRxRo70A2VLqVQmC9n3If9iDjTbVkxNxHWVBqx5dhQaKN OlCMfla9WEDi3gUESaCmPs6DzGIETNKUXrmcgCIcMPWEZvdeeKjs6Oy637vmWfRU/CZXQ130jo lqRlinJ11MtdX5vIsA/0thK1fUejs/m+lqNGtPk3B+cgxRpo7f3QXDoyjrqGSPLnba4HW3pT/A 2y8= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="159693943" 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:40 +0800 IronPort-SDR: MQEcIKVmhfS4UaZXoBTx2b97KB/b5ewJvQT46GsAPuma8HAJPqCbxce3Bkddr34BrEpzPSexIp owfHN+B0v5JDl7AXu4OSUHpvTucZDBtSddgD4LWxopM4U/+fseO3m4idUXncdw2h7geoS/9gQd imNRkc7AGy/JLgOKN8yV9Vdkn4OScJep4tyxJXdNQqt1EfBmOEHklrjVEsXD5KdBO+r2yBEYe4 qevlclqLBgNxZRxwW4AmTt6lRnv9bDjZTW4AEcFZp1n63gjXe95ZBtblIZBkAIelNCOcLYQT0V ENNXOKY4J+MGS/7P9lUYJduY 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:58 -0800 IronPort-SDR: AZlMO6gj0EkPLCOgk+c5DT4WNDhjCfw45MtadZ5/GiFEmQsvwhsbRFXpLpdTLbQmQEemYM6EDm tOJGHTOsUuwCnKWQp1EvZsc2vVv2mGBlVwctpi8EDm1Wy6X1cWP44qswXm3cNGjgKR2lWgrabH PKyOztqBt3vFXNBi+4zXssLa4rCI5pehsTeRPvX3Q8KhjR216EOs3fiNJCh3n7IcfWfe8KNrrp msksZa1Bq+VYcOk7PDniLMLHnLtDMI1z0ihKaVt3jNoNuACs7lGXhymeE4zWEV78rp7w4D786X hJ8= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:14:40 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- fs/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: 12052289 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1568CC433E0 for ; Thu, 28 Jan 2021 07:14:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9FCA564DCE for ; Thu, 28 Jan 2021 07:14:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FCA564DCE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3BCCC6B008A; Thu, 28 Jan 2021 02:14:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 36CA46B008C; Thu, 28 Jan 2021 02:14:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 25D7A6B0092; Thu, 28 Jan 2021 02:14:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0170.hostedemail.com [216.40.44.170]) by kanga.kvack.org (Postfix) with ESMTP id 1188A6B008A for ; Thu, 28 Jan 2021 02:14:50 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id D5309824999B for ; Thu, 28 Jan 2021 07:14:49 +0000 (UTC) X-FDA: 77754321498.03.sea72_3f1842b2759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id B72B328A4E9 for ; Thu, 28 Jan 2021 07:14:49 +0000 (UTC) X-HE-Tag: sea72_3f1842b2759d X-Filterd-Recvd-Size: 5329 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:14:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818089; x=1643354089; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3pvsXY5ThsGIWZu3d1vhsE8XvMocy29CAsL/BvlC2XE=; b=a6+SWHRdvN+bjISOWrS4h+hcBhhZ69cv9qP5+s6pydrobVKDBtxOXmhC jjU50DIhm0C+Krif8wLIlc9SlLD8vbosfyT2UdxM/zuffXAi0pUiaNX0K zezSu9orSfXtaWzni9cOa/TuYdSkyPZiIMu/TDD4cEylCYVVieqsvpTz6 Sy0yH6uXJgIv0pi1M9YPIgHRlvjeY/O7ikdIvMrLKxSgw68GXO93zZy7z Zh3ICLRNqeLnLKunA/p5+6Fz8ksyQKxLi5mdT0iG3IybELewlzl6m7+15 RKoHvJcPo7RiCryPjZ/550nTZ4EXO7s2G/PABnHnRBPShmOYyJBchHpc9 g==; IronPort-SDR: Qi0aphQlBVdWuVEIkBuoTdXVHtqR8+973IK4hzHpsqq5wKaY5zyWjeGMHtFmKjDqcVVAg1rXYk Jd2lOT7suuLPB1Pof2mNzluevOzUD8xX2m/VJnFpC/yh0DaJ0Lj97iiIAau7+mISFZ6fY2At2F Uh1AMPLN8fJrQKYn5bmfDAE+DKE3CjnbMVfnvHkVDKyS002v+80BKm1jDn87IqD0ypvvEuBTeM rQU0BeclvdH3VJWzLwBRnlc3IwGN8TUCrgq73+p9lRpOWcRW1A7Pj83V+2fuI5KGShCwu4YsyV pN0= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="159693951" 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:48 +0800 IronPort-SDR: iG9SSunyfBCcHQTRWh1p2l8TF4zlhcMDmL2Lm1s1h6Oq24llbvte2qAk4+4xJUV3C1xEnHqk4O i75obA1zgw+6+Z+sAxCLcv8DnjJeEPs/MsSLn7xtnydtJfrRDyTav/R/AS+CXE3eTV1QIRTiYL yRvJTvy5VnBD73XPBrfpr5RHsPm00PRinjHUU0PqeAMB9HwTUcf1awGrUocGqAxybwaaybO4K9 emgXeLPqxP27/WUrKLWJzvp+NStObJZSrACEtn6LdXoKddpZ513Bx/jlwJs5E12KVVK4kVquLh E1e4R26B8rR7CG/CuL/Sz/FL 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:07 -0800 IronPort-SDR: /NPjYa5/vzKcQxwITziayqgew/xym2P+2wPZ/H6tqOBM0Xhb9g154b50VotcIn3s/gPeO6yJQj jaDu5T7BNEIYITi6TAhnovFoYzPUstLQt0EGdLi5t/kGP6Y/bNfbV9+olcDvctAzlPCNttcR2B XcI2j3jvNIAhA1FsWohm0Q1E2hEvaC5Uto6Y7wmXZKJ1CZQCBzspE+8o3ZgyvyjFSagVsi+kvR d3gH64xpw3ry94057Mia9wtqUGJtdB9qbq+w9vxtVohjFozpBIeHLdl7QNCYcftS3gwSjr5dcQ UPU= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:14:47 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- fs/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: 12052291 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54DABC433E9 for ; Thu, 28 Jan 2021 07:14:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E8F5E64DE7 for ; Thu, 28 Jan 2021 07:14:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E8F5E64DE7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7668B6B007E; Thu, 28 Jan 2021 02:14:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 716156B008C; Thu, 28 Jan 2021 02:14:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 605286B0092; Thu, 28 Jan 2021 02:14:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0250.hostedemail.com [216.40.44.250]) by kanga.kvack.org (Postfix) with ESMTP id 4D5026B007E for ; Thu, 28 Jan 2021 02:14:57 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 123041F08 for ; Thu, 28 Jan 2021 07:14:57 +0000 (UTC) X-FDA: 77754321834.26.party36_3605e6f2759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id E2F671804B669 for ; Thu, 28 Jan 2021 07:14:56 +0000 (UTC) X-HE-Tag: party36_3605e6f2759d X-Filterd-Recvd-Size: 5832 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:14:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818096; x=1643354096; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XPaYjcRaIFpnYMD3YBMMFWgQznGRHjSurwf/uHFVwCI=; b=cUGRtqJ9CnWCwCVs0wa0pSk3YfkSWYLRIaN+aADA8CHtVxVaas0cU0le K9zytDaT/5vAIPXhpT/167AMil1V/F13lgu39iQy99GBTPgAbvP4SMWbp kYCrj3rLFxtG4s0m/RoXp3YIsHXCw2uIAQWEKbke2Kaa2nQFRSQcwhTyh Y0CxNWp9QsBbm+NYYf+wAWCUbnDXLovJ7F4eH1y1Gw72U5cep6VFzn4nl VY7WDmOX8hGtkd4W4/wEuH6tvcWFwrU62SOkddzXDNhWeSSidoUsGuCzV LcPHDW3R7o1k7BZWW1C9ko6FyHGuB70QLAhUkox9TXO1KQYQ80VxJohkD g==; IronPort-SDR: 9n7C4A6/EAhT7iP2xDCASD93y7+dtSm3bw0EA2fjnTVbP+9l8/u5F2s0s/JzKEqe29HLBrYOQL wRamxYwS9Khwv74hjEf/pWDj8ilbGiq8muDqwhiI/MqElTb4JDGvmxY3RU3OUSCtbyQwIKf9DT 7z7saXBEees3pwwN5fDGV6eRv7dBkKkkxNzK3/PKFXbjbHXKCWUlTfAqh2qwmlPnlbwrTs10x0 /lVX+I3kE18GEGfmXkA8oGKEjSxakAlKuDtDaUfIgR2JPxMjrw3bsF9IlQEFFCaBckYifLCdPl nII= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="159693964" 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 IronPort-SDR: xWJidB2VLPnGNq/TtZhDWrf7lHO92XywdgUmnfHefEudy3igF3NGAn2JfDvre0vFG8tqUiSioP 94IYxHOtbO6JSoivkG+i7cn/JIKV/HZAl93XLYLKwwi3hmNKpDKphroe5DAfAUXS3GrcruzGZ2 m1ENKoiNWl74os1Xk6QiF6DfoXSr6HAVd05rDejzvwYrZmjFL9JLW4Req2GYvSDO/yGHvNow3B tIDcqGWngVzoim80c2muA3wo5z/8VfWcKbQa+T8UHL6KbSDqLUnxiQzBogynEXGcXuA/pJbcEz 6mwQ9KoodhBzfMCUSAv62uUl 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 IronPort-SDR: m1TZ+g0HqYnNuuEaVgIMmloDXGiOQeWVkBatefSwdP931h6/Qc9uK8rnz+JHWAn0f3QBmOsUC2 fXJ41UlgQQnfdBQndrwCq+hQtl7mr6AQW85+ZjLVP2rPUrLfDej915AJE+NjNtCGI740sa3D8g UGQ9bx3fpoJbY98zSPHF13CT5IYtiyfyvVxvvVA5VfTuNLKWU4ZEgYs5jdqkUbRYa6sajX3DSU E+nFYRIRokBPoO+x05JGw6lqTR47HYfSK6LYXKwXfQUKv6zaLN0igntqoauBJYDwbicxGnznwF roE= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:14:54 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- fs/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: 12052293 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D11D0C433DB for ; Thu, 28 Jan 2021 07:15:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5CBEF64DDD for ; Thu, 28 Jan 2021 07:15:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5CBEF64DDD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D32C36B008C; Thu, 28 Jan 2021 02:15:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CE3426B0092; Thu, 28 Jan 2021 02:15:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BAC796B0093; Thu, 28 Jan 2021 02:15:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0244.hostedemail.com [216.40.44.244]) by kanga.kvack.org (Postfix) with ESMTP id A77E76B008C for ; Thu, 28 Jan 2021 02:15:04 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 72CC33635 for ; Thu, 28 Jan 2021 07:15:04 +0000 (UTC) X-FDA: 77754322128.03.vein81_4c17fdb2759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 4DE4E28A4E8 for ; Thu, 28 Jan 2021 07:15:04 +0000 (UTC) X-HE-Tag: vein81_4c17fdb2759d X-Filterd-Recvd-Size: 5287 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:15:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=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: HsAJURt/e5E38NjJhqcIjpf5h5sLG01P4e7CycHD1X4Gh98H3YNz7tUjkTCefB6h5AhlOg6xC8 Rle+98ter270+q/mksjQy6Dc1NQpQB/e8JQC7icaA3aiMH3H29lJ+7CAflgZ/OYgOkU4hDaj+S h5z9t9fOuef46pNF4aH1b8UBN1FKcKEtFoIF8P4q2j6+V7n1YOKEhzia4rfimOxBrrgxxf0wwl vyu+POhtM9qD2evIdZDGFwkUu1X66oIgdBFlImje58iJ1X4+5gsF8+5Ez+F6I6IG/pk6awXgUQ raQ= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="159693975" 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 IronPort-SDR: 8MDa7mUdJP1cPd3WRPwOu0mKdmok2pNZGKtmq1oV785n9lrB85rTdBPspjsF830RqxhAg6wyad GqZU801jrMvax4Ca0r4IMN8ALb6DQhAbAjHXFciD+u47yBQaqFr7dUvPT+3vRiI41Df3fBK7ql 4u9DpHlg4ep6efVYzuk2ezfjIRZy81wfomtg+L3wEZFWRuAaV/Xrou9Q+rhiTXIAmVS6OvB2Br P3moxTw/3+LedcvBa5jj3j+iDqsyK3Qr2NK2Ss7QmfnUJhj52txAO7kHtOrLQbWTwyBZUo/qyB DYOGUAcZyj/BrL5pnnisxE0i 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 IronPort-SDR: RvbuIrKpOmmqZ+oQPbnvg4P9b6yDctCj11PDSHseFUe3NzGe7aNswGzNT7aYrNNymGc7RRLBwA EyS5TC5ya2f1DBzchV289rrRJN4G30R6UcKQHWHLCT1EqyVYm8BdK2p8B74xj927ubYpSXJJYX yqNCzY6cgWt8a45E/OUvNDiMBg+lmhS8FA2ZqgTfl/62S3ZiS0x0JS7q7oikS9hfGQV2kW1Mb+ vR4fnDhlmPbHKapqq2eTmDAeG1Ipck513pFwPBeDtMk5IkG3qgl83KvWp5povuzxSWxrnJjDon 5kw= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:15:02 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- fs/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: 12052295 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 707EAC433DB for ; Thu, 28 Jan 2021 07:15:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0469C61492 for ; Thu, 28 Jan 2021 07:15:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0469C61492 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8D1746B0083; Thu, 28 Jan 2021 02:15:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 89D7D6B0092; Thu, 28 Jan 2021 02:15:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 764B46B0093; Thu, 28 Jan 2021 02:15:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0079.hostedemail.com [216.40.44.79]) by kanga.kvack.org (Postfix) with ESMTP id 63AA86B0083 for ; Thu, 28 Jan 2021 02:15:11 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 2081D8249980 for ; Thu, 28 Jan 2021 07:15:11 +0000 (UTC) X-FDA: 77754322422.19.beam62_3e075672759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 02B361AD1B0 for ; Thu, 28 Jan 2021 07:15:10 +0000 (UTC) X-HE-Tag: beam62_3e075672759d X-Filterd-Recvd-Size: 5780 Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:15:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818110; x=1643354110; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MfH3EN2qKmNoDMJp2ceJniIXfb1rQ8RA/+9VrY6oRvA=; b=CG+7AIpML/wEg2I9uWLDcRXn/vBRYkXnG6tCqdTxGWHgFcTj/kQaIy/6 RyFb2hUnkjB1PVNi0OIMksTFXkATEeDrfEcHufmqfpEHyfZYtLjvHFDsh cSSgo2mK5rWhRaGxrXmqWOfjnvZXEJ+PHHayz1N7dbbOE6nPZypA78XS+ rpZn0YRceUtpI6r0YQkdcp+niPzUU23WhZ3PUkqEGlxkpp3ow3h5q+bn+ IT4u4cT0h+8twmNnXhLujBVY/IVx4m+dZr3yEQcD9ZfDcA+/mGO+bhyEG xYP9I7L4cPDBaAi0rJpjXiPUpAIxCHq0HDnlXR2AToa9+4PoUpfKyalEq Q==; IronPort-SDR: o8ylXr1Y3+eVBDLJ9Bf/URMEPp5gNd+LAiRmMH8qXQZWsmFp8xcfQ7pTEKiJyKwqpQWfohsEM6 2AVrpa7qq6EGkEyuKQw5MwjQY91VkfEpRYQSE0in7aqKJXKMdYfI8oJz5XW8ia4QKSuzikTMrl ChxsYuky3qTV6OfLzvixOwN+ta4g1JLxkHN4BmScy+JdBznKYr0EpAtbbVHORgpmheNOk2mktj BRgHrT7wiaaYFd+ZYtyYjN86h3YOUUvbShQeTkviErkyFFhmJsgokR006rC7g5XocBBLFNpVpg olE= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="268892624" 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:09 +0800 IronPort-SDR: Za/aSrqCdocRnZgrE0Ap9aBEB7TLj5kM4KXJM/WcFk8MjLmAnCFLyaH0t/ntBITTXEhYCxrC4d jX9BuwgeC8RrRDd5t7vTdV1Vm986msqlR8EzeMwghonq/ppfYlmOVD7xbwhDEAhtYf569EsP5e 3R8NEOQsUHvp3nAz5+/I1N17J7kYY5s8uKgijvOtQvXRvdTwJRgtPFz/AWq+AjamdfC8I/Cc+x Vqjw4fqI00m1vsaZMgh/xjTc2CNBonMpmxVt/KYpKkJjQ++41GFeBgbH3fV90gX7paYxVCsb/x 8LTz2vXnZqtLG7k35AiUQnnD 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:26 -0800 IronPort-SDR: +1TgXZ9HjoaS+86zh+aLwx6S7ZpAYQ4FpPhwS5t1uQfka+31mML1LQsLKCwFYYGr030vY+BCmC AGfrPosPVl95WjEssU5DCDJZAyR1khEX1jpqrqTT8P7u968xhLua2/lVUN5jQ7ABVZJAwAp2MY 3XKOPyoMsT52VNuagfol6rCenkg2OIsIErUkF58mfwGPLsAlDeR+kVK0eqUX532NsUF4ctVre4 Iqd0vyO+udw10x//vZBdiK4usAo9yvQxvOxxYG203IoYDBmyGC3oa9VGSQBs+2yVysQ7ZPCJPH kDc= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:15:08 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- fs/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: 12052297 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D66A8C433E0 for ; Thu, 28 Jan 2021 07:15:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 727A264DCE for ; Thu, 28 Jan 2021 07:15:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 727A264DCE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0AF356B0085; Thu, 28 Jan 2021 02:15:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 086716B0092; Thu, 28 Jan 2021 02:15:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE42B6B0093; Thu, 28 Jan 2021 02:15:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0084.hostedemail.com [216.40.44.84]) by kanga.kvack.org (Postfix) with ESMTP id D8B126B0085 for ; Thu, 28 Jan 2021 02:15:18 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 99EBF180AD830 for ; Thu, 28 Jan 2021 07:15:18 +0000 (UTC) X-FDA: 77754322716.13.kiss86_5f012d82759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 7B93F18140B60 for ; Thu, 28 Jan 2021 07:15:18 +0000 (UTC) X-HE-Tag: kiss86_5f012d82759d X-Filterd-Recvd-Size: 5120 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:15:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=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: /8wVczywg9JIdU0fb6uCfnm8SpfaWQ7VKiZlZCrXPWxPQWhdHqRuK5WyIZEF9768UzDRvWXiry OAr5BAGqe++ocNuDXu2rtfVHSlhaWJ5ZpKfFdiVYbKCvhvQh2fqgKOJox8TT+LmhtZz/qfsx8G DiuCwST7QGraF9qaMBWrOFim27SCHaMy4zAFJ1gpmRK7ByFfkBvE7O432Yz5C3kdI9vl3RdeCD 0aK9X1oA+l0nLONLaD0OsKaWGLGVGLtrXqtYtI0iB0BcptTO0KE0j1j5iCBAw+0Xti7PFUbo/1 zoQ= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="159693997" 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 IronPort-SDR: dK0OzsoYDvKxPW03TjX0JjJ5CsNjrQ2lGnGs6UIpbvCtlkQY6k3hEwscimQHJXub/RXVml1h9E NMXcEPUkGQ96jm/3o8HwlN+klP9E7GjnyuvmcUasU9IORenslnnvjDQrq9Vmq8BxCLLGl+7BdP 6BaYiKlx3uQWHhdSqXGLfIQCurYOv3QqBgqi0QrHwF/bYzQ/v7Tdf6awWvfO8kk8krvF0pWkvf ewuv8bDuYsGTapnAafidAhmUxV/e6AhzkQyu9LJBUlqZFAm7JUeZqkJcwFhKSZaeKExb758eF1 OsZfbVqO2/oRDs1Pt5AYJ8ot 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 IronPort-SDR: VKPK85FFDQ0ubYH9k6Rw6wieHrPcfl4K1hBg1VEjOVVMtv+Wn9OrY3VfBreYbEOSh7D7aOPUjq dJWJ6VlQs6sIYpC3Ssc6YP0uwWxx1b9TT9J1h3Z9GJWPAkbpd7nwyEHzf2X7DKDqvOlXI3kZN0 S1wmdVHTrX+2YjnNZtTeKY+gTEIX2ZCvjrzBqJLi0bsvbsghiV571IsEQgaSLG4TZiYK5W8fXC DCDkO56zOq766cZD9jubbH+fYuelJGqJtYeO7naSGnNxMZmGQNaOGjq3DEnkrTfIYty+jvU6Mh VMc= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:15:16 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni 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: 12052299 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B470C433DB for ; Thu, 28 Jan 2021 07:15:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1A69464DD8 for ; Thu, 28 Jan 2021 07:15:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A69464DD8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A73AC6B0078; Thu, 28 Jan 2021 02:15:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A491B6B0092; Thu, 28 Jan 2021 02:15:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 911726B0093; Thu, 28 Jan 2021 02:15:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0021.hostedemail.com [216.40.44.21]) by kanga.kvack.org (Postfix) with ESMTP id 6B54F6B0078 for ; Thu, 28 Jan 2021 02:15:26 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 311B4181AC9BF for ; Thu, 28 Jan 2021 07:15:26 +0000 (UTC) X-FDA: 77754323052.18.crack99_470f0f92759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id 057AB100ED0FD for ; Thu, 28 Jan 2021 07:15:26 +0000 (UTC) X-HE-Tag: crack99_470f0f92759d X-Filterd-Recvd-Size: 5168 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:15:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818303; x=1643354303; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OE6wZQGKF5NjVuNViqgkr5UqZUb/ZMMrnmgRjBTexFA=; b=GNh5UCuVhfvgn4mpXDqE7B1MPr9Ikhn8DvGbixHDDKgTNcKIFv02ylWr QPrxOP43FUTJBWeay0zCxn6CT81j3Bk3conyeZ1elcI4qPcq5lUzEq2uF jzMxGw2DEgObMGr3Q95KxpYrVaxbnnPxFVn9nVDqpMEtSzDVI/o/twR30 xISUXs+j0iqNVB+F1IL9B1yCNQJz8hfrjBhCgMLSifduAZoGGLpshnvUk jk03IUY8leKu9nA27p5Vi3uDALfHu2zhq75il4o0Hf6z5Q6jwn3puGHKd fbMY1Y00IMF/fBgd/S02VrZvQRDtWRu4kaSBSam0N26oT5ngad5rCAMoY A==; IronPort-SDR: KL7RRfLnqkVuF7oD7MCtqlpCksu0xH/9KW2ta4n7WvUfZRgabvWr2MmjmSR5YwitipW9Pttb09 HrG1LUXCClbtLNUphDz9R49dzifLZsU7u0IyS2sEJRDd3QFsI7I4IiDmYsrKm70sHmQKLknbLh kfK/mSIK0L2FfOFO/hnPdHIqE3mVhGkgwOR8jdv+8HK6wpHsjM0j0RtYp4jhtIWgdqZXj5jw2V x1iFb73F6f7jS5HTxus1D1KNWK8dWjNoc6hTchuVYnRwgFgWsWcULxVtJi8i+QTOgbDuLWLWRK ip8= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="262549175" 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:18:21 +0800 IronPort-SDR: RHYfjmiErM4Pu48hEb+o5dtxyQdfCNjY5am6vKOivqn2VbmjB0kGizGPCsOEppNlK3vmYcuauh f5fPytP9YSKzhAsMVyGHEO/vDsucnGX9Gqta5H+9WPetv36TlrY6Fu69XQdqxB/UJj9ENzreAh wMXINKuDy/bEhuYzuy283nSFVfsNBglSqhn45rBMGewHb2EwtPgk+jCCYjiVCv0YUNrQtp6qVx MUhl1QtnspczqdUrsE8CFc2l/RTrhcCrjYe+jU1qfG6oluWh1zNZBmbVIl8+qehdto6y55cyEh 9FEQ57UmdqTCIkBWVP178EwE 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:42 -0800 IronPort-SDR: AdKYJH34AY4CiVzOXrR15FurWGZi/qDC6z/alYko7jfVcX/SfFhaxUFqHY45DLkP4HiXq60mY4 qy4n2aJHjpVtmV4fSh3ShuNif1qvectRI2b9x90Cd2PVCzWhg42ZluTJX4mv+bwQtY61xYcAp/ v9bG8JoB/eY2HEcD52Jlws++S0SYBgnZiIiDuQlpbjK+vhOG1JlBdY+QSI5Hl4fkjAcjiES8aY m35tunBPrJVbQ/UTOrTX0lDDjwM/GyWBlapp84/HLby91yE2yFuR9fqy9YimXKC2AojA6XdL7Z KBU= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:15:24 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni 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: 12052301 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B350C433E0 for ; Thu, 28 Jan 2021 07:15:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2D24564DDB for ; Thu, 28 Jan 2021 07:15:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2D24564DDB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B84796B0088; Thu, 28 Jan 2021 02:15:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B5BCA6B0092; Thu, 28 Jan 2021 02:15:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A4A036B0093; Thu, 28 Jan 2021 02:15:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0145.hostedemail.com [216.40.44.145]) by kanga.kvack.org (Postfix) with ESMTP id 90CE36B0088 for ; Thu, 28 Jan 2021 02:15:34 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5C2D58249980 for ; Thu, 28 Jan 2021 07:15:34 +0000 (UTC) X-FDA: 77754323388.20.hook10_550205c2759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 26A00180C07AB for ; Thu, 28 Jan 2021 07:15:34 +0000 (UTC) X-HE-Tag: hook10_550205c2759d X-Filterd-Recvd-Size: 5562 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:15:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818133; x=1643354133; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cXmRF2Su1ZKio9gUSME8BeoE9pXLYvn976s4DXPYmio=; b=riDgczHtQ55sztDIv1QtqAsu62wyrDtZqeTvkrk1OGiUIgQn8gCHIiBW uKrCGemswmebfHDNHSfI2IG5fcyNC7Xw8JgAT/ZsoEXVvpI07z4Jqfx9r vIWw6geKkqEC7JgmGXpqerfUOEWzUBEnxjM5CnNSsHG7IDr5fh2hb+psJ CtXoV3+qGWQgwcikOl1Ysa32E1+5c6eXMUlUvq94y3i7FE79hkIhlZ+2a mM+3oO/qqN6UtSOSMskbrEUVClRWSiKn/ppjujmW2v5tCV6f78Wwmm6WW eSnUaIrmt90wPIOxIiE6g/CIxgzM+ZvBtKUHKRcT6F39vZxmTx1D9olfG A==; IronPort-SDR: AAZgXcGcTpwg8tYkEJQplkL+gAbd7AuMsCT40VXX1sT0KfeVl8i6fs9mhCU52CINJuwCARcTGQ tbUzmKCNiE8Px6uaJTBWpVfgAxcVSJUzKOW3+X61zkF/Q8UejvrYrubJ/8AHYATrDzLFgYNix4 WaJ+duM3KdWWzEXHsuLmhwYUIF+XypYxw90p25g+Ogs3r8m2tj5LoWSqR5M/o2U0ptWBZ41IV+ luyhshdzE4hYp2+G6WlInQU8tWHQmQb1NLR+2v7ZGH4wVFYQGkujN1p0/ibhDNr0bO2njR3Vt/ fak= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158517537" 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:32 +0800 IronPort-SDR: ZVF7KARRrjx49YxRxsrC4Bhl80KR3/4XxM+wxNmjQGhh2sumkrwXfWBW3YoXV0YG7Plb5cf428 9vjLiV2tFavIkX0qaYOoddb7V8HQWGks27c5dBstIjK3V6grwBTsfFwuTGlE19yUI9ncQ1k3EJ FEyNm0B5vAAhVTKZhqcJRN6E3JpYJ2I2tCYQzpVOXOJGCRSLGGmxv3xbSvC5UiDbfjYQbH5BAg 9EN2XEnRReAH8tVnLKvHPBJf1LOczyGg9PYyT3dJyZxaoc5RNKa+FEmI7CBZ9Xq1FQfXPKSxtO umzRd9piEccPN9ShWU1Y5DqR 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:50 -0800 IronPort-SDR: m+UU9TJBIXCvSyFz/7O2vaYmlOCexk8ewW0e2kOKkWSuwpQEVFGI+DHENO7Q1Bf8IQzN352Mi5 5dDETfg3/zd0aL0yHDjcbUD/eS6byN5dveWHS0JlUn01j5YdJYnuzvRhCyGEwEvsPLeiwlo6h7 h47UPjLb7UDOPAPFC4EqcqtJYlkeHUwpVqBF6C8WUdWbiBbzIaj0jcLgB21R8kA1PJHycwAnr3 51c0CVR8EMmKQ6pEvymjZcIoINYcADZvl3xn96JSQjk6KW59eeMqwpBFLuZiCrCp4Zkdz1bD1j kZU= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:15:32 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- fs/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: 12052303 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2523CC433E0 for ; Thu, 28 Jan 2021 07:15:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B720364DD6 for ; Thu, 28 Jan 2021 07:15:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B720364DD6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1BFA56B007D; Thu, 28 Jan 2021 02:15:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 196B36B0092; Thu, 28 Jan 2021 02:15:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 084C36B0093; Thu, 28 Jan 2021 02:15:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0069.hostedemail.com [216.40.44.69]) by kanga.kvack.org (Postfix) with ESMTP id E2A6F6B007D for ; Thu, 28 Jan 2021 02:15:41 -0500 (EST) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id A6EC1180AD838 for ; Thu, 28 Jan 2021 07:15:41 +0000 (UTC) X-FDA: 77754323682.25.crow59_3005ad62759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin25.hostedemail.com (Postfix) with ESMTP id 84F661804E3A9 for ; Thu, 28 Jan 2021 07:15:41 +0000 (UTC) X-HE-Tag: crow59_3005ad62759d X-Filterd-Recvd-Size: 5304 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:15:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=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: Cl2tT9TvZNL4Vt6kl6Qs31fQalrHodEceTjtIM6ld9TCeGp3JbsXCn3vrQQPiwra9/LA4FuH3I sAbUwBo3Ir6cG/9KEkIGFsq8Y+bt9zQXiegbQwffWRPClI8iqk8jLoy8euBWG7duvZJ+VHzHHQ jeCw0JYy7x/dh7yPgc37eT4Th5LvvkhGM268BKItSV+cW3fEoU2XseAlAF4BLnxM+r3C2Dt4uI oLROjYhS4D3Fq2+V8WoMmHhgfggZISC93CNzopiVYPMnnqaDXLOQMkGqieZAiozoW4kf/GZ06Q 86g= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="159694020" 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:39 +0800 IronPort-SDR: 9f8xrsfrbSoYyETRErdehAmJf0QAfDMt3THGucRxipS2GH8wzn1O8YdSuuhErStKRQAOeVXFUv v9sVHqLbMyMX2yHmGsUBpfEPnbt/kf002+de7Mf03NBkG9OukeO7T0n7/ddr3ZToabgu4WmMFc aNuDfv2kuK2RrK19rdRXMssyFjEPbBwJ/pgSMChEjxLQybwu5LTwt+TS22dhvJ06oEEQUHErcx Sb65KvpNtqvQuLYA4fimFgMI8yg00w9URjC7egJZawkBOUXB7mo5M/SflI6/ijI+/TewAk8q1u 2JzoeI47PiFsBK4bPLQTwHVC 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:57 -0800 IronPort-SDR: +tiKd6++/IklFSy7iDJaHbayhG5AQMYy46sQaNwq7O80dac1IZ8ZNlxjx4DxYbXvKYV6ua9+Jn RJlpIO7cWN3eoJjRXIKMWDgWPb2hxGv4A2WF6qkOCUmJWGu679NggrholDw0Y/zhUvvPmDPwT6 YMwbiHmVzfz4ihKs4Lc84G8Ml2oUugQkKwA3saHG7RouPgTCEOWIbUjZGA0E7lav6RMiRyuWgb NQVibBmtLzaPM7sNDSYSURpVt5muhPgCfKQdUKPwhH4mY9hUDkI5QyIoSDd8h2S0Ai5kAfU9pn AHM= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:15:39 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- 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: 12052305 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6C1EC433E0 for ; Thu, 28 Jan 2021 07:15:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 68AB164DCE for ; Thu, 28 Jan 2021 07:15:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 68AB164DCE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EB8FD6B0089; Thu, 28 Jan 2021 02:15:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E8D906B0092; Thu, 28 Jan 2021 02:15:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D7D4C6B0093; Thu, 28 Jan 2021 02:15:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id BFEAD6B0089 for ; Thu, 28 Jan 2021 02:15:50 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7DB291F08 for ; Thu, 28 Jan 2021 07:15:50 +0000 (UTC) X-FDA: 77754324060.29.shape75_580c2042759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id 5FF7B18086CB5 for ; Thu, 28 Jan 2021 07:15:50 +0000 (UTC) X-HE-Tag: shape75_580c2042759d X-Filterd-Recvd-Size: 5107 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:15:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=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: kHOfY4x2njjmznCLg3zQHponc7si3wbKSglinjkigUyjHfFvGdf/aPTgAj9Ej1CExrbkvVuy9c GMJlO1tWBM8OxISax231fmhYyfcPv7+JIKBdm6QjKZXSB+vlWn0zDvjD/7oE147Xh/mqrGVNb3 UOjTYlePYIpwEs6QgbgEnyVe8uCwWhBRyLtTMaOkMj4IsV8M3ce8X48E4afG1PwqobxSj99eVN wTffdj8VQMuVmEHakG9ez/jCHjvHo7nbx1hh2VNTFjnpE3qmQZjE8WH4A7uWfbwrz6+uZjDQ/i YMA= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158518447" 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:15:48 +0800 IronPort-SDR: LDxYsiW8AHU+BIxeR/ssffxz+xo4kSFmJEoS9Bfhdd36FtafNlAFOWYIoLa0edLKEI8dzf2tvQ kbELavrpUpVv9L77mzQ4iIo/vj2NhJF942gYoAoD6Xoe1jEIYvtycJ9COf2iNoM7CxOvI9Wv9U erDhYehLzawSU5xDHFHfI8lliuLAm326VD2/rikJk9bU6Z9DnhUz1RKMkwO4CSBRvYSuLIsRr+ bWlootLv0QzP0eHAM7/EpbbslMmq9RPjz+RMBpM+7JHGBEHnUN9trW5zYFDa03fCFWn0CV8wcn j+RjBMOXxETQYhHD8E8DD8yV 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:06 -0800 IronPort-SDR: QLHAdyBGhpMGQ+9sBMvXF0omk88B/E7BRqUoQLtstkadK8XTqcLBOvZ/pjpZSQe5Fab6+IJLIs ck58Xl2YqFxcQH934VbGmHAxVZYNpxUZEqIAo35K+cwpiHURts0rCHDJ2TNufJwwd/0szVEfZu V2kbFpOqLyVucrhtvqpRhrkBznCSCkx3a3rZqsYu2xJ2ZrJKihugfXyvxYjD/F6eNL2QYyPhq5 GySOsYgZ6Jfrk4o/qsLABBe1b7+pVB/jDQ0aaMBZEhc+3I3KzSll4D3O/V1q5DDbYD+ht9Zxf5 kSQ= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:15:48 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- fs/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: 12052307 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92044C433DB for ; Thu, 28 Jan 2021 07:15:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2A95264DD8 for ; Thu, 28 Jan 2021 07:15:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A95264DD8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AE7E76B0092; Thu, 28 Jan 2021 02:15:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id ABDA66B0093; Thu, 28 Jan 2021 02:15:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9D4226B0095; Thu, 28 Jan 2021 02:15:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0030.hostedemail.com [216.40.44.30]) by kanga.kvack.org (Postfix) with ESMTP id 875C26B0092 for ; Thu, 28 Jan 2021 02:15:58 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 4FF693635 for ; Thu, 28 Jan 2021 07:15:58 +0000 (UTC) X-FDA: 77754324396.09.wire71_2e101752759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id 2AFE2180AD830 for ; Thu, 28 Jan 2021 07:15:58 +0000 (UTC) X-HE-Tag: wire71_2e101752759d X-Filterd-Recvd-Size: 5963 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:15:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818157; x=1643354157; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Y9+Mnjxua+V7f2wybPN6k7Lk3+3v11itMxG4MZ3QMkM=; b=RYXg2a6tiujSNdCyfDN5HjKk52DFYz1SXj5wkeJ+PMsqKT6Wvc4HtMOL yLK1Ru+oj1+NeyMim3sRBmlI6mgTJrGpspicBTgNpUdjaVjM6djLf7arX pHr599vFnXdgv0S/EGiiudT2eXs4VF71I3OCkj8THi8b9le/LZma1Ps2l yarZJL5SEp/XnLzZOKf0m2eRuyy6tAqWhe1Ey5ICY2j5eLsw+IH9Y9fqJ 4e1oBDcQ8QwsM16AT07JsfnM0uzWW/KxZoCVhhKqMIoakBhKo0uaNq13E nIRZOGF35ggRgt1t1T7ET1+mTUF6UF0Sc5UjZQSypOjk8vxJ+wRM/nb/J A==; IronPort-SDR: hFx5e/vYrV3VszYCldFox+90xQNA6IM4GRcPE4nRwiMXnDdOUIScKboqbzLc6dRyzZF1u+J80u MaSep8W2l+dYcCGjcy5+B/7ZOmLW1tE+ccFmcnh6Pdssubui+vtOnCFkoBII3MUdXgloqBmeRn 84r7btc8OFG3CWWCVxa2HCfAG33+Kr0nzHQXCO81Ght+9k65qxE6UW7hQWVMskv58h0PahOGyl wPH7nmeXhy2gGbbR78iFMOOYfR9i07ncw4pX98k/qx5wS9ZjWuNqUEIIp5fDjo+fAYu8Gq6RAf ZEg= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158518465" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Jan 2021 15:15:56 +0800 IronPort-SDR: 8E5oUj4LEy+DUAG6PP7JqJAtuT0kI+zcgEug8FA41AtamdwzhoSwGkJKXCGTXij+3r+b5cZ9xL uIg0uNUN6Gl0mbB+vngZLTujcn5M9AXzqkEblTrI0LptgqMANWRU8f2ZK/76Z9q88th02Nx3L/ 2EoH5WSbgrDqLt1L6isjKe8OTUcjrVWnmckEo3EeCVSVQPUTwYpeLcTy4iOTiSBo5Aabm1y0W+ iKX3ZWKuQFcih3XBgmB9oUwpKwiL/TgegVbuge28e51EzZ0zlWrVE2gbzHx7rD/g6+hDOEwEiN zKkzKFMc+PCdt7wScjh/1kwx Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jan 2021 23:00:16 -0800 IronPort-SDR: MJghY7CI3VIGR5/IaW1FKfL3TP8YTcGZMlKgwb78Me3B/B/3apRuuzh9zoIBvsafPZo8P1zI7O tvlMLEPWxNEsao+d+OWmeAfzkHQtyrR4CezWVDYJlrvLmf+2864qvNG9WiZqHSu38lUOwqOgWr BwUEJ5wQyzZ3OCyeIORv7uUc6VzLa9ZZ6RiC/IlKAQuXNbiGRl7btRhvnWciISjEw6c6WHvSr7 U7MWRK7LEz7DNkLYA3LIdhi5N4PJW+ftjhgTNZ5eyVeVGIhgT6If8NwOmXnpUTI7IymY6dp08v 5GE= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:15:56 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 31/34] iomap: use bio_new in iomap_readpage_actor Date: Wed, 27 Jan 2021 23:11:30 -0800 Message-Id: <20210128071133.60335-32-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20210128071133.60335-1-chaitanya.kulkarni@wdc.com> References: <20210128071133.60335-1-chaitanya.kulkarni@wdc.com> MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- fs/iomap/buffered-io.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 16a1e82e3aeb..08d119b62cf5 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -241,6 +241,9 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data, struct page *page = ctx->cur_page; struct iomap_page *iop = iomap_page_create(inode, page); bool same_page = false, is_contig = false; + struct block_device *bdev = iomap->bdev; + unsigned opf = ctx->rac ? REQ_RAHEAD : 0; + unsigned op = REQ_OP_READ; loff_t orig_pos = pos; unsigned poff, plen; sector_t sector; @@ -285,19 +288,14 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data, if (ctx->rac) /* same as readahead_gfp_mask */ gfp |= __GFP_NORETRY | __GFP_NOWARN; - ctx->bio = bio_alloc(gfp, min(BIO_MAX_PAGES, nr_vecs)); + ctx->bio = bio_new(bdev, sector, op, opf, gfp, nr_vecs); /* * If the bio_alloc fails, try it again for a single page to * avoid having to deal with partial page reads. This emulates * what do_mpage_readpage does. */ if (!ctx->bio) - ctx->bio = bio_alloc(orig_gfp, 1); - ctx->bio->bi_opf = REQ_OP_READ; - if (ctx->rac) - ctx->bio->bi_opf |= REQ_RAHEAD; - ctx->bio->bi_iter.bi_sector = sector; - bio_set_dev(ctx->bio, iomap->bdev); + ctx->bio = bio_new(bdev, sector, op, opf, orig_gfp, 1); ctx->bio->bi_end_io = iomap_read_end_io; } 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: 12052309 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA5D3C433E0 for ; Thu, 28 Jan 2021 07:16:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5BE4864DD6 for ; Thu, 28 Jan 2021 07:16:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5BE4864DD6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D7FF06B0093; Thu, 28 Jan 2021 02:16:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D2DDB6B0095; Thu, 28 Jan 2021 02:16:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C44206B0096; Thu, 28 Jan 2021 02:16:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0099.hostedemail.com [216.40.44.99]) by kanga.kvack.org (Postfix) with ESMTP id AEFA86B0093 for ; Thu, 28 Jan 2021 02:16:06 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 728138249980 for ; Thu, 28 Jan 2021 07:16:06 +0000 (UTC) X-FDA: 77754324732.13.pets59_28143762759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 536A218140B60 for ; Thu, 28 Jan 2021 07:16:06 +0000 (UTC) X-HE-Tag: pets59_28143762759d X-Filterd-Recvd-Size: 5122 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:16:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=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: Gr/hcQv8rb8vjRE3Au7X16iYt+eRQVokJcOz4MQPXqc78y7+8aZH0TtHdXNoXRyuGZChMi04Pe /4zp4ppKVTjuXoxTngweia0TbtEvqPQ/kYcR1T89KqGrtsmmFgj2sF6WVvcXdOYDHYxLKLZ2/L V5T0A6eeltEqA1HtFc6ZAl08tFEn6AYSHVzl2GV635lmzHrn2ew+vusBcM7B8avvjrfRTm/OPK WnuNuxeqUQ76ymiZ43S7aBd/LpHtJADPjyOxJcKrhgn4ORBYxWuDZR+a0grAUkAY0bhzwJO0Y9 AwI= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="162963497" 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:04 +0800 IronPort-SDR: LGHLr/voYaW+4mXyPls3dJNWlcdBGn64ARCRzub17EoglF2JxIAeykDeY3AGqkU47YYL8FZ0ZP 9PWEHiR9d0GYvALRwJnqnOOz0aFPFF2kIxmBNEIL8mDzMP4L2dM7cl6jvEo5EWuEbDOVvufYPK vVYxyNnMkPSujNzmuk86RDE8NRHQXrjg3Fkwj2m/SD+bEZIcX9RBHMPXy6aXEJV1X2Z020Jd1n n49mjKs5w2BmaIPdtQ7GO6BczwPbm8K6o/Qu6/PdBiMGAzpMqD9K/fg+Oe+zxmuvukwGIlVrRX WmMFzV8Ih4D/VQj0aaU2bol/ 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:22 -0800 IronPort-SDR: Grws0RkRukNGo7nyou8ZmIctRPf+YpsLcKEKHc3Y9j2gH1wu+DvtqTycxE/+Um75XSsvYHsJz2 XuCl7g+xJPknbJtkfE6+aL2ksGkx9esZlvJSCaOOok8lPoOpNpuMTJUvJF76PXh6twtzc4hV4l Ck271Nzyl0bN3jPxPpXSp854weGQ+wyoheQ1qJh2ewh7GEZUQlec6Cx5gMyzUS7NDfOacpsNSA i4cQzL4qbQiTmP11yVUjlWBUXU4/5eKNIGO+C/0onsAsvTsPxAAYkHYwd4fug7gJV2TpCU6JnF 3ZY= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:16:04 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- 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: 12052311 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23F9BC433E0 for ; Thu, 28 Jan 2021 07:16:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AC27E64DD6 for ; Thu, 28 Jan 2021 07:16:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC27E64DD6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 36C3B6B0083; Thu, 28 Jan 2021 02:16:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3429B6B0095; Thu, 28 Jan 2021 02:16:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 258DD6B0096; Thu, 28 Jan 2021 02:16:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0054.hostedemail.com [216.40.44.54]) by kanga.kvack.org (Postfix) with ESMTP id 1506B6B0083 for ; Thu, 28 Jan 2021 02:16:15 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id D92B83635 for ; Thu, 28 Jan 2021 07:16:14 +0000 (UTC) X-FDA: 77754325068.14.north18_4702bfa2759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id B99DE18229818 for ; Thu, 28 Jan 2021 07:16:14 +0000 (UTC) X-HE-Tag: north18_4702bfa2759d X-Filterd-Recvd-Size: 5422 Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:16:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1611818174; x=1643354174; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mzuBJgEjO7736zP2e3T55gtpCfO2cszPJHhO/o9ayC4=; b=qfRrFdPiavsixAcTtOgZ0mPHOJR7xSkdFXxASVNcYUftEAsVh95MQ2WM 8uZmIq5fNhPQglvGrgqb3LG/jjii9zlZh0TKOZnlejWVPZ/33cBKZRcFK 7P/OYH2R0Td8JqkrY5LYMLcbfH1psKaRBKcJccXm844KUI7f8/RdMJZXe lFhB3MHIiFHrRfbv/z31AWiyHo257ZWOlYhqnEUY11kazd4jVystJ5gQJ cxdbYTE7seFXnFgQWxC0zvKjs2J5qPMg4QNEDSHqbaMFqVBUdVLkbEK/v Wu6gPD68HYfTLkjuEjdUwL1oj+eTEYZwJ4GF3XnAiRN+T5455wB11DGOM w==; IronPort-SDR: Q5ouPltstpZnhWYh9k03RfShVKC4Z86V0Y2B1k0iCpXO5tCAnAQ4hLSBoQHoXPeeGXNWwN7kMT f5xFhoW6RRckPh3gJQXg6Sf+cImqCLvReUTnzZggMYcuefLE7ac2nhvtQXsbuP5v/y+Fetk+Zu v0OWoAb13eoW2JtHUVpY4SVv5w4CuewYBD/iwx4Bo4a+phWcNm5YN2mS6y7yk9kFYcBPUAPFjr 2oi37afhNsDUloaXxYSAPNE/MVWah+qtOqZ2e8pWIYQn2OJodzHBmgZQiSLHNbNWwhcD2oZ9Md c6w= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="268892742" 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:11 +0800 IronPort-SDR: aUAV5Vyt80XcAfTXH9ghivf7ApYwQRiG6WEUXmePheMuNIZZzOUr7WJQVkb8H2HKbrvkxtP5il /QozRjLuHvj4at5k60D9qRIxftc4h8PlJYM31q08kLmBwW1teX/wkqIR4F3SU/4K0NqAbvbvg4 ZK57HlHsoK6+kK/p730KlXIMha4LoxbrC6JaZzFo7heG8PfZAFw+L95rV8B97ueRL65hL+Fsto W8NBLQO1Exhd4RR1FaGsWU6Dv+P3CsFavNJF71TbNNUJrlZe/tNHd0w6BaJIsHLt67PCjbh/WG FsWHSIOWkmwSulrq99GkZgaY 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 IronPort-SDR: g9DYrZw82vrtcoqwLuT41C5LPwtay4x47njX4TQvn100PG3qzIQDYIPSbD2aKZ0nambVfkCSmu JHC6z8/1ifbcXhuz1R2nfguMjBFRQ4RaTCr3wehJDb3ERuWQ1NBrP8es0szoYDQyY3216WdfEV JcMopMzzk+/Wudlq5O10ELulyKCOeTk+PuDGw5+9rtJas4CG58lZZY6nLuQYmFyKdDpDYbQYnL x05lIaxi3M2yfAJSgs6mfnc20aeVZIpUbieSq2c4z3+si2ic8ziehclZMxZZAWaM0XsUZa2+hJ /C8= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:16:11 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- 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: 12052313 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EA54C433DB for ; Thu, 28 Jan 2021 07:16:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BD8B164DD8 for ; Thu, 28 Jan 2021 07:16:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD8B164DD8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4F4916B0095; Thu, 28 Jan 2021 02:16:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4C93F6B0096; Thu, 28 Jan 2021 02:16:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 36A0F6B0098; Thu, 28 Jan 2021 02:16:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0115.hostedemail.com [216.40.44.115]) by kanga.kvack.org (Postfix) with ESMTP id 2300E6B0095 for ; Thu, 28 Jan 2021 02:16:21 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id E15EB181AC9BF for ; Thu, 28 Jan 2021 07:16:20 +0000 (UTC) X-FDA: 77754325320.18.vase52_520aaa12759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id C35AD100ED586 for ; Thu, 28 Jan 2021 07:16:20 +0000 (UTC) X-HE-Tag: vase52_520aaa12759d X-Filterd-Recvd-Size: 6326 Received: from esa1.hgst.iphmx.com (esa1.hgst.iphmx.com [68.232.141.245]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:16:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=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: +jzqnmePpmFZYw/aTKqaQ1TyzTeEJXO3OC35CTqbTDvciqQzDSb8V+Z0cPeToF3Yckl9UfYNTa /dA/FkAJtaeA2KiHGQWI/m2Nkzd+VgrdtHcRcMZ6l0c003SSB5n5e/volMU/kLD9uk/Uh0Isyv gUpH9d1BPwuuN9kRPETOmyBurWQAu6BaKNbv3zxgtS9sciQtj7AdUBGFTq/vh6tZg7E6wYSL4Y cR2dBm1DbcAIoXy/joXRbrdpPBgsJkS5Og6TvcsnZhYbXHVzGjd/D15v7qLfD3ZjCTo+TDWlVT twI= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="268892759" 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:19 +0800 IronPort-SDR: q/hkV+9QLzdBeg8wond5/HAqhMdZfzH0JEaHh/+fAuZ2uuMLGM6SYImhpehOBSJ4a2guH2T8jS /itAGnciqSb4oHMhrd/PPyGOBpI5oilLQl/zK10y7IwWD7W5oHmbZPjWJWderKexuj/aLU2sVl /TWd//ZuPrQNgHPSsL7tnSnSS3YcKvYjCH1xLINc6cAm9i1cgCu4etMJAiBtJeZmfkQ/RakvkS DyvkdwX+kqWe8EszWcMTl8uV04GR0cfQlxfHiWZx4YaFDX8lLdZ+GhiZnVSKJCh9zpIVghGC0M bacfpnHPoDJNzYbx+UkGq/nH 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 IronPort-SDR: e2VgktU8Igp+G/4kwCau3Wofn5lcroMY0YPC7tNcu39YNL7JBNMa1+cKXT86WcuzihvSj94J7W 8sv8AfyOojzHeLFV1vgVT8Pm71/iwcQAmabu9Ufd/jwBkzWKoKpTzhJn2DWIwNp2e8mqIx3G5A LS7tN5JWZnYOGTkwZ/LMhdAEhsm6g9R10Edu6WiLHx+xz1R0nO/OSJcMH5j4uo+XVYn8ORNhbv mynrcW4WJ2Z8dThUFTylCCg25lF4TIegFSZNE+eSh2Iz0rquG/Dk4lImC2ZggxF5isWDJ8MWSG Bw0= WDCIronportException: Internal Received: from vm.labspan.wdc.com (HELO vm.sc.wdc.com) ([10.6.137.102]) by uls-op-cesaip02.wdc.com with ESMTP; 27 Jan 2021 23:16:19 -0800 From: Chaitanya Kulkarni To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, drbd-dev@lists.linbit.com, xen-devel@lists.xenproject.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-fscrypt@vger.kernel.org, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org Cc: axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, konrad.wilk@oracle.com, roger.pau@citrix.com, minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com, agk@redhat.com, snitzer@redhat.com, hch@lst.de, sagi@grimberg.me, chaitanya.kulkarni@wdc.com, martin.petersen@oracle.com, viro@zeniv.linux.org.uk, tytso@mit.edu, jaegeuk@kernel.org, ebiggers@kernel.org, djwong@kernel.org, shaggy@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, damien.lemoal@wdc.com, naohiro.aota@wdc.com, jth@kernel.org, rjw@rjwysocki.net, len.brown@intel.com, pavel@ucw.cz, akpm@linux-foundation.org, hare@suse.de, gustavoars@kernel.org, tiwai@suse.de, alex.shi@linux.alibaba.com, asml.silence@gmail.com, ming.lei@redhat.com, tj@kernel.org, osandov@fb.com, bvanassche@acm.org, jefflexu@linux.alibaba.com Subject: [RFC PATCH 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Signed-off-by: Chaitanya Kulkarni --- 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