From patchwork Thu Mar 30 10:43:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13193862 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 53760C761A6 for ; Thu, 30 Mar 2023 10:44:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B6CB8900004; Thu, 30 Mar 2023 06:44:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B1D02900002; Thu, 30 Mar 2023 06:44:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9BE16900004; Thu, 30 Mar 2023 06:44:19 -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 8C45C900002 for ; Thu, 30 Mar 2023 06:44:19 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 693A51A07CC for ; Thu, 30 Mar 2023 10:44:19 +0000 (UTC) X-FDA: 80625230238.20.F8F42BF Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by imf27.hostedemail.com (Postfix) with ESMTP id 0DB754000B for ; Thu, 30 Mar 2023 10:44:16 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=WgbQE63F; spf=pass (imf27.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680173057; 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=AUXGgNT6cs6FilIOLXof8jwittuzkqjgm4UW4TirO18=; b=p1EG6xDh9QFK08N+Q/JvJWIcaU/O45Puf5ImQArmCCc3yqyjwME7t7FdSKhlg1GxAiYcPr BxA7OBJXBQiD7FzYzssOK9jILz0nULmtvSNiC86cj8iaVVeK8stK8J3puPrida9ZJEmEKQ TqK7ddtkHBefhL9GINCPwf5LsBMz5ro= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=wdc.com header.s=dkim.wdc.com header.b=WgbQE63F; spf=pass (imf27.hostedemail.com: domain of "prvs=446327cdf=johannes.thumshirn@wdc.com" designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=446327cdf=johannes.thumshirn@wdc.com"; dmarc=pass (policy=quarantine) header.from=wdc.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680173057; a=rsa-sha256; cv=none; b=cMuI/t0w+nUO+iraWHZKduO59ES0mkS+Cwb5lAiZjiDAxpMSaBzf4Z3t2tttRyngKpGf8o n3dLgHe5x7mixWY1GasiZfLpdAI7DIyGMiWhAPOvQ93BUZChMUaMiY+NINYlGgdBoEUb/n X6rCGzK42NBb9YEOP1wBK+rqayHGoiw= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1680173057; x=1711709057; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BUmURHFdu9KejVTyXSm50CHGFvGjlqfpSblNCpyXxd0=; b=WgbQE63FHBN0J1jI1J1ZvQYcFxRtmOnXpckBBmh7pSkSwwRYMGP9lr2E 0uUZdHMP0WD7Nb8To4NkbBXvROl1w2tz/qaoBw6Hrgc5SNIg8s3d79hA3 pDAYp/M0KJLjeOH+MbSmS0gIv+C9iuBX3mvd2ih9ieqI2l/na+rOckCZk gDB1cBVCH5QyELsMxibXFy1TJ5ScHRoswu9+1yBQOmnfO3SWUJfIWEWF+ uCrXYuQNpb+q9ochBcwb19slx8S9be4bz+u98Hv0Eo9x9wz/TJqeoJhtK MlCtw/Sfaq+2EmiFXZW4GQSo4eQDpIVwaiicdM8Wn6pbU0qR0D4dAJxEb g==; X-IronPort-AV: E=Sophos;i="5.98,303,1673884800"; d="scan'208";a="231853896" 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; 30 Mar 2023 18:44:15 +0800 IronPort-SDR: GFM9P861YeMeBZnhrv39ikHnGYn4JJSt9N+cLCe7CDiBGTP7vBChaTqy/1N4bupXowyJOVU8Sz wl/sTNjGH19SvZNM6jG89K8xSPq0AmpqRg3nBpgQwd/FgLYGrAuEz0zs1L778lqxjOmg+i4fyM KePwwFU9Yis2kCbYbqkisjlWZWn67UJ9+gIO52JDpThe3aoWyzn8ACRpqZyGWWGDjtl7fZBAsz +7v6jX4XIajbbFlfF7K54DvizsKiZFtzf1ZBJaVC5JSF4fmIquLEitUmgoS4ZGv3MB3BwmD68t MKY= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Mar 2023 02:54:42 -0700 IronPort-SDR: zqJUuuEWGvtk5ynuIvdoGSTcK/Y7DxRZqa2AqDl93PHBq8zvX3+RgmnnfgDIeH88tY2GRigaWC ksCV/5j5AZp1gugBzl1vz+fSlxsewSxY1IwvAF8Z1UQmeURLZPv6rUrbXBVcc6ZKqszwyeJr9U LQsK3/q3aYuyJzksTzLRhNklEISxCuzFF/G4VTc5KVfAu43VSgYzFZoy1iZQGI8hm4vbdG/U+b a9LQ6+vlvJUUlbReY3s1WU5G9fOKBxzpyEUyM461G23b/3bmRf1IU3OFcf2/9bo9XK1+73YPu+ eEA= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Mar 2023 03:44:12 -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 , David Sterba , linux-btrfs@vger.kernel.org, Johannes Thumshirn , Damien Le Moal Subject: [PATCH v2 03/19] dm: dm-zoned: use __bio_add_page for adding single metadata page Date: Thu, 30 Mar 2023 03:43:45 -0700 Message-Id: <0b8d78cb8d38e4d4e3c5b1c187c81194b6403251.1680172791.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 0DB754000B X-Rspam-User: X-Stat-Signature: gsj7dfds7qfafaakftwjmwpsy8wku94r X-HE-Tag: 1680173056-125728 X-HE-Meta: U2FsdGVkX19OWv091cEhoGQB4Jg/HFIJtcsYL9P9abBMKhWKaLMiddHrB6rvxtlSHORXNV6/z1uKPcB7QZ46+s31aDIV2tXJAr42SI7pqasJdJ5nN6XgtLqGY+bY/uykj1WFvkz7P+XTarNCDtoyZqBdwMJBgITGVyJJ2UwMu2SAL32bqerE82KKOqhNwjGb4UQfxXQ7Tqwihna5AlRvlIVWZ6Dv9quHeKW35kjeH8d6jd3F/J5EAXdtOAHgVpgEyYZLcx9cmSxrxMWla0GI/z2pI2A8Lk07VWcgypVjGv7wvHoGWxU79KaX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/3BTPIcs51rRLPBh8ReU 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 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);