From patchwork Tue May 2 10:19:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13229063 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 6EB9AC77B73 for ; Tue, 2 May 2023 15:38:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 16F4C6B009D; Tue, 2 May 2023 11:38:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E07896B00A1; Tue, 2 May 2023 11:38:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA31C6B00A5; Tue, 2 May 2023 11:38:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by kanga.kvack.org (Postfix) with ESMTP id 949026B009D for ; Tue, 2 May 2023 11:38:07 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1683041887; x=1714577887; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6dUSVfajEldYN5Oupo7JKyZWBoRWVt/rgYFEzhpo0c4=; b=hTDqPRhan6JSfuTIn2DRpJ9OdwLFstOMSZyWIpm0vozvaJ2G7nsBDbeH 7eE/fuKtsi50icK5wVECeGL/MUhoFRI/HDI8+pKwC0DOp3KTi/yYkmPrs ZMQHBJ/mmrl7AXF9l2ujoyI0SDta488PtdKy80PalZ36f3/0jEybleYrv EaDNwJqkW/6eRw1Go72MWZUxunm0OU+CaV0bdbgs5WAKLUeJjG5JDEiJk fKMpM2ojm7upkZmYbf7biJQupM2dfPAi6K+s6BbbVg+KZ5kQwM9B0lrOw 2BI3VDhYfcg4hiaQ7xQUynZLDR3pS226r4hSgBglwthTJcGANIlqPY9A1 g==; X-IronPort-AV: E=Sophos;i="5.99,243,1677513600"; d="scan'208";a="234672835" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 02 May 2023 18:20:49 +0800 IronPort-SDR: EWLS7dweMgBHX0M8y+rGNamNpI3PXYT85dBW0ZpwRHFY8T05Qy3ovo3Y+BKr3yLch/nb4CxheL oxEHUSM8G2XiVCrEMX7RSBgRd7TiLNAuDs6BgI+MWKiXHPp/m1zPnnVMFkDn7THBj6maboq+mj EXAv/rrvfIzaIKDFlUbZjQOHY0ik1kr0OhP7nwqGJq0Y28CuGiTJPy2G7OVzmV4MpxBmEYeXr5 ojuMOz2iEhlViAjqxD4TxO7jVP+9Pn1WzL+0WVoh2AVnswJD3FRuWdpT3qo9g4R3i1CXFJOiyN kLo= 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; 02 May 2023 02:30:36 -0700 IronPort-SDR: izj1TLhxnELM0NHoBU04SGWT3AVjAUqJVEZ7r3PJykX/ZdoUGxAr5EDixoNXp4/1ubYh6EB4GU VgNk6nLvH0j+QUUugolt2ulmPIOfrX4gESgZjdrdfbINt/HygPVllIP4O/fbcchFgi9WiSvH9x H5LeMGLC2jUBUTkFWd2BcC05Jqfr/W3l4NjYsyVenLNxN2zWI1M7l2Gm9QIeCoI7VIuq9XXK5R QOBUOFUcBEFOcIGquakdmPM9MsnLTxE6T/58wESvv3DoqJ049BaL+cUOm2GMivDIRVkL2tDJyJ AjA= WDCIronportException: Internal Received: from myd008205.ad.shared (HELO localhost.localdomain) ([10.225.1.100]) by uls-op-cesaip02.wdc.com with ESMTP; 02 May 2023 03:20:45 -0700 From: Johannes Thumshirn To: "axboe @ kernel . dk" Cc: agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-raid@vger.kernel.org, ming.lei@redhat.com, rpeterso@redhat.com, shaggy@kernel.org, snitzer@kernel.org, song@kernel.org, willy@infradead.org, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v5 03/20] dm: dm-zoned: use __bio_add_page for adding single metadata page Date: Tue, 2 May 2023 12:19:17 +0200 Message-Id: <20230502101934.24901-4-johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230502101934.24901-1-johannes.thumshirn@wdc.com> References: <20230502101934.24901-1-johannes.thumshirn@wdc.com> 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: 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);