Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5150494pxj; Wed, 9 Jun 2021 10:15:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytFUYn90vHU5vFItHzu8gSNskb0x570DilGH8fVRaUuUSD7h/Rv6hyK5th7rU33t1rKl+7 X-Received: by 2002:a50:ff0a:: with SMTP id a10mr459245edu.273.1623258923919; Wed, 09 Jun 2021 10:15:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623258923; cv=none; d=google.com; s=arc-20160816; b=GjW3Nck23H0R225js/4K2hkpcisn1OPXEndM9HPhtoZXsYfu2HIrH88YyQEdD/wdyT /hMsYy1COMZiXUY33hFufklWU9jG3D944i766Lao6nSpac11LndJypgDUJ1SgwLhPTRX WKL/3jlTkgBWFTmB5uFew0Cu9tT1JLaR1tJC5jHddXSOjEjLf3gdksG/749Hbf6YlY4Q Bawn6NIFcUjP7wuAxNcWBUab6VX9Hwf0co16zXFNSiFm7x7Y4JQ6jCIL3QTTLGofwhyh /nX+8kPS6zQ/HaiHzoOHYuKz2/oiHOnPibClpCJTXtVeL6b1XPLDACH7etGPNtKgqtpt VQ3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=mhMcjERsi3wx3J0HCHYpS+goiMXBDBgg8cMNxlYjvGA=; b=MNPR3qJeDKQxLyw7tv532VEatpk9M94WYNXBqNsDEs5tHh1/ImvaooE4jExoBw9lcA Lif4TS9nuNtst3kRUrH7qe/x//aRVG8rLq4vjCWvcW/Evrz6EWxLcMvFJoU8ItP29bP0 DYvYtfYUqxhemqtofBy/emlju6M41OD9pHltG/W/sNWcA3lqPHS3ph12wOJqoImUy0BZ sM7t5uI8Q7hqqshZOuzFOnWuC0H0PF5R2jVRaFzt6r+uIERZm4FcPTnGj62Y9++IxrBR HdtHXk0A6apyOqy2Au+oHQtUulJp/3ukqbYiwizHaW/9AO6o69xL8P9yXhGu0Xun6QPm 2d3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ADcj1YVv; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c7si314481ejd.399.2021.06.09.10.14.59; Wed, 09 Jun 2021 10:15:23 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ADcj1YVv; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238152AbhFIJn1 (ORCPT + 99 others); Wed, 9 Jun 2021 05:43:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234720AbhFIJn0 (ORCPT ); Wed, 9 Jun 2021 05:43:26 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0D9DC061574; Wed, 9 Jun 2021 02:41:31 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id j12so18978861pgh.7; Wed, 09 Jun 2021 02:41:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mhMcjERsi3wx3J0HCHYpS+goiMXBDBgg8cMNxlYjvGA=; b=ADcj1YVvHTLC+vKMpsqWPDJsBSDbQj9Juth1j7LfkjKpeyQiAv4eLJia7JtZshRFtJ A+TDHANIoo9IOJ4Kh0lYPvrrYa5nHWPVMBPmA405nRsS3sz38uj/ZBeAXl2ZMbNQjV+D mqkGmibxA5nlTggMZR8xaJL9mgWWlN0qvJ13j0sbvH5mcxMOF9754ReExqahIfdHqL2I NGrYqKJ6VLkatC3yXMel7BVvJXeid1JTMV2nRKXWSqgMLC4VnNuNxzIDSde7bQegncwu 8i1TuPOBXCJ8KzJ7C/7oFxid3upfTcHVU7lyPDQqvDi7b+rtEOCs4e9uougdvb5+gY72 zPtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mhMcjERsi3wx3J0HCHYpS+goiMXBDBgg8cMNxlYjvGA=; b=ZwyFoZ53V0dbFpm6oVmzTiQtyyCEfJTI9z3MPc9OY6EFJpmkkteZ466t9mbB5u0PDr nAZuYLqz0rmGo0DwpVMMQRuQ3SMl8CWcW4PFTX1eUY9CiAZu6tGnMNo2XxHGqmvlddcb sXnh1tIBj+z7ojFXEqIxre4fvESjSTZnpKupLIG/WJHYvUDZofFm6LojcgB+5cJfPl24 EwR/p11kAdrynFD3/D8gGUMMKHsGr5UHcWP6LWMZK2nnfnQhjBQTdez7GJl97vntFceA 0x7zb2KVcxPmywj4V2S25Jnz70/PJOW5QLnEuVsaYFh0Cf9UOoGvcd6RcxTvmFheJWxi WNjw== X-Gm-Message-State: AOAM532QXMwSk4MEFV1rcDXVB7QZVtWxnWlHpHTZg05X2MhAeWTbBR+N XeOnMRYimKy1lcoWHAL7v0u0hhqTCzQuHQS5GOXjkVZ/dhWXvg== X-Received: by 2002:a6b:287:: with SMTP id 129mr18520979ioc.182.1623231195095; Wed, 09 Jun 2021 02:33:15 -0700 (PDT) MIME-Version: 1.0 References: <20210608160603.1535935-1-hch@lst.de> <20210608160603.1535935-5-hch@lst.de> In-Reply-To: <20210608160603.1535935-5-hch@lst.de> From: Ilya Dryomov Date: Wed, 9 Jun 2021 11:33:13 +0200 Message-ID: Subject: Re: [PATCH 04/16] bvec: add a bvec_kmap_local helper To: Christoph Hellwig Cc: Jens Axboe , Thomas Bogendoerfer , Geoff Levand , Dongsheng Yang , Mike Snitzer , Ira Weiny , dm-devel@redhat.com, linux-mips@vger.kernel.org, LKML , linux-block , linuxppc-dev@lists.ozlabs.org, Ceph Development Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 8, 2021 at 6:06 PM Christoph Hellwig wrote: > > Add a helper to call kmap_local_page on a bvec. There is no need for > an unmap helper given that kunmap_local accept any address in the mapped > page. > > Signed-off-by: Christoph Hellwig > --- > include/linux/bvec.h | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/include/linux/bvec.h b/include/linux/bvec.h > index 883faf5f1523..d64d6c0ceb77 100644 > --- a/include/linux/bvec.h > +++ b/include/linux/bvec.h > @@ -7,6 +7,7 @@ > #ifndef __LINUX_BVEC_H > #define __LINUX_BVEC_H > > +#include > #include > #include > #include > @@ -183,4 +184,9 @@ static inline void bvec_advance(const struct bio_vec *bvec, > } > } > > +static inline void *bvec_kmap_local(struct bio_vec *bvec) > +{ > + return kmap_local_page(bvec->bv_page) + bvec->bv_offset; > +} > + > #endif /* __LINUX_BVEC_H */ Might be useful to add the second sentence of the commit message as a comment for bvec_kmap_local(). It could be expanded to mention the single-page bvec caveat too. Thanks, Ilya