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: 13262092 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDACEC83003 for ; Wed, 31 May 2023 11:51:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235658AbjEaLvU (ORCPT ); Wed, 31 May 2023 07:51:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235507AbjEaLvP (ORCPT ); Wed, 31 May 2023 07:51:15 -0400 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC22F132; Wed, 31 May 2023 04:51:01 -0700 (PDT) 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="336547909" Received: from uls-op-cesaip01.wdc.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: +ooRInVvHjxF6GDT7d7t+Jw6i7Jf/KRptimZmKXYt2lA5R/NV1ynQepPjR7l2pyFju8FMoig5L OE+BVa6rX0mcVQjDwHYod4BCoz2jPwnDfDqjT4FY05P/paQGnOO0yfElEV+Agej1DIJ7U0Kq4J HgcNx22k2kbQtKb775KGfnZr/cbrfKOn3BiEq3NcjsgajVAZE2zP/TzEtSJ6G7K6ZQJFOemJhs 5+wVDrQ3KGRn+xGEEWIys9eRXmpAbeNs5VVZJRjifKiw1Tiv1J25tj7uPHYMwAyRgrLP8E3L+e rAM= 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 Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org 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);