From patchwork Mon Jan 30 09:21:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13120639 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 1FF6BC54EAA for ; Mon, 30 Jan 2023 09:24:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 91D766B0083; Mon, 30 Jan 2023 04:24:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 856916B0085; Mon, 30 Jan 2023 04:24:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6F5636B0087; Mon, 30 Jan 2023 04:24:11 -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 61BA56B0083 for ; Mon, 30 Jan 2023 04:24:11 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 324F240341 for ; Mon, 30 Jan 2023 09:24:11 +0000 (UTC) X-FDA: 80410929102.04.1B7CB2C Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf19.hostedemail.com (Postfix) with ESMTP id 8377A1A0003 for ; Mon, 30 Jan 2023 09:24:09 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=SyOpTX9C; spf=temperror (imf19.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=1675070649; 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=PasJ3iDfX2TllVLQ6e7N8/T+ZQHWRBi9Mi0fIgNsQxA=; b=v4NpfJxf8dq/rNo/MBJfDy2W+XTz8Agu8g3BaEqbCKpGkEILmEQFGCUb0Zpb4VNFTrLa/5 Qtf3Yu7HrrZxnosOpoS/W6oAukPNtKTdJQoSxBvr8WkZ1DaL8rHx5zTGmFyVvZbPOpCPQ0 88sZpS4wl4kjO/MQx1fM5sztsnRHN5c= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=SyOpTX9C; spf=temperror (imf19.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=1675070649; a=rsa-sha256; cv=none; b=an+uY9OQ7kwCbvjjyQz1bbnpmvmktHOrPZyznZFiweIMxJCSPWTyNfCX5A+IPPIviah5hk lkOPxaEwrB2kyV4phSkZlG5rCKMk6nufKrvrJ8QQlHqS6qS1oV6RSIcvJwARoFX16UCvJW x7XHBxIDAiOq3L2gMaIeU6aVXnhCO08= 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=PasJ3iDfX2TllVLQ6e7N8/T+ZQHWRBi9Mi0fIgNsQxA=; b=SyOpTX9CZKgu/mdg93Px99ohqU lpY5+Plpyd7Zy3mO80AFoiDBWvs4Fx74nS7dp1CeTeZRYGYVgZlN3xShKOlsqOHMR8YDIfD97TAOl i6DuUXOwtd+Qsu7XWKS9q2lROG9nFii2MJjf2cIawTQo8pmmmRvWWh3yI3j64SspCOd4hOaDYQT59 IxVhU3Tj/X05Ke06JXfdsywRjVOFjJJT2OqUrGdoAw1YlbWzSVrtgtw54YyS4zmtMPEU8NVcbK/29 hwDgey6wC2KTsvdLDoGO0KUy407IzJh0Nss1p0gnq5DmSbrdtNR41EirSVoNLrufaOEJ9Q1DMff9S /WQX3d/Q==; 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 1pMQMw-002o87-6w; Mon, 30 Jan 2023 09:22:30 +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 08/23] rbd: use bvec_set_page to initialize the copy up bvec Date: Mon, 30 Jan 2023 10:21:42 +0100 Message-Id: <20230130092157.1759539-9-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-Stat-Signature: fzamde9hzg6ghyuxp9e1psbntxpgdx5d X-Rspam-User: X-Rspamd-Queue-Id: 8377A1A0003 X-Rspamd-Server: rspam06 X-HE-Tag: 1675070649-155217 X-HE-Meta: U2FsdGVkX1+Tz1KKQNh7NM9bumqRGaGQtos3xmMUBdeejgzAxQJS7nKMF+lhL8nr7VLhpL5VAwBvL6zOkyBFEY+/PqG5RSE+TwFl+tkHtWasXFREqyzplcdYWuk3zSTCXBaQYUH4b284JXjcWfK+kTJ5ex/mOkDVnvRtG8iQs2ZfZ34b7vzqWFEv9z7i1avcjs1HTmGHVhy6aH3M9saAWK9vQ8a+QcRt89dLtxZe4rDn2Dloq2cstw3+kAisxkvj1VUxTeinZa5YLfwCg2tJF0qEn/3/8CKgz1pRbQakDUm5zPa5ZJiBY/iDsim+0QfosZHsPqx1rNr764hdIGUROPF0OspkA+dtQN75+C0YP+/+Or3rg9DKiH1eJQcdSoP/8C0gewekU5Ql4/3KsSWHih6Z9u4cqdHWBDbF6xArki/fg1bWu0FfenlMYg/+ljdqQY3+CWZ+QV0SR+b3aUl+FR7fAGDW+AcbnGJ9Y72C2mX8UIPfbeWeJW/pUsu0m+XU8K9R4/PbTMyQFrEP3972Y+tU0BihVM44riv/aOqHBjnV8NYD3cT3UMjq75cbmCiMFM6zJfM8iKiPsyWUwZiXbVNWV8867HNeVTBcxLJ+PY4EFdAIs09RQcVMpJAYoGFfA3GpJ2kd/aDWQt5jre9mmsJ16DsTMaOvGCKotk/5/J025zny+oWBfoZb1hD8mxN89jzUzqW6PV24NqQ40xpKTwr4/zn+0eNnrfZZwRCun3ebkintEtUvIfiqhmrhVCF69iBExf/c5JZUbp5Y0B0OMVD3LmBKEOuTH/jEvCzSKMLatJGiQr3OXkHnyb6h/MeHU4FZP5XSFJnS7RrHKIZAWDR2zrBqHklP0Hm3ciwN79XqVIarD/K2hbJzLbvnpQRnDsyNwD51ug1bJ/rKo4O8iJ/ZN97aePZ/X8relRyN1F1w7VFe0H5qzH95tF6McMJu0I+T1lQsA6V3y0bdUul BOp3luUd QqQjIdyL9i98jYUA206bMUds3ZFS5hJ6O4FwPj3vQyfE8fWaYbTDU2Mxe0BWy307ECBWUmcH/6V1OKqmK+WSlY6cmcEXroTeyy9ADQmmSQoIXCXmHV6E24HyJ/A8zApNuoy8ko3pnuHLWioVcAB5poX5MJm2vYX3uvKKIi/Rr/FsMDjjJt6JD5e5f3KlHETTTXXl681tJ/Owx67RQjatZFxNtVc6KEPpzuSodESbrc88lAoLHuc/uexnZu2B49i/5VA/5D2vAbJZuBdKM87DMDFxnokwQpAFmU8PuT4H6I8daPg2bRrfGiZm9+dB36NwYNDb0jy4lEQ00qIC4QlhzLTgFJj8jkCVIgW8XuwHjyDNGrgw3itOp3wVvplJAi9b4i37ycxNCopTdi4a2yr6n9SUbJAkKxPEIln4juc82Z3qxlR1MO7NHwW/gFNLmLvlFh/WFoJa616Eby0PdGuoLmhzWqlwChIjD9BcRlUeGQlykrn4= 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: Use the bvec_set_page helper to initialize the copy up bvec. Signed-off-by: Christoph Hellwig Reviewed-by: Ilya Dryomov --- drivers/block/rbd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 04453f4a319cb4..1faca7e07a4d52 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -3068,13 +3068,12 @@ static int setup_copyup_bvecs(struct rbd_obj_request *obj_req, u64 obj_overlap) for (i = 0; i < obj_req->copyup_bvec_count; i++) { unsigned int len = min(obj_overlap, (u64)PAGE_SIZE); + struct page *page = alloc_page(GFP_NOIO); - obj_req->copyup_bvecs[i].bv_page = alloc_page(GFP_NOIO); - if (!obj_req->copyup_bvecs[i].bv_page) + if (!page) return -ENOMEM; - obj_req->copyup_bvecs[i].bv_offset = 0; - obj_req->copyup_bvecs[i].bv_len = len; + bvec_set_page(&obj_req->copyup_bvecs[i], page, len, 0); obj_overlap -= len; }