From patchwork Thu Aug 5 17:08:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 12421705 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_RED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CC7CC4320A for ; Thu, 5 Aug 2021 17:08:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B47836112F for ; Thu, 5 Aug 2021 17:08:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B47836112F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 5AB986B0071; Thu, 5 Aug 2021 13:08:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 55C916B0072; Thu, 5 Aug 2021 13:08:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 423FD6B0073; Thu, 5 Aug 2021 13:08:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0142.hostedemail.com [216.40.44.142]) by kanga.kvack.org (Postfix) with ESMTP id 2792E6B0071 for ; Thu, 5 Aug 2021 13:08:12 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id C846F21242 for ; Thu, 5 Aug 2021 17:08:11 +0000 (UTC) X-FDA: 78441659982.30.D9A82CA Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf14.hostedemail.com (Postfix) with ESMTP id 61D8A60020BB for ; Thu, 5 Aug 2021 17:08:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628183290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RN93NwEe5WtbM1cvBFWuqQaTNSgmNNz3gZJhT/+o3w8=; b=CC/MDQSggD85ARI38xqp+jb4LRMn8CShVTGauNKIyvCppns+Dq+4yXKKXMxDlaWJ3Ogia3 DgMBfEGz4X4u+WF9C323SFy5kWgPUFxudXlSmWlGtTD4iRZEZHiWfIHggmYr5mgFwLR1Q3 /BTLTgrp3dmfv+OwrAxAPEt0MJ2iDlQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-590-L60JlJt9PXyetW7tYPzBKw-1; Thu, 05 Aug 2021 13:08:08 -0400 X-MC-Unique: L60JlJt9PXyetW7tYPzBKw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4E3318799E0; Thu, 5 Aug 2021 17:08:07 +0000 (UTC) Received: from [172.30.41.16] (ovpn-113-77.phx2.redhat.com [10.3.113.77]) by smtp.corp.redhat.com (Postfix) with ESMTP id 991AD60CC9; Thu, 5 Aug 2021 17:08:00 +0000 (UTC) Subject: [PATCH 5/7] mm/interval_tree.c: Export vma interval tree iterators From: Alex Williamson To: alex.williamson@redhat.com Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, jgg@nvidia.com, peterx@redhat.com Date: Thu, 05 Aug 2021 11:08:00 -0600 Message-ID: <162818328044.1511194.11410182995960067691.stgit@omen> In-Reply-To: <162818167535.1511194.6614962507750594786.stgit@omen> References: <162818167535.1511194.6614962507750594786.stgit@omen> User-Agent: StGit/1.0-8-g6af9-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 61D8A60020BB Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="CC/MDQSg"; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf14.hostedemail.com: domain of alex.williamson@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=alex.williamson@redhat.com X-Stat-Signature: jgcg8t5gak5ewz8r7q3obk491g3wm74s X-HE-Tag: 1628183291-782459 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: In order to make use of vma_interval_tree_foreach() from a module we need to export the first and next interators. vfio code would like to use this foreach helper to create a remapping helper, essentially the reverse of unmap_mapping_range() for specific vmas mapping vfio device memory. Cc: Andrew Morton Cc: linux-mm@kvack.org Signed-off-by: Alex Williamson --- mm/interval_tree.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/interval_tree.c b/mm/interval_tree.c index 32e390c42c53..faa50767496c 100644 --- a/mm/interval_tree.c +++ b/mm/interval_tree.c @@ -24,6 +24,9 @@ INTERVAL_TREE_DEFINE(struct vm_area_struct, shared.rb, unsigned long, shared.rb_subtree_last, vma_start_pgoff, vma_last_pgoff, /* empty */, vma_interval_tree) +EXPORT_SYMBOL_GPL(vma_interval_tree_iter_first); +EXPORT_SYMBOL_GPL(vma_interval_tree_iter_next); + /* Insert node immediately after prev in the interval tree */ void vma_interval_tree_insert_after(struct vm_area_struct *node, struct vm_area_struct *prev,