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: 12052945 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.7 required=3.0 tests=BAYES_00, 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 4FFDDC433DB for ; Thu, 28 Jan 2021 08:12:27 +0000 (UTC) Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CC6126146D for ; Thu, 28 Jan 2021 08:12:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC6126146D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=ocfs2-devel-bounces@oss.oracle.com Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10S88vdF138941; Thu, 28 Jan 2021 08:12:25 GMT Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 368brktrtm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Jan 2021 08:12:25 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10S8BnYv106951; Thu, 28 Jan 2021 08:12:24 GMT Received: from oss.oracle.com (oss-old-reserved.oracle.com [137.254.22.2]) by userp3020.oracle.com with ESMTP id 368wjtq3qx-1 (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO); Thu, 28 Jan 2021 08:12:24 +0000 Received: from localhost ([127.0.0.1] helo=lb-oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1l51hu-0003Wt-QX; Wed, 27 Jan 2021 23:27:10 -0800 Received: from userp3030.oracle.com ([156.151.31.80]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1l51WN-0002nl-68 for ocfs2-devel@oss.oracle.com; Wed, 27 Jan 2021 23:15:15 -0800 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10S70Fi6012178 for ; Thu, 28 Jan 2021 07:15:14 GMT Received: from userp2030.oracle.com (userp2030.oracle.com [156.151.31.89]) by userp3030.oracle.com with ESMTP id 368wqyvt81-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 28 Jan 2021 07:15:14 +0000 Received: from pps.filterd (userp2030.oracle.com [127.0.0.1]) by userp2030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10S74Jid040504 for ; Thu, 28 Jan 2021 07:15:14 GMT Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by userp2030.oracle.com with ESMTP id 36bqd38xp5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 28 Jan 2021 07:15:14 +0000 IronPort-SDR: WtxgnJiem5q3Vwv4xxtORispM+10DdTVEcJnfHreSQS7I5/taHrIE7a/z8R4IWgmikVVztAbd7 jf9eENP1fLrMbtM6K86K8A7I7vLSQ/V31MSRrakZUfMc0jD8ZeAI3b/ejSSslNCTXs0m8TwbcE W2UNVCVjvzC3TFU5aQKTrZJ3O5bGQ6lJB9CgJtJ6m+dmHKGsRuR2O6A1gH0WHybR/Hnm12N+dp Bxh4WzD0lL77BYBjO7c9fHUMUjU1sCztOJVj+1EZMELP3KeCONXOokoDRaCADoMEgz28ouFuF+ Hp8= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="162963392" 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:54 +0800 IronPort-SDR: ibO+fuXEkqSWSzWO7SSStnMeJ8pkKlvXlD3Uiz37LG4OK4XGWRH/3gRPtU6jSAjcKsp5z2OwUl m48OwdydkpcLYW2MAxtnYZ+K531eTf11yUydorbRGyRG6XjCvbgMTN6w4Ab/l+J4iEkXaHtC7p I7tUcfPccI0vWV8Cdf2HtRBlxzgU+PrXSmcj0NPoVvXM+NcyUN+0K5jTQzAHk+TTLTXkXI70Qq Umc70l+nYRUx6rxNGy77F0M96Lj5lvy00tIoDadFmchnijy516Epr9xAkqX9w5e5zRoPvoM/dW hsfU/BqSsBq+ENLTQWLA4CIS 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 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-PDR: PASS X-Source-IP: 216.71.153.141 X-ServerName: esa3.hgst.iphmx.com X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 ptr ip4:35.160.12.30 ip4:52.34.195.46 ip4:35.162.181.10 ip4:35.162.44.129 ip4:68.232.141.245 ip4:68.232.143.124 ip4:52.36.78.170 ip4:52.86.68.205 ip4:52.86.226.44 ip4:68.232.142.99 ip4:68.232.148.20 ip4:52.26.217.74 ip4:54.187.119.58 ip4:216.71.154.42 ip4:68.232.143.124 ip4:68.232.141.245 ip4:216.71.153.141 ip4:216.71.153.144 ip4:216.71.154.45 ip4:199.255.45.14 ip4:199.255.45.15 include:spf.mandrillapp.com include:servers.mcsv.net include:spf.protection.outlook.com -all X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9877 signatures=668683 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 phishscore=0 clxscore=233 mlxlogscore=592 spamscore=0 bulkscore=0 mlxscore=0 adultscore=0 lowpriorityscore=0 malwarescore=0 impostorscore=0 suspectscore=0 priorityscore=148 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101280034 X-Spam: Clean X-Mailman-Approved-At: Wed, 27 Jan 2021 23:27:08 -0800 Cc: shaggy@kernel.org, sergey.senozhatsky.work@gmail.com, snitzer@redhat.com, tiwai@suse.de, djwong@kernel.org, gustavoars@kernel.org, pavel@ucw.cz, alex.shi@linux.alibaba.com, agk@redhat.com, naohiro.aota@wdc.com, sagi@grimberg.me, osandov@fb.com, ebiggers@kernel.org, ngupta@vflare.org, len.brown@intel.com, chaitanya.kulkarni@wdc.com, konrad.wilk@oracle.com, hare@suse.de, ming.lei@redhat.com, viro@zeniv.linux.org.uk, jefflexu@linux.alibaba.com, jaegeuk@kernel.org, konishi.ryusuke@gmail.com, bvanassche@acm.org, axboe@kernel.dk, damien.lemoal@wdc.com, tytso@mit.edu, rjw@rjwysocki.net, philipp.reisner@linbit.com, minchan@kernel.org, tj@kernel.org, lars.ellenberg@linbit.com, jth@kernel.org, asml.silence@gmail.com, roger.pau@citrix.com Subject: [Ocfs2-devel] [RFC PATCH 23/34] fs/mpage.c: use bio_new mpage_alloc X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9877 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=0 adultscore=0 mlxscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101280040 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9877 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 impostorscore=0 phishscore=0 bulkscore=0 priorityscore=1501 mlxlogscore=999 lowpriorityscore=0 spamscore=0 mlxscore=0 suspectscore=0 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101280040 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; }