From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A81F4C61D97 for ; Mon, 30 Jan 2023 17:48:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237344AbjA3RsC (ORCPT ); Mon, 30 Jan 2023 12:48:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237237AbjA3RsA (ORCPT ); Mon, 30 Jan 2023 12:48:00 -0500 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D749A302A9; Mon, 30 Jan 2023 09:47:57 -0800 (PST) Received: by mail-ej1-x62e.google.com with SMTP id k4so28601867eje.1; Mon, 30 Jan 2023 09:47:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=M+UsnDYEEEOfyUbH/lXJAyb1YrNHDU89XvWY7p8gIqU=; b=CpIi7U8meqUvpwwHiSGd1IdVplT9N/wEXPlMlTsFFXyhK4irJaVCltXVoisRD4OtsJ Rp+GETx2zPi+LRHBbG7TedN9tCa2d44rv6ERS9LZ714bjXED6oA4tXrKaQgaZefoLEBT FmxpGFZB4292Hf7PShZjUN1dUJCt8d/dMntxKh5EE3vQ2/1IMSkKRPUher8dCYs0V1yG b8LfOHrulCQRh/AAOTrO0gUY89a5W9PLGsq/+xfSMRtf5+itz58cVqKOZLq6B2OfqfRh /PZRDDptgKbJtfY7tCnEgNDOmTGJa40XfEUjVp6cWOKwTJy7dVnFZRZFdHwf9raQ0FKA U+XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=M+UsnDYEEEOfyUbH/lXJAyb1YrNHDU89XvWY7p8gIqU=; b=OZaK53lemtiDOiWhwdIYjI0r8NMzehSVhSvb706oy24V1kiNil/9JMiwxUmiv0PFRm 2zicxSDypaxiSBNK7knMH+jTxLN5/wm2rRJxwyv6m2WfRry5XceYax5CQmxc9Su0nl0I wcjCl5FAAYL95Ceyidg/PVIcjqFbBapiNJ4f3JdzOpjJSYCsKzmqFYvu4ZlOZYjEvz5O 5qXAdkvPh/llF7EK55T8nr1XTPn+ScsYnDN1s4oAT32B1yriArhLhlQEuwHY8r04D2Qe wWgiC5Km1iWSDckB4kHnbfWKS/DAeiLR6yvoO0zQLi06JV3y7iSy4BZy1y0fkEqK8PQO ub3w== X-Gm-Message-State: AFqh2krra0v7gz3bn+UMoAwU1vkLbWWPl+klwaXz9tXtu/eOtxwkvo6E +qOWTvAHzldg1dd7WdO4f9DeMwTUiZxXek/EyUA= X-Google-Smtp-Source: AMrXdXuRX3iGxgJVTohVZn9PzXrmwlAnwYJ6yU/LKWcFrxKFgKe4FiyCZtPmYi+BznmfdmjECdu7m6UwdR7AVtAfqLc= X-Received: by 2002:a17:906:3658:b0:872:68a:a17e with SMTP id r24-20020a170906365800b00872068aa17emr7392236ejb.159.1675100876297; Mon, 30 Jan 2023 09:47:56 -0800 (PST) MIME-Version: 1.0 References: <20230130092157.1759539-1-hch@lst.de> <20230130092157.1759539-9-hch@lst.de> In-Reply-To: <20230130092157.1759539-9-hch@lst.de> From: Ilya Dryomov Date: Mon, 30 Jan 2023 18:47:44 +0100 Message-ID: Subject: Re: [PATCH 08/23] rbd: use bvec_set_page to initialize the copy up bvec To: Christoph Hellwig Cc: Jens Axboe , "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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On Mon, Jan 30, 2023 at 10:22 AM Christoph Hellwig wrote: > > Use the bvec_set_page helper to initialize the copy up bvec. > > Signed-off-by: Christoph Hellwig > --- > 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; > } > > -- > 2.39.0 > Reviewed-by: Ilya Dryomov Thanks, Ilya