From patchwork Wed May 31 11:50:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13262041 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11B69C77B73 for ; Wed, 31 May 2023 11:51:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A40586B008A; Wed, 31 May 2023 07:51:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F08F6B008C; Wed, 31 May 2023 07:51:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8DF898E0002; Wed, 31 May 2023 07:51:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 7AB296B008A for ; Wed, 31 May 2023 07:51:04 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 41BB91A0357 for ; Wed, 31 May 2023 11:51:04 +0000 (UTC) X-FDA: 80850384048.26.BD1849B Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf29.hostedemail.com (Postfix) with ESMTP id 18F3C120013 for ; Wed, 31 May 2023 11:51:01 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=Tkj9wSOV; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf29.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685533862; a=rsa-sha256; cv=none; b=4Oo84TWjoDjfVB2fmRbYqMb8CaZyGTx/2SaQqLH/CLewTDK27RnoYb78QjQWjrAcFHZgfy fYC5RW+SAFIK6uSitFu1twylGfl2TgUnQkIczWPnn15UzpGa7uj82ozo3PmmA3fGZgEeNz tpNK+fZINPyexEpJdt9D24rbS8ck8V0= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=Tkj9wSOV; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf29.hostedemail.com: domain of "prvs=508ef2a02=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=508ef2a02=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685533862; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=SsAjS6t4vxeJS3qx6Gp/BdZFxpipc6y58YVRUDPoMew=; b=RmRAK3Ok4eE825pe4VBIxXoByBBsqU9mSK9S9KTRbO8pC8JOqktbL4cPUafp/bAyrObvtG fnYgSx1lCdVrr3ma2F9Z53IB8jh/Cs50Qyw83tkQbujcuk/0geOhTU3hm4bGrVonylJntO E91TZ9UPEczlcMllvKnxaSzwQ5v5830= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685533861; x=1717069861; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yht1tkgwasi8HpY3YFcrQQ6s5n80qKmfhqnvFToXZgs=; b=Tkj9wSOVccVbvRtdJZVAJ2F88JeJZj8KJBUwunbBkHEIeS+6Mm+UUntu ApfQpL9Ewa1ZqoSNImDK+psInxCCr/HAbH5XDlTlHNFs5PTYPRhXkZwGX 4x6XjE8yItsqdN3WvuFtXjUFjRP4hm7e///AZnAOT3eIG9gsyJl9/lP9N mtpFXjWkY0foWLKEoY5yAX5Efv/lkwamgtYkPOL5DsQlKqUvoiup61YaM H25LBzQJyxev8YTdoUC8vuYTSVHUsReT3giOJfAD/0ZOup82+73GzlEZ/ eKpOSoe+MTGi98crCmYM27EceYSQXTohE/CmidGoNAMGgvpTfvDmzX2vT Q==; X-IronPort-AV: E=Sophos;i="6.00,207,1681142400"; d="scan'208";a="230207395" 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; 31 May 2023 19:51:01 +0800 IronPort-SDR: wqapWNrztqrFuUn2W++OXS5qkkRAXvck3xEMgFpvxpoQkALXwznBXB/JrEv8JKGStw613l0UPy ed+vfXmE/Z05mz2pt3bpMjtLMMR5nD4MuS4tGJKt4U+EAgBDZUwneYzwZ+VvViXMrnG2Su5X9F hVAzukHjJKcW0q/+gCy0FI2uIxs/B2p2CWg3RcBPO8f/XaqZ03v3OyuMai2DDsgKwq330O2U5B oRA8u77JFrZoKbRwAklmRJj/n1E2rUNi4eT4OdWQ10Spz8BE6cylFzttzD82S2m2z33TmLhb/h rjU= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 May 2023 04:05:54 -0700 IronPort-SDR: bsi7HwNoddoi1aCCstr6zqEUz0yRweXsbpeUwAD9EpJFxV4mtkV/er5q/U5Rtf4PTtq8dDGKTL 6Bm1doXKC1ZsZlmOyIQMYHRP0CxBcyzAqmfz4V1wID7LJJntM04yP77jdrZeLV8zMePOeEB9fi mnc/c4IKxHr9qPLks3U0aTHrkZGdC0Nddoqn//IrBToFuqv7JuL6t2n19kxK3ItMI087JoHAiz 2NW/P+el9+4FFBvaFgEq5wfOFgSO8ReYWFFZDHZHiKVCZGfLRlQD5HyvSI3XoZi85DenMceD/4 iYA= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 31 May 2023 04:50:59 -0700 From: Johannes Thumshirn To: Jens Axboe Cc: Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Damien Le Moal , Ming Lei , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dm-devel@redhat.com, Song Liu , linux-raid@vger.kernel.org, Mike Snitzer , Matthew Wilcox , Dave Kleikamp , jfs-discussion@lists.sourceforge.net, cluster-devel@redhat.com, Bob Peterson , Andreas Gruenbacher , Mikulas Patocka , gouha7@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v7 03/20] dm: dm-zoned: use __bio_add_page for adding single metadata page Date: Wed, 31 May 2023 04:50:26 -0700 Message-Id: <55a0c8dad7550379647873b579dc7cfbe0191f96.1685532726.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 18F3C120013 X-Stat-Signature: tmabyxygp4n48y8hd6inbhim5wksnj79 X-HE-Tag: 1685533861-504507 X-HE-Meta: U2FsdGVkX19UTpQiuc+OyUXVNASHkjtdREdcupN5YvCmE56Y5PaQrI5PZXY4tfBPCC+YExJrsZGJ4GrrtGEzCKV/FXxFwiU6c5/hUb69rqNXKAHRNsUnz0kvDie1Goon6fAVnfwC3tz9CeWwy960XhrxyeRk9a9hQbOZmuBrwD7OCDw8yO0W1cok9Ycc8k/HRglslAXzgC8MS2TBn+dv7Nx+VNpvCU3GP5wW78mDDrFpLhqPLOtZCkBDkDd26IrPiieEAMJneBC9KVdiaPWPiV88UhkrPOKdTMdpu8thHdu2Mm1x/h57UBDS57Lt962N5II+Ayrgatw0eorBULUz/2kuN86bsdLYp2VGamj7oh2eDtvq6iiS1YH0fruprVo9zpcvRwEdJD/Ibcl6rIiRyggCBDvI0GNvQIbHOAMLKdZRp/Paessf7QVh7UkCTBPBo/idHXBVy9HrC0mqwXHx46DnTyPVzOln9CkZx0OhdjXchNWC4afxmPWvIvcPdtQn8lopZqfmgKP+wp/eZeVFZ36nr8shgXxNz0vstzZnKVST2I4agQxaB4UeDi7DsLt/H6j5XzeqWHLNJvYN4GxISUFJZyPgwU4dOBxa4vDzNOYGOI+BPymUP0CueDmMaAyPOE+WOGfGsbgLtNz5Kfoongf6qQX6kDBZzzyM4WGaCJxs0r2aeAdl8XRqArHNcshDYrZXotLa1N2Z1XAa7lw+OJcG0+U/kNpuWT/KKlOaHLjysmzFE1ZXUosV2VygDjS7mZsbcbFmErhKblyZoP25BZmFuL44fBwj41Yp7kZhas9YRbLTSqpylgLqmzh1irdBOGnr1w55ZYu5wK4hMsuNO5hw5BcWhHv40IvtLHaaqURFlNuKqFjRp4KBK4Ja6e8CV2pdSUcPCex+ftBRAdgZPXYGL5RPl/jPGwF43g83hY2T7hO5k41QEKZin21+gPKv4aoZ2Ituk2YsJvllrne lIjPz57I Q+0Q5LbnmbUHS8nNiENx2C5PLhKi+Vk4H/tQgZak3gDTlE2l7Hq+v5d3sMEcjgdwX3cnNnY2lkEului/ghZi89FHEyhQEebDHz6FYausYLRE2IVpw5yjf8bxaayRiyJaaTwoyav2Mc3Z5LlIaUMiq6+OifBnid702n17d28VKox0/panogZL6q5Jd6/H0ZKWO5kBjFyFWnkMCtKimugesgVDHmgUflYt8U1/5+hMRDN5rgzYbkjM2tVx/ZyN07UQmI4vxjqaSm95JQbCD1E9ufTlGLMf0pm1YXz3zvQOvNV5jDtUHMpXmj0IiKQ2PFzidH8qNjeb2drFVgg0zbRcnBhiNenK6hIR4cXxqYWctPiQFok+rgD7fzJIVq2b7HJIwkihQIeWM37Yd+Ns= 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: dm-zoned uses bio_add_page() for adding a single page to a freshly created metadata bio. Use __bio_add_page() instead as adding a single page to a new bio is always guaranteed to succeed. This brings us a step closer to marking bio_add_page() __must_check Reviewed-by: Damien Le Moal Signed-off-by: Johannes Thumshirn --- drivers/md/dm-zoned-metadata.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c index 8f0896a6990b..9d3cca8e3dc9 100644 --- a/drivers/md/dm-zoned-metadata.c +++ b/drivers/md/dm-zoned-metadata.c @@ -577,7 +577,7 @@ static struct dmz_mblock *dmz_get_mblock_slow(struct dmz_metadata *zmd, bio->bi_iter.bi_sector = dmz_blk2sect(block); bio->bi_private = mblk; bio->bi_end_io = dmz_mblock_bio_end_io; - bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); + __bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); submit_bio(bio); return mblk; @@ -728,7 +728,7 @@ static int dmz_write_mblock(struct dmz_metadata *zmd, struct dmz_mblock *mblk, bio->bi_iter.bi_sector = dmz_blk2sect(block); bio->bi_private = mblk; bio->bi_end_io = dmz_mblock_bio_end_io; - bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); + __bio_add_page(bio, mblk->page, DMZ_BLOCK_SIZE, 0); submit_bio(bio); return 0; @@ -752,7 +752,7 @@ static int dmz_rdwr_block(struct dmz_dev *dev, enum req_op op, bio = bio_alloc(dev->bdev, 1, op | REQ_SYNC | REQ_META | REQ_PRIO, GFP_NOIO); bio->bi_iter.bi_sector = dmz_blk2sect(block); - bio_add_page(bio, page, DMZ_BLOCK_SIZE, 0); + __bio_add_page(bio, page, DMZ_BLOCK_SIZE, 0); ret = submit_bio_wait(bio); bio_put(bio);