From patchwork Wed Mar 29 17:05:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13192952 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 7A095C6FD18 for ; Wed, 29 Mar 2023 17:06:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A19756B007B; Wed, 29 Mar 2023 13:06:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 954536B007D; Wed, 29 Mar 2023 13:06:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 75ACC6B007E; Wed, 29 Mar 2023 13:06:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 4E8356B007B for ; Wed, 29 Mar 2023 13:06:32 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 204A3A06DB for ; Wed, 29 Mar 2023 17:06:32 +0000 (UTC) X-FDA: 80622564624.09.33375ED Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by imf21.hostedemail.com (Postfix) with ESMTP id E6EDD1C0024 for ; Wed, 29 Mar 2023 17:06:29 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=DhrCeAwl; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680109590; 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=Wr4TqYIoyZgSPEHCC6VAhbvy7XhcXyGwh96krkcqiG4=; b=qA6ga53UfzsJVJXxN2WteIYxZsrMajUmnesl/2eZ77xpf2IKdr7FG0V/qp0+Tmg5beFTeR dvbNkmGkK44UHY4rn1fmi6Ocr4Ctd14GJhV38FNQ5MOQIh6SY9KEGSOFaQnOmc0jJMsweE p0ryyGqu7oDf15aHFt7xA0znuVziy8g= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=DhrCeAwl; spf=pass (imf21.hostedemail.com: domain of "prvs=445a3f1bb=johannes.thumshirn@wdc.com" designates 216.71.154.45 as permitted sender) smtp.mailfrom="prvs=445a3f1bb=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680109590; a=rsa-sha256; cv=none; b=gdgoQsbsFAYxOoVrCcKGYatXxFMWlJpp+92INbhArntqQaMdsW3iqs0dI6/83VRSS/gNAg Fp7ckfkmQibyC3m0sN/TOYypQt2WB4XJt3fqjNgNrvGt6yNj8s2/jfrKzKkuuYKikDl9vH aStmmK7Jtqy8hm0hNPQPkuuTrr1LNiI= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680109589; x=1711645589; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KyIfu3zY47yLy6bRdPbtwNMrj/lN6bI3KAvSZ3cykmU=; b=DhrCeAwlS5eOC/gU8LIw0jtUsxlzZgf5uP/H5FAY2HmOxEdv0uvGNl3X p6NKSTB9s/nXiM4nX9eJZpX2kbOtzJFQiohB72QlZ6ie/JVNLE/f+hPB7 FOfCYBjOMsrgbMeKKl+IudKGpgvNmIg9O2Less4gjNlnGgil3yyGdBYqv vrAU5nzFQIZ/gk8HsEgeGUJtSg95jMcEAxa0DNWPezEeQVQnr779BKJ4N re8sN0QqTJdXMXtKo7bh24KpfYn00u1nynkfKnVeVVFZnnsq5bXDg8mrV LDS5tqNGAvBO3bPZAy1qtIVdMsvLHbaLxmtzG86ymbYDoHFlrCdECt3YR Q==; X-IronPort-AV: E=Sophos;i="5.98,301,1673884800"; d="scan'208";a="226807019" 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; 30 Mar 2023 01:06:29 +0800 IronPort-SDR: c3etZ7MhgFs8mtOozCTjnXDRxe20PffioaFS4a9g/EFYFscKvRO3SBHxxInnvBkDd6UCgaEXee gs4Tzr+oo0C/mLlqxgwRTsLNCzqMD/kmqVQ0IiKV5riGVrS49zsplN5lnPkpCOi7yyuEuhFAOu 1PEb4KXpoYv0qFOkc+CTRhNFh61Htg7/KO9gVvppqfeuAbNb7aWUHLxw7mNGVVyyvXV5pnK2Kj BJ6Dvm7zb+pVRkdCyp0LCl1tDMEgPqXE/J/nDO+0VHLs7BQN9A2Gk5P9be4uG28rGiTbhLgB+7 WRo= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2023 09:22:39 -0700 IronPort-SDR: 1njdf8/CpG2wu7Qu8ihT3x7xLc8wy22vSSqYOwPugiiyw2WXLX0xfwIb3ruUPKyie2J2TxJ6mO +mzM95UW16s8gPzsDG1+pgyKiYXVlP9/tknr6cMK/tmdwWp7FCAsb3dZSwA6t2tkrLYbMDJ4dl bgA4utwx7/yRV+ji/32tVB37ULrzfKvgsiu8yqho+w5+nRwPLVEASsAGm4YRFVvD4TrkbhHNYK 1UF/NdCIe6OXs5RI9Vq2tALxfVuzSQv5O5wnGhlKPenDTHlLVNZ37DGNgNgv7q9K0mL6gtkYkx JH4= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 29 Mar 2023 10:06:28 -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 , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn Subject: [PATCH 03/19] dm: dm-zoned: use __bio_add_page for adding single metadata page Date: Wed, 29 Mar 2023 10:05:49 -0700 Message-Id: <4a2c46dc0e217a9fb6b9f32d460498a5feb8b67b.1680108414.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: E6EDD1C0024 X-Stat-Signature: cmmqas8z8r8ai9675kmrk7i8kuedn5rn X-Rspam-User: X-HE-Tag: 1680109589-806873 X-HE-Meta: U2FsdGVkX18ljIOPJbeNDTonEAed/TPI/ZWvkjNZexr+t3IZXG6OZldODbyAxU9oS3I3psIAOF4lODfK7ReBtDubJC/rERy5QS3nHl8lhDSsG0TPk7eQbXth52+//2vuCxf1jm6LqRfamG2DJdf8WGCyHpWdmuseZLRTqMXU9EONqgiS91v82+MqVKou7ETi5lEekoY4vazpBrKca5ms1GyLHMdi0/gO3CQ6O56baxXm1Cb0p4a1Jnd9ZftADM7S5vWzmRDpj7zJBGmMUSjuh+GSHrJjMbkg2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rSDw4vtjyCKtomasKfhVIWyi/ 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 Signed-off-by: Johannes Thumshirn Reviewed-by: Damien Le Moal --- 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 cf9402064aba..8dbe102ab271 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);