Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp870081pxj; Wed, 16 Jun 2021 15:53:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4WspJCNKru50njvxAE5koP5mXRgyFR8+8bxd0PZ51yoXu4sRPmX+Zy5Pyycw1mz8+/Bdy X-Received: by 2002:a05:6e02:1a4f:: with SMTP id u15mr1334720ilv.147.1623884036678; Wed, 16 Jun 2021 15:53:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623884036; cv=none; d=google.com; s=arc-20160816; b=MD0qUc7sEEWSIXKgX023hTFEvWxveFo+EcNvmi2HsAUspRpKgmu9YfeCKOi21IB7Dn WSin0ZxOJ6WthtU+OqLA5IBe5v8GPmYTrmZotRHH5bP+lonVPCx1F/ptWnbLUQzS5gCX g4Hc73AKrRFKdgCsSyeJIGX3hw9C7vGlrDbOEFRB162CjGloVCii1y/7ruJVk/jr7UnR 0oiRfLpt5IBB5SqZcPFVFQo+lUaNM/RpvEgDV0eZIUIhqju0Ul+UVz4OD6l12bK+B7EC dvudWjL7+zoAS5G3alQS/0687xryjS2VspSqcW1QF/ukudLfCVOOvvJ568RL0poQHjTI v/sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=8MKUHbuhcvvAbyVmhGO6tF9OydsRY8Yh0Heff4psMcU=; b=ucd390VdeDmutp+H7XFNcvHaOeQFvldbBRF+QLsxxTXtZ76ZxOY0rVB8vAj088vVwn nrGR6BQPIELA0V6oupRzdDm/QFaErdIq5HgQfwBPYPrRpVORamW7eTtqsy9Z47B7o+gF DArAleVUZlgXNRm4xxyXokIRWlesdTZMQY8j0FGvzccrh8WXxbEuJIHIk3aNXmPNGyQt gZCrRqGToDbc/fHlK/bejy2NGp2yYPZjlmlvnGzn2nOzT8yo1LqG7yPfxDHIzWhAjHTP U9wkGnecSe6U77H9PSISi2ZRXzMUB90MVT0FGYtBiaebpab1stiA0ck78dJ3a1hDD3pv 7p8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k19si3025910ion.69.2021.06.16.15.53.45; Wed, 16 Jun 2021 15:53:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230383AbhFPQyf (ORCPT + 99 others); Wed, 16 Jun 2021 12:54:35 -0400 Received: from mail-pj1-f52.google.com ([209.85.216.52]:56291 "EHLO mail-pj1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230083AbhFPQya (ORCPT ); Wed, 16 Jun 2021 12:54:30 -0400 Received: by mail-pj1-f52.google.com with SMTP id k7so2065225pjf.5; Wed, 16 Jun 2021 09:52:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=8MKUHbuhcvvAbyVmhGO6tF9OydsRY8Yh0Heff4psMcU=; b=Qx1uZvn6htngZ1WWlJ23cxY8+02jmvVndZRS5HfNm6PhPMNmp8kyOwKrvxvWwGoine 9pr3U2gpJQNLvBKbAIGO/1gYwBvjA5gjpCOilIOY+IA+sClaHqRlDfQj1XR4QwQ3FbW8 3G5UvXz0vHQELf3NJ9fAZCjWKl9nkW5mwFOzFZhF3QZ7NMh95VMqeDbqDAFGrzGEO0BO s95K0r3Z7FEi+vssdwtjB5ZrXfbpPcEINoLNfGiEGmJKq33XXmHvYKR4sri872wUhPLj +4JmWQ1iApPivj/qrUmcVhxsign5XTu2hKmgxEu6zD5cr2llCvn+krPnGweV5rByC3PN yWPw== X-Gm-Message-State: AOAM531oMH2N4zNWcyVBLilmcdDWzJnL8cabQWQ4b006bwS2MvsMoL1w /G0Qder6MW3ULapRNiqyittjfGjB7A0= X-Received: by 2002:a17:902:6a84:b029:f3:f285:7d8 with SMTP id n4-20020a1709026a84b02900f3f28507d8mr457172plk.57.1623862342073; Wed, 16 Jun 2021 09:52:22 -0700 (PDT) Received: from [192.168.3.217] (c-73-241-217-19.hsd1.ca.comcast.net. [73.241.217.19]) by smtp.gmail.com with ESMTPSA id w7sm2574738pjy.11.2021.06.16.09.52.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Jun 2021 09:52:21 -0700 (PDT) Subject: Re: [dm-devel] [PATCH 06/18] bvec: add a bvec_kmap_local helper To: Christoph Hellwig , Jens Axboe , Thomas Gleixner Cc: linux-arch@vger.kernel.org, linux-block@vger.kernel.org, Thomas Bogendoerfer , Chaitanya Kulkarni , Mike Snitzer , Geoff Levand , linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org, Dongsheng Yang , linux-kernel@vger.kernel.org, "James E.J. Bottomley" , dm-devel@redhat.com, Ilya Dryomov , Ira Weiny , ceph-devel@vger.kernel.org References: <20210615132456.753241-1-hch@lst.de> <20210615132456.753241-7-hch@lst.de> From: Bart Van Assche Message-ID: <244b92f2-7921-7f33-b83f-66f3fff57696@acm.org> Date: Wed, 16 Jun 2021 09:52:18 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210615132456.753241-7-hch@lst.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/15/21 6:24 AM, Christoph Hellwig wrote: > +/** > + * bvec_kmap_local - map a bvec into the kernel virtual address space > + * @bvec: bvec to map > + * > + * Must be called on single-page bvecs only. Call kunmap_local on the returned > + * address to unmap. > + */ > +static inline void *bvec_kmap_local(struct bio_vec *bvec) > +{ > + return kmap_local_page(bvec->bv_page) + bvec->bv_offset; > +} Hi Christoph, Would it be appropriate to add WARN_ON_ONCE(bvec->bv_offset >= PAGE_SIZE) in this function? Thanks, Bart.