Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4144062pxv; Mon, 26 Jul 2021 23:06:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMaHa6acQKKVlG5bRlKPkU2rz4d+6nNUh85NU6YhpAG10gZOmqaGnil+NuJWIcF051F23+ X-Received: by 2002:aa7:c5d2:: with SMTP id h18mr20668219eds.132.1627366017320; Mon, 26 Jul 2021 23:06:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627366017; cv=none; d=google.com; s=arc-20160816; b=yEKbWpx9hT2n7sz3Z+JN05Tbpb4qnwr2q4iBexEZy9KQS5j72yzER6x5mqQaxD9QjR shm/WwscAn1zCGPJ9cDpC70CPhH6YeFoG8mlyS5eTXyuZlBHw5waN/1ZHT47lrJN+LyA cZlDYQu56QosFeh9smNMtelmeLLj8ysvVFFX16USqHvzt7j19yjgI8NM15hMDYjQ0JTe /x8cZX+AENyoxvqkrv3QEQcXAHFLolXj5suRlF4rqnO+GNsusAZqmq5qbsPfPxka+6A4 osXBdA9z4tnkFw4cNNXZKnj2chuVaYKYV/LiF1BcIhqZjcKQrCcuKXieOTzhipBMELTG tSOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RUZ53JRW+Y40jSDld/pmd24FvGrlJLI/Shilr+kOgJg=; b=bbq+e44Y39bj+gHcuI77yfH1Iwv12Zt42XINRi9ZI6Xo4Dzg93ZPWmUWypr2qo/Qe0 zOp7IPFrxbES/e9vQdV/PruBjzoy9Q+78+oM7QoZXsZelx9pXqW20KWYRSgwSQe1q6FZ 38nUw91R6USggOMhT++kXPXOZYSibaJP3V9PGxJolyBgmTSMEQ6by31A4Ep+6G2IelFn PXWzuzZn9/4hYPPLSFgAhZzB5kOwpQbjPYJ/WWT0b7amTgX3URyxuA8PZqhGGyBMzKh8 qrfI0R1BMCw7FN6hAtHaTOplG+RmsMERY3u47RK8IdoXvQdsQdaZxiAyfYEr/ptJh34z 6gyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=YWh+6nhQ; 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 s18si2262612eji.591.2021.07.26.23.06.34; Mon, 26 Jul 2021 23:06:57 -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=@infradead.org header.s=casper.20170209 header.b=YWh+6nhQ; 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 S235577AbhG0GEf (ORCPT + 99 others); Tue, 27 Jul 2021 02:04:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235612AbhG0GEf (ORCPT ); Tue, 27 Jul 2021 02:04:35 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51507C061757; Mon, 26 Jul 2021 23:04:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=RUZ53JRW+Y40jSDld/pmd24FvGrlJLI/Shilr+kOgJg=; b=YWh+6nhQFFioCIPOaLPmYk6kUA 6phgr4hvpipWGMY5WrLgPeEkB4uW8VA0j+vWp4vEq1BZNK3fLeCviChI1wxCr7TwSCv5JWjAve9II 6LiDrbLg9EvwFqJecik6Js3rUHufaJkZCKAtHgCTh/CCckjbWYm2ycqNvMDDtmJc/3lZtu3c/COHQ PrHJ/uenZTh4fQX9SCZ73Uvve3rGaZHG0pnsvLWsdXj02XrzVj14JwVTLYySR1D0FSALY2mC+BDX4 ipM5mIrqBnfstMrXMkmCLkoVIHbzrvT5G9hKOhyhskrtjV0UZEPDO8JZgpTKFnUurL4fj8SlbgA8Z 6/VrJBfQ==; Received: from [2001:4bb8:184:87c5:b7fb:1299:a9e5:ff56] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8G9o-00EiaK-P7; Tue, 27 Jul 2021 06:01:59 +0000 From: Christoph Hellwig To: Jens Axboe , Thomas Gleixner Cc: Thomas Bogendoerfer , Andrew Morton , Geoff Levand , Ilya Dryomov , Dongsheng Yang , Mike Snitzer , "James E.J. Bottomley" , Ira Weiny , dm-devel@redhat.com, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, ceph-devel@vger.kernel.org, linux-arch@vger.kernel.org, Chaitanya Kulkarni , "Martin K . Petersen" Subject: [PATCH 03/15] bvec: add a bvec_kmap_local helper Date: Tue, 27 Jul 2021 07:56:34 +0200 Message-Id: <20210727055646.118787-4-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210727055646.118787-1-hch@lst.de> References: <20210727055646.118787-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Reviewed-by: Ira Weiny --- include/linux/bvec.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/linux/bvec.h b/include/linux/bvec.h index 883faf5f1523..f8710af18eef 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,16 @@ static inline void bvec_advance(const struct bio_vec *bvec, } } +/** + * 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; +} + #endif /* __LINUX_BVEC_H */ -- 2.30.2