From patchwork Mon Jan 30 09:21:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13120634 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 65E58C54EAA for ; Mon, 30 Jan 2023 09:24:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D95C66B007D; Mon, 30 Jan 2023 04:24:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C79366B0083; Mon, 30 Jan 2023 04:24:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 65F276B007E; Mon, 30 Jan 2023 04:24:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 05C536B007D for ; Mon, 30 Jan 2023 04:24:02 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id D475BC096D for ; Mon, 30 Jan 2023 09:24:01 +0000 (UTC) X-FDA: 80410928682.11.9EC6B83 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf09.hostedemail.com (Postfix) with ESMTP id 24644140002 for ; Mon, 30 Jan 2023 09:23:59 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=Dia0dS4D; spf=temperror (imf09.hostedemail.com: error in processing during lookup of BATV+3ca177389f0c7d0d5156+7099+infradead.org+hch@bombadil.srs.infradead.org: DNS error) smtp.mailfrom=BATV+3ca177389f0c7d0d5156+7099+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675070640; 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=C+v5jKduF/6CPyL8Gd3IL/7SXabgum11sMqCASR0Rjw=; b=Elaqb8Burff11q07arLvhk7gBD+nATUtTOtnH0QJw4KbtR58K9HimL0ddfxq7Nkt3PLc+3 uiQUfPu6TWXymYfvkRcEFqf5x2nChLcEcBc/1p2AR/tFiKYAizR8BIVlZFz4eKrhDL6KS9 SHTn/UDnfgnSzbaQt1bo3PxXemZbPDY= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=Dia0dS4D; spf=temperror (imf09.hostedemail.com: error in processing during lookup of BATV+3ca177389f0c7d0d5156+7099+infradead.org+hch@bombadil.srs.infradead.org: DNS error) smtp.mailfrom=BATV+3ca177389f0c7d0d5156+7099+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675070640; a=rsa-sha256; cv=none; b=8QNd70UAAV/HFXasW6LpDOzeeCM76HDpJUzdChSiGdzxyNqBWJc5VZkNOo8sM0wf1YIZ7q sxarpLaugeORkZfewjy3g1Y3DHPVRbIFie4TI5A72JvOTjAwpb2840+d54X83/EAgS7prE jqXIvkH62Uk0YDBlapCCEFNNuJnUIdI= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=C+v5jKduF/6CPyL8Gd3IL/7SXabgum11sMqCASR0Rjw=; b=Dia0dS4DHkPCJzEQ3GL2aBg3Jf 0FzC/sN3iLUP+N8J/1A/U87NBJ+uyEpKkpnh+GuSWq6sEuXcf5jfTNBBOYnUnu05pKwV+mnr+dBW+ l0jnhp5PE+zCcWsLLECOowRAOnKIGdMtYEAr62jvNYfNktvspZGptBMO1NjlmVs4DyDbGSYB+KmII HfShoMOrXlSn1TvP3kFHgvZeJnAgNWIbRUDvtlJJtj0z9JYqIs7xD4hBcx6o2hbcuHX9I8P5ctpcD xaxVcGiDk4JK0m74OCpuzA/189QfcEoJAAt91OlSeRWPyROrJOO9qX+PqmUAJXTwLAZqU7f0l1PqF PvDhAwFw==; Received: from [2001:4bb8:19a:272a:732e:e417:47d7:2f4a] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pMQMe-002o0P-Jq; Mon, 30 Jan 2023 09:22:13 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Ilya Dryomov , "Michael S. Tsirkin" , Jason Wang , Minchan Kim , Sergey Senozhatsky , Keith Busch , Sagi Grimberg , Chaitanya Kulkarni , "Martin K. Petersen" , David Howells , Marc Dionne , Xiubo Li , Steve French , Trond Myklebust , Anna Schumaker , Mike Marshall , Andrew Morton , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Chuck Lever , linux-block@vger.kernel.org, ceph-devel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, kvm@vger.kernel.org, netdev@vger.kernel.org, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, devel@lists.orangefs.org, io-uring@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 02/23] block: add a bvec_set_folio helper Date: Mon, 30 Jan 2023 10:21:36 +0100 Message-Id: <20230130092157.1759539-3-hch@lst.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230130092157.1759539-1-hch@lst.de> References: <20230130092157.1759539-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 24644140002 X-Stat-Signature: isjf4yptwdq8i73otweyyzarw77zc9qe X-Rspam-User: X-HE-Tag: 1675070639-580083 X-HE-Meta: U2FsdGVkX1+LqJpLr/A9yK0MW2fuujF1msd5xONjJmBouy0cD3MSTwbvtJAdeqAk0fMMXnSFXSp5GBusCFk7pNbB1SLqdgqK2YQzqfcJ1lXXu3OomF6ZjY3qhaP8KEVicLEGwbSVI1iZtt2trF6zvxCdjeNXjCf3mDS0+E44iSwa+gWBnWuF360mRpHDhpfdS33l9BQsfhV1XXg4mjAqfNh7f8hwk2P8ElaC/a4k7Xat5qsW9tLH52r2PLYMyzDa3TAB0FTNyJ3eSq755El2/KLUkyd2jqH1Jbuu9ivNM98U5Zd3t4BC4CHfk8z/W4WuzKbYcopVd6oFFps2DMwcUdK8AArjOIk/OlATl8eUTz0idv063cn7q5Oq9jKGggktmd0VyQWv+qCmvuGweShtDGoH70QO6w/TazcUNE7RohToyTZuooPwOeDsJp5ckRlrpgo403SDNeMGUQFuwpxbq3skgQ0XFW5hbmP+HYHhEOozt/3tbs39SnwmnHied6vf8IW0ScFwbPiFlqfUMptk0hzwDDZW76Dlj+1HN/WVOmcoNYrQdNvLmF5vjCTBhLDAvYJwbW/hsHQ4Pi+NFofXCR+fWU2zYoDmqcqtJIyQS8Gjb1xHcXw3kW4Hxhp+D5s2KjC59DQ7HwcwJ+ypFLOZfZMTG0idolgsm9fv1Wg643UmGPYeGrzUiSPvoOCA+Gox0tQy3zUj6nN3WDV8eIrZ9xK57jdhAYFediYtyFImldB3VVfXrkL3L9/IYGJGrecEvE/95eAbW0ez9h/Hq4M4pX1sw56ISk9rDxSssDiKNNUxHfgCR9AVaSj4BOd8cTbwDx7ocgWRAvmpSmJYXuz52HTc26NTVf3agwDu7Dd0nZGctLveGN2WW003LSUc5q8ctg8U6kVSkEpIKlXXlrIOardnYr6GST57RY1L0A1QBtViXByI2iNlc0jlvRBFIlTeI6CDMMEQPyrzK8TlDyl nBGTTCWP XmZThSpDV87L9+MeIufcZOZrnOoWxDLoXPJtJO0lOMNyf2srmK7Ih7HhDVAO5RUY2mwBvtkVa7qPKcxz5Xlk8TOkqDuD61XNuTgzrdTVvTMfRtHHeA9YJ44KN1GCeRkVLxV/QOqsUOY0At9d+NtQAf4qBAlQMjjcsHXFSMC21X3YH9nFUlV3lU/SdVqNz5M+LQWrNWW5bGXbXV47d8Peq54g1Wno3QhbAidnivOZII7CSi0TzMv4v1Jhw8UNzV3G7ebFoupDBTm426qttxmrbFEblNEwWHMJAZ+QvTUAMDm/wITtruJi10KBy/PU9gSjKcoDx/swteiI2+GO05NabYr+5EIwqEAXWMwS19YF6JPh495ZyKx9AGwG1M81HhbQTgN5zbBgkwoiQ3jTdgJCMX1sU66qTdR2+yJxkLMG1bODQ/FyOEC57XxrULhPvMExZDgpr3phqnR6GDkOdBangXya8/+pAwNtk+xmYSCiDYy3wsqaFe7Uzu/re2A== 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: A smaller wrapper around bvec_set_page that takes a folio instead. There are only two potential users for this in the tree, but the number will grow in the future. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Reviewed-by: Chaitanya Kulkarni --- include/linux/bvec.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/linux/bvec.h b/include/linux/bvec.h index 9e3dac51eb26b6..f094512ce3bda9 100644 --- a/include/linux/bvec.h +++ b/include/linux/bvec.h @@ -50,6 +50,19 @@ static inline void bvec_set_page(struct bio_vec *bv, struct page *page, bv->bv_offset = offset; } +/** + * bvec_set_folio - initialize a bvec based off a struct folio + * @bv: bvec to initialize + * @page: folio the bvec should point to + * @len: length of the bvec + * @offset: offset into the folio + */ +static inline void bvec_set_folio(struct bio_vec *bv, struct folio *folio, + unsigned int len, unsigned int offset) +{ + bvec_set_page(bv, &folio->page, len, offset); +} + struct bvec_iter { sector_t bi_sector; /* device address in 512 byte sectors */