From patchwork Wed Apr 19 14:09:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13216874 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 C5BE0C77B75 for ; Wed, 19 Apr 2023 14:10:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5B589900002; Wed, 19 Apr 2023 10:10:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 53DF96B0078; Wed, 19 Apr 2023 10:10:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3420B900002; Wed, 19 Apr 2023 10:10:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 264526B0075 for ; Wed, 19 Apr 2023 10:10:38 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id BFA861A02F7 for ; Wed, 19 Apr 2023 14:10:36 +0000 (UTC) X-FDA: 80698326072.23.C4CDD34 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by imf05.hostedemail.com (Postfix) with ESMTP id 7F1A110000F for ; Wed, 19 Apr 2023 14:10:34 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf05.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.41 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681913434; 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=Mk9Xb8Rey/5uMnzmhE0IyDmNU4Z0xPHy5PxDd0asY4kgwVH1MF2RB8iNBxfhj4hLR79m31 6GtVPr7nbpHPuxfaqPy1bq0q/cYayrExKp3h9dMxVSmMM9pxQzh8XXrh81X9MW0g475sQn Q+vPEQyaQmAkfsgIt2L+/jGSCRmxXM4= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf05.hostedemail.com: domain of morbidrsa@gmail.com designates 209.85.128.41 as permitted sender) smtp.mailfrom=morbidrsa@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681913434; a=rsa-sha256; cv=none; b=Jl5pfjxKlvjSiqkQCOSJoHTMjq4fi6KEuTo8qVwGopyJtLyDw2RXeLBmY5qaq0NVkjDjBg M7WNxvjQBmw11cyaCEVNc0CJsqPQkTY3cZIAfz1ImVaaZAVZeFlRH58uo1+t9U7WjVFPg6 HlT5egpoQvmFjzwKqCuVmxjuWiMMd3o= Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-3f182d745deso1685535e9.0 for ; Wed, 19 Apr 2023 07:10:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681913433; x=1684505433; 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=bJ66IhdkWteEljfII+qiuv91zfV0Q6UxYuSXOUtl91acKpY8ixEn9dajZpaAj0GJKw fORBo9aMLOZJFncVRlS0IIRG/LSQnZAmRuXVUmFpHhNOqWO8MLcnHL/r+FLl6NKOHCbt W9tBz5ioROxreSThZQjV275nSx50v9J3vEK2VqGA/4MxhFyt2+E1zH2eKHKrSdyL3h3C Ab4G+RVLFKHKuaq+gw7PwfxmdtoCR1dUrHXXgR/F1CHcDxZG5oo5GhnCuJPx3IyNaNjF bZ0VbGgPRIiafoDo9cn1UjCfhOIqXy7LssHVSM7VffZxWFTvCx2XfjiydsoK9Otamc7d aDYg== X-Gm-Message-State: AAQBX9dB3PcCRGTWh54/yiqJtV41MJ2nTseyH/gVFryPqXDoYUQ9AgzO kGTo4nUq7JnISOa0EZ97vbE= X-Google-Smtp-Source: AKy350YqBEkn+VSvf2DvOCXN7mDa/WvroFJZvGVNeDs7bs2faerUsWpsWUIcEH/19Lk45zhWOo8M7g== X-Received: by 2002:adf:e892:0:b0:2f8:67ee:5ca9 with SMTP id d18-20020adfe892000000b002f867ee5ca9mr4765546wrm.65.1681913433175; Wed, 19 Apr 2023 07:10:33 -0700 (PDT) Received: from localhost.localdomain (aftr-62-216-205-204.dynamic.mnet-online.de. [62.216.205.204]) by smtp.googlemail.com with ESMTPSA id q17-20020a5d61d1000000b002faaa9a1721sm7612089wrv.58.2023.04.19.07.10.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 07:10:32 -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 v3 03/19] dm: dm-zoned: use __bio_add_page for adding single metadata page Date: Wed, 19 Apr 2023 16:09:13 +0200 Message-Id: <20230419140929.5924-4-jth@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230419140929.5924-1-jth@kernel.org> References: <20230419140929.5924-1-jth@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 7F1A110000F X-Stat-Signature: 3p8iqcuywo7pz6wy35mrscq9zcnq5jfw X-HE-Tag: 1681913434-317682 X-HE-Meta: U2FsdGVkX1/nj6lk8xbxtwQE3Y6iXDREFio+Jdx7VMfjh9B3CV+07PjSa13s4klayeLZCcPt0VRWgateAozNJv75WJtKSD1lmpAFLOmEBZFuJHKM11lrTOoZPC06rj+s5a4QoKAZ6alqvZmdk3eY8hkbUOxBa9UuUAGmY03PEPCpWpwLKowhaIC4AYCcRXHsONxjF6V6oc6qaVxubdO6GaK2z4nkHU2cEbiCf1STZWvQ1x1JzkXAjxInnsi6hhsWFnh51hFGhzpfDpo6gxi3ROAzi5R3L1Z9wQkZV8Id53MhojoWgVqLZgbN2z3QpXOtGjQxAVsWooWIxkIUciW1Ka/yOmzh88vGdTxd/z6JmQEnQjybmDTwGfs34SJt4Ym7qDz0HtQCac3+Z5tQ6lI9qgM80w9BdR4WGI4Gn8uMQszBGLHrykw+bHNiVWFcW8YFDykbgpYTwpA0O578Xej/vPd6bwfVPLCpoCy/2HC81EMPDfX3auVStjCSJstGiIvjoDkFlUV+NSbaVXSUC38sbN+CuEt1ZRvo141MUtbSCqBFLc8J5plQsg+lLKJ6CN2qqpUGVQp2DsAMD1UA2eUzjI853TCEexH39qrC97VPA96JJOM7fNIZbXPq/WtR4PkgsqG8Q0PaeGZ5wHDzvGIwWQkM99Z4Yf+b5TWCN5NpbJeGBxj4+Y2xzPaGRfvU5kTOgkKQ6N+3JDiDWOzSIhr22qGQkpJPEXKod4Y4MQCcDfj/m8/4BQkHNjqEhvxoh8yWkwH2voIRxmvd9h8DtqG+tCocaefauHDp78H3whhLZ+FACR8XuU7jInv1yAe+vHSYSIEpIElc4EBrKYXo61tvavEsTLSU3T6mZsY5VAfPBa+9pf1WGCtPv6m8Xpv93uA/9Ef71BbbZZW9KcPetR5eDx0zqzHg3GnLOJv9S9nj5eMd9Pwsj1YwJlYoaGZIqxZt3fcE5wAd1R0XG6egVlD 5ne/B1pT 2SCbkROeqy57rAnFXi5hjDKwvIqh7pBZeWbF6px0qlVsfbCOj45rwa10trIViX8k7YJ1D/CX8Muczfn4j9QZW7FAUeBvNDtOBZ2Ye7UT+Ucc99aeRKLUUGN2ikB1zthpbmdTFFF07Qow/VTcP4VbUWhe/Hv10noaFOporJJrmFL02ouRAIZMpupylMV7D8AVoRNra0dWP9ixzcj3hxKPARuPqV+sWyuyBH9AicElHoheK9bW5IqnRSo89pWlUkDMfmVQ+ulDaL5DM7+g7iMerjE1S2yt2Dkky9M3quXAWzC+esr/q90t6++oZ3yTCH18FBfNdZLrmiXKTNM6UVmdpwgQW26vbTY9wurwltovAUxlaFS2uerHvdffS/fWXVzA35yX3KGd4lLxIiZ0Szx6loIdFCHwJrDrW/HiVZESmOZj9prapbDakY7lPg3F/699Vh2HcyE7zSHjHh22z+UYobtkd7H9yzHZ/gR4BqLJl/JZsq3sJEYyScvQb1YgVrieiaNFAZn3Toq27U9O5M+Y1GXpPtw86tGiRqVLVqVFGZDfkddnNC6t1EJ7XSKlrkw4mVsSezInp+yT77McfagQtNJem+X6GZNTE8TXH 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: 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);