From patchwork Thu Apr 20 10:04:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13218302 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 B7870C77B7F for ; Thu, 20 Apr 2023 10:05:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4E262900006; Thu, 20 Apr 2023 06:05:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 444D6900002; Thu, 20 Apr 2023 06:05:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 29660900006; Thu, 20 Apr 2023 06:05:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 1AB37900002 for ; Thu, 20 Apr 2023 06:05:57 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id E32A2AC0C5 for ; Thu, 20 Apr 2023 10:05:56 +0000 (UTC) X-FDA: 80701338312.27.C13F2CE Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by imf13.hostedemail.com (Postfix) with ESMTP id 0D68020018 for ; Thu, 20 Apr 2023 10:05:54 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=none; spf=pass (imf13.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.48 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681985155; 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; bh=asKpmswp0ZeanhVo76Eo+6VNkXdxI3jhQK0PDuQZThY=; b=sdvRV0wCnqN5IUGhek7ZXHdaYFMgwnmSo2b0UK2TGCB1srIISgXPfg4729zccwaLWZxLQX nYuQZ90RtxH86+qjoisWGiI7ZhdiOWVWaRf/Gaq9YiQlpRT2lflGOcocroVP82AnZYp/WA 4WKHakC+JD0C6htkeMpsWz5PtBJhpOI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681985155; a=rsa-sha256; cv=none; b=2LaOgwesIrIZDHhm8EQdYsfEsFr40WxIv1MEMF1M5jPRAJ4DWuNLJSN7sq8UB8nCN4nyjQ wDoWCtlHTxkMdARSgCjC11iFDD/oLkGNy3hlFrHLi6/FNy8xMbfnNmswgC7shCwJK/Yu8F QvoNcngO9/AUR9KlGVUZJr6S1lOIV8Q= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; spf=pass (imf13.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.48 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none) Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-3f17fdb520dso5382565e9.3 for ; Thu, 20 Apr 2023 03:05:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681985154; x=1684577154; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=asKpmswp0ZeanhVo76Eo+6VNkXdxI3jhQK0PDuQZThY=; b=Cp4DiAEUVxTAxqTXk3dmTZw4hYk8X4o/Sa/7OerBoMis4pvDzsa3bKgP+0pRTtHiec u0e0R5DqEPzvL1YShB6LmoDltW29Wxg/KpDANZhEIcTjgSkVEuHtlF11mVJIRxQhuqjQ /JxN/bWhB5MzpicD9rtnKoFjtJZS12rN9hnIftRjvEDCWOzWFHUuISOArQsforSWbyGn qvXcanEde4HZV27TD1PkTv9rxgEFbEgiNfwTG/Xnu/lkhjgL47ZvIJJBnzxzsC/Vkn2A rraDd2Zvmq8uLbd640J2UVfiIYzXdqm+eaBzsM+tv+lEGO9P/YdSao4UVSYDhv8yYi4Z PBQg== X-Gm-Message-State: AAQBX9c8u9HpEC2PNwV4nLaFtD9Begi/Usmg6F/ZG13HeUCpY/LlBiTY bnuafQ80v3d09xHHKyXVv+c= X-Google-Smtp-Source: AKy350aEPjl5npFp/5W8Iqf2usu87C/1xVbllQj+JBJFP+rdftTKzTknJoS6cfDyj7W7tb2o1uXlCw== X-Received: by 2002:a5d:4ecd:0:b0:2fb:4121:285a with SMTP id s13-20020a5d4ecd000000b002fb4121285amr782830wrv.57.1681985153608; Thu, 20 Apr 2023 03:05:53 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-208.dynamic.mnet-online.de. [62.216.205.208]) by smtp.googlemail.com with ESMTPSA id l11-20020a5d674b000000b0030276f42f08sm201410wrw.88.2023.04.20.03.05.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Apr 2023 03:05:53 -0700 (PDT) From: Johannes Thumshirn To: axboe@kernel.dk Cc: johannes.thumshirn@wdc.com, agruenba@redhat.com, cluster-devel@redhat.com, damien.lemoal@wdc.com, dm-devel@redhat.com, dsterba@suse.com, hare@suse.de, hch@lst.de, jfs-discussion@lists.sourceforge.net, kch@nvidia.com, linux-block@vger.kernel.org, linux-btrfs@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, Damien Le Moal Subject: [PATCH v4 03/22] dm: dm-zoned: use __bio_add_page for adding single metadata page Date: Thu, 20 Apr 2023 12:04:42 +0200 Message-Id: <20230420100501.32981-4-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230420100501.32981-1-jth@kernel.org> References: <20230420100501.32981-1-jth@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: 0D68020018 X-Rspamd-Server: rspam09 X-Stat-Signature: gcdascgkske7wcww88dpswbe43gbwnex X-HE-Tag: 1681985154-58818 X-HE-Meta: U2FsdGVkX18//aRg4mrDllQKa4nyhh1GbDRXnpv7bXpMUDybA62zdK1NKUMpD8UlBl/XbPHIwQl9wwehCrSq1oKv+3PZ8gDpjnfZ9/zv7MUG9fbUHOgQz4TAKHkh2WFjd45Fqyx5xjEtOfPqdxgbZfBz4UqeLLJy5dYVDLUFoy2PsI+nfRIIHANrFscbF+x4/khQlXL6nFyoFi0gAZ/ab70we8BTCEIauPVCNInCJ+Ce8/ysflI5z+HuAenkRrpwZRMLQdriEL1FZ/Fm6wwsSaoi3KUy3PpixmVQX0RE0Kwpu1kbPMc/qtS8CBTs55n37WJqOrNOtRr9Rh+sJnxSruHwr7C5t3qxVax/j2GcPWEGm9RPm5NAYqsN8VbADO2teXYhC4gA0NWQjb061KZmPmIVl+y1Rp68l/azavfuAG20J5r+Dij3XmK32BITI4bqFNF6hE6XoBvbWmtBqSypN5/OUBf7MX2ae6xXDdYt5es2/SWeIdf4tib0OReJhzan6BirGrHi1pgTh+6yio9rZN7Vai9T3B7x3FahReUxoVScdT2tX89zZTM/EIcZHndZ1uIboYNEIG+GYZW5Pj3yCzvQJCRJvaYcX724dEZcNCepofxNz8e0cKEHYwfX7EkthGWzqEakimwdORjl1lIR0D87gmAm8DzTRLAReWe6gzdPC1buM9ig2RyO/TPs9dUAM5c4bZ4yILozaDy/ENtF66Npz7hfN9HCJxo8WutUrTOO5N66R4Jc4XwNBcoYEvx3rb14Enc2Og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X-Loop: owner-majordomo@kvack.org List-ID: From: Johannes Thumshirn 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);