From patchwork Thu Jan 28 07:10:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12052247 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=-11.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 91D65C433DB for ; Thu, 28 Jan 2021 07:11:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 31A7661492 for ; Thu, 28 Jan 2021 07:11:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 31A7661492 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 9927B6B0074; Thu, 28 Jan 2021 02:11:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 91B446B0075; Thu, 28 Jan 2021 02:11:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7BB7D6B0078; Thu, 28 Jan 2021 02:11:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0198.hostedemail.com [216.40.44.198]) by kanga.kvack.org (Postfix) with ESMTP id 5FABF6B0074 for ; Thu, 28 Jan 2021 02:11:41 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 278CF180AD830 for ; Thu, 28 Jan 2021 07:11:41 +0000 (UTC) X-FDA: 77754313602.04.vase90_160abe72759d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id 0B01E8010BFA for ; Thu, 28 Jan 2021 07:11:41 +0000 (UTC) X-HE-Tag: vase90_160abe72759d X-Filterd-Recvd-Size: 7760 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Thu, 28 Jan 2021 07:11:39 +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=1611817899; x=1643353899; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=BWhCtPmFmY8SRwjALXcTfESKnsKfTCmOrzddkgcZe24=; b=najx2apuJj8Rzstic9UUF6wkNiJmnz1WB56S5SNgmasfosOAzrepDxzF /J9Q7w+qfB7GbJesGGScfJzUjVqmT3JD9Hf+/14UdR1NlTBPnsVbcSukI r91h8dUn0Khd00+bcfmD/cfOFbgH8s8pAQ/2CZa4Aitm8Atb4sBHCAbbi qFh0N60tSMFdApsojgGp+L4OVaUERC6tJr7fwmH3eGX+foXOJH2OSvXj4 hoh5CSYDMPZKG719NfKurUxYb61CNaGu0Lu0Fb8PPh/ln4KLpS5WjQaHe LkxgIihXWqzfLLwbtm4v5vOWHKMx9/FeINee+X2oC1hcVxTcmJ5PR7H3Y Q==; IronPort-SDR: DcsnukpQISUItjw/3mPN9yo7KUY8waGnFxMnd0YKOpyKBggOjdfoFYXUJoAjFmvy/716cEa8ST RnouTO57a4AkOmI848rDmopu+THN6DkJF2JRb3z0FDNIsoDGNp1MA3T+oBj3H7et3D3PN4Ygsm hnXnZU0y6JyxLigbjF6usGgdq2gLr5jJP3bX9gdnmcLmvNO93TtCzKX7K0mni4ndI2rJPpN0Ih RVD05ZzuRSdVCMZ8nq1P0WWt2k2lxpyx6QE17cYCyDO5rq8kuk6k8IIJRuCU6kGift9WrpZkpC Zro= X-IronPort-AV: E=Sophos;i="5.79,381,1602518400"; d="scan'208";a="158517978" 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:38 +0800 IronPort-SDR: xJ+Lk+FGBtdUnECiK39gHJfMBJpMu62waBHaxeupQB1CcEZQIPoaQXGDyHNqlsEfeRyMw8EDHl g4FrNvKoJuIcKa21XH+KHM9YBUWiFk59es81g9kIZ31uy/h0auMgrvWMhBHAOMO/88YXGVFxuO 4KAaLXyWyv1QSgVQKOEAqHsF7/pEXoSwtEXWhMPS8yX0eSQ1Qk4MkTSlPRdDjYgUxM3zu7FJEK jqcBWe2RODdsna7TSrZXZhbu7Z7Q5hCSqZ3VvKVALu2inVTJ+p2FheXMOBu1ZLXbdZs9UzECPx SibyxnSUNdP3p1wSvMQB6ejA 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:53:56 -0800 IronPort-SDR: 61Jf/0E9AfrbFBR+VL+aX9SYCVB0aW8ut/7/jLtTqvhkleWzu7b9JjkuOaGgMYwgMXw5C5Sybl VeNQs3LEjTqxDsR0ZyK8GA/cVYEZNMX2maaVF3ljBoeSQOO/ApbWgebfLMlSCkYd12pl+6neKj zn8nHOcIOMnNA2IBKV67KMXVLkXTllokNu+jCcdgoa5YFwfQecWL2vYSP5hgldmlqCiXple2ew fybG/wLzJMKvqPxvYQ59ATt+ZGQv1DjVDDtxXyNp0NJ+IswNbwLOu8d1uiq12NaSa1/W79MYTO wq8= 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: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 00/34] block: introduce bio_new() Date: Wed, 27 Jan 2021 23:10:59 -0800 Message-Id: <20210128071133.60335-1-chaitanya.kulkarni@wdc.com> X-Mailer: git-send-email 2.22.1 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: Hi, This is a *compile only RFC* which adds a generic helper to initialize the various fields of the bio that is repeated all the places in file-systems, block layer, and drivers. The new helper allows callers to initialize non-optional members of bio such as bdev, sector, op, opflags, max_bvecs and gfp_mask by encapsulating new bio allocation with bio alloc with initialization at one place. The objective of this RFC is to only start a discussion, this it not completely tested at all. -ck Chaitanya Kulkarni (34): block: move common code into blk_next_bio() block: introduce and use bio_new drdb: use bio_new in drdb drdb: use bio_new() in submit_one_flush xen-blkback: use bio_new zram: use bio_new dm: use bio_new in dm-log-writes dm-zoned: use bio_new in get_mblock_slow dm-zoned: use bio_new in dmz_write_mblock dm-zoned: use bio_new in dmz_rdwr_block nvmet: use bio_new in nvmet_bdev_execute_rw scsi: target/iblock: use bio_new block: use bio_new in __blkdev_direct_IO fs/buffer: use bio_new in submit_bh_wbc fscrypt: use bio_new in fscrypt_zeroout_range fs/direct-io: use bio_new in dio_bio_alloc iomap: use bio_new in iomap_dio_zero iomap: use bio_new in iomap_dio_bio_actor fs/jfs/jfs_logmgr.c: use bio_new in lbmRead fs/jfs/jfs_logmgr.c: use bio_new in lbmStartIO fs/jfs/jfs_metapage.c: use bio_new in metapage_writepage fs/jfs/jfs_metapage.c: use bio_new in metapage_readpage fs/mpage.c: use bio_new mpage_alloc fs/nilfs: use bio_new nilfs_alloc_seg_bio ocfs/cluster: use bio_new in dm-log-writes xfs: use bio_new in xfs_rw_bdev xfs: use bio_new in xfs_buf_ioapply_map zonefs: use bio_new power/swap: use bio_new in hib_submit_io hfsplus: use bio_new in hfsplus_submit_bio() iomap: use bio_new in iomap_readpage_actor mm: use bio_new in __swap_writepage mm: use bio_new in swap_readpage mm: add swap_bio_new common bio helper block/blk-lib.c | 34 ++++++++++------------------- block/blk-zoned.c | 4 +--- block/blk.h | 5 +++-- drivers/block/drbd/drbd_receiver.c | 12 +++++----- drivers/block/xen-blkback/blkback.c | 20 +++++++++++------ drivers/block/zram/zram_drv.c | 5 ++--- drivers/md/dm-log-writes.c | 30 +++++++++---------------- drivers/md/dm-zoned-metadata.c | 18 +++++---------- drivers/nvme/target/io-cmd-bdev.c | 9 +++----- drivers/target/target_core_iblock.c | 5 ++--- fs/block_dev.c | 6 ++--- fs/buffer.c | 16 ++++++-------- fs/crypto/bio.c | 5 ++--- fs/direct-io.c | 6 ++--- fs/hfsplus/wrapper.c | 5 +---- fs/iomap/buffered-io.c | 12 +++++----- fs/iomap/direct-io.c | 11 ++++------ fs/jfs/jfs_logmgr.c | 13 ++++------- fs/jfs/jfs_metapage.c | 15 +++++-------- fs/mpage.c | 18 +++++---------- fs/nilfs2/segbuf.c | 10 ++------- fs/ocfs2/cluster/heartbeat.c | 6 ++--- fs/xfs/xfs_bio_io.c | 7 ++---- fs/xfs/xfs_buf.c | 6 ++--- fs/zonefs/super.c | 6 ++--- include/linux/bio.h | 25 +++++++++++++++++++++ kernel/power/swap.c | 7 +++--- mm/page_io.c | 30 +++++++++++++------------ 28 files changed, 151 insertions(+), 195 deletions(-)