From patchwork Tue May 30 15:49:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13260550 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 825D3C7EE2C for ; Tue, 30 May 2023 15:49:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C7B21900006; Tue, 30 May 2023 11:49:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BB75D900005; Tue, 30 May 2023 11:49:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9B990900006; Tue, 30 May 2023 11:49:41 -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 8D775900005 for ; Tue, 30 May 2023 11:49:41 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id F39CD16027F for ; Tue, 30 May 2023 15:49:40 +0000 (UTC) X-FDA: 80847356562.24.A774775 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by imf17.hostedemail.com (Postfix) with ESMTP id D9E9240016 for ; Tue, 30 May 2023 15:49:38 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=aXniwa4S; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf17.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1685461779; 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=O2BUL17c5/9cX1sLGNYoIQSIjZXpK9ZZvd3kmgdlfWcPcS2BAou/49TI6DJ9YPu7yRRwqR 3X/YCTK8KGQFQCOwE77FgJbTI9L4r5Fe/QMrvgDNbIBI5J83QkNpAdCz7vKGZbFGZb49ar /c2BylrVJDaxCY+mbsWAf/5nBqf/RmA= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=aXniwa4S; dmarc=pass (policy=quarantine) header.from=wdc.com; spf=pass (imf17.hostedemail.com: domain of "prvs=507b913ec=johannes.thumshirn@wdc.com" designates 216.71.154.42 as permitted sender) smtp.mailfrom="prvs=507b913ec=johannes.thumshirn@wdc.com" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1685461779; a=rsa-sha256; cv=none; b=XIef3IUN+xtKCZlOdlDPwR5PzJskgTfJ1wO7eNR4qQI5+wGyyrt63w4eU9+k6EK66YXxQE 2dpP4lizEi+g5ZS+tohfblr6x5xEeC640SLM7LRWT0zcl2G1kKzZnrc+WJFV2ag7twOSzY mX6NuW0mooRzCdzGAVcctauwq9ACJD0= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1685461778; x=1716997778; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yht1tkgwasi8HpY3YFcrQQ6s5n80qKmfhqnvFToXZgs=; b=aXniwa4SRhk72rrl65FAtgaFUabEpF2ZFr6BNHMhCH6ap+/OpFgNJIQm UuIOSWhWOz6BZn4bSd16LrIaeNS04JLTiZ7VhFYAcullW2WyTfRxBplR6 VmdGyy3SzQ2nXgQ/sUg28mkD0WgVsgd1pAtMlxK+Dy5Ln52fGHxbnhW8E waOVO1dK35awZOsMBvTcqe2tvotcHNLAQYKTzmNeRehh9/yZktSpXwmIQ g/lbyh1Y/b1305AAiFqgUajv8/K7gO7zizd4DIHj4y/6Hlbs71X24af4M LHYlUE4LOu0EzO/cqYVXetg3va+YO1c5gv4Ixz7e8F1bdVj4Sv5nymyjo A==; X-IronPort-AV: E=Sophos;i="6.00,204,1681142400"; d="scan'208";a="230129739" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 May 2023 23:49:38 +0800 IronPort-SDR: ycxf0pFhML3dIU++qjUcc1sAo4+cS6sQNT/zFnxfWwPmBaib4JbAClocEcvejJPC4R+pk7pXTg Hg9y+MyzUaEKarM7oAJEkm18lbzqbnDtm2e/7pdx8DDtq7DtIN59pAjBrKgiXC7TgYTiM3nf9I lTBiyAqm90UocMpRyerqMqVy7jFLEYQDAq+AqV/yrCsP6Ti2UcrlSSF8mqI9hbZPpFykOaYvzI 18hSfA8/2V6xeXlg5bCg+dbwlpCTYvHRHg8fLEhL3lUah3dk5mbo2+PuGd81Fb2ZioEOObfKSF JmY= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 May 2023 07:58:50 -0700 IronPort-SDR: rDb04cLPnHkw83pxdqtCHKsua7HM5tgjjmF6YXHJIVLNeG4c320WrXtss9t9FpJkHk8dSG8jrZ U37pjVXEoaNU8XYLzdmKXeGmEFd+1dDT4nL97b8EqiMmuRm14WWVuMYkCCNNBQqq0YdinOO5yq Lxf5U0o9U/edHt5LmR3MVSlhItwiTl+U8LIJ90qQ/E0eH322rprOjcHnRMPPJHrvTPHPHmMyw2 XmVBT7OeOZhz0Z77oO06/HoQL/Numzb2HGonQSheeFZI4laqGj05EvNx/k0pFoJFGK5U9EVg6i 1Sg= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 30 May 2023 08:49:35 -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 , gouhao@uniontech.com, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v6 03/20] dm: dm-zoned: use __bio_add_page for adding single metadata page Date: Tue, 30 May 2023 08:49:06 -0700 Message-Id: <442aec07a192f0b2fe918b66357bdf7d7c25ffdd.1685461490.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-Stat-Signature: qyfkhzqca3sbsttbaw3ozxokadyohst5 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: D9E9240016 X-HE-Tag: 1685461778-910381 X-HE-Meta: U2FsdGVkX18sgaVaCmj+j6jVxHBhiZ8CkuR0teg4crmP9pBS/bLbK2tCH128Igxh3y3Tx5zqu87k6jG0frTlA32lTi596qdBDO+PU6hM6nLtiNCw/wAqSBNl/AyZsBUkPqppVMqWksPpSc/wD94CPHAPp+vprbEbnVxv1Pl3WnoEN7oqV1prCjQeJJUuGxDLN7mK21qyMgb6/JgOR2JMe9Dd3rFIk86yMG6OOwBT0aLH1SYEHZiQ81HXYOhEYhiJgv/8EO5gJCjZdL5ULMERFWTFyQ3gDwWaNF/2RjP953eGXxfROIHcSw/KYkZGlij1QuFF2ufMM4aBOuvoTFj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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);