Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp7199862imm; Tue, 28 Aug 2018 08:00:17 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZU7Pucdm1Z9IIOpuCkH0vuGaSw8Z96JRy+BFcQafoDsAJU8hkSCSxn3GaoToJGuS7mvrSS X-Received: by 2002:a65:4c0b:: with SMTP id u11-v6mr1872454pgq.451.1535468417580; Tue, 28 Aug 2018 08:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535468417; cv=none; d=google.com; s=arc-20160816; b=rIc9WjbamFqIm/CTFPkKb8oqMrZ2bcqpshHq+WKwSpG7Cq+94eZEHKisxtOFcDg7Tv gsxtEjOVb6gr5g88kInLq6o4F0TBQcb/CpfQ9KvB87bPCNuhlKrfNsP32gBqa/nlCBgD d3uVnyTUrp7pyfmHgups0FRzQPeWpxaT25W13T8ecRAweBS69zV/8kmoH41yik2wxV1E bZDvpSotd9Z7b/lL3U2Uxcl5AFGfKt0SutpgxoHvGlhMFzFMWzIdXNkvzLlLlFRjajeb OjjSvSCoOkzXmjcNNip/pyhKKWQoZh1JO08ukEnDoe3lcd7sQuAtS6kjm3xmaXVlcXXH yjwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=9tBcS1QRQOB96RExgqPwsrGxCmJ5quUecq8Bctt4nyY=; b=kB9YlDhfYGx36oPoMWY6FUGTNXgDKBL4e6CCyfnnBfE8zUlPWK9gmGG7r3Fj9wsXuY 9rNj1LHEJVLXxGPjP3fpvZWLvIdneLtjr/TLagCbM8lrjUcfyRV1v4Kl5FrVal4Uma+q IvJS02Gfa6qsfaTcgIVv6asr9x1qM8LSJNdKkTbyAC5tgZj+gjK/Z1czUuwYf3x1D5O7 BbOTbqMs7WFqcndJ7lXINHvug1YQQa1q+OH3z3Ql2Gozf4EngHX5o5guCLV98EJJDjK7 NSLTjFeM4ikpCsAhgzs2wL+r/nEF9tQ4oxN49XJV+ShprPHAzio4ZNhn+xjONTmMqGN+ tgCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=pbRVvCuR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z4-v6si1183897pgl.666.2018.08.28.08.00.02; Tue, 28 Aug 2018 08:00:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=pbRVvCuR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728489AbeH1Stp (ORCPT + 99 others); Tue, 28 Aug 2018 14:49:45 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:57626 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728282AbeH1Stn (ORCPT ); Tue, 28 Aug 2018 14:49:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=9tBcS1QRQOB96RExgqPwsrGxCmJ5quUecq8Bctt4nyY=; b=pbRVvCuRqgWeE8eThkiSJUGOU 0tGJ4MEa0VLyU0TeVTIpGmKyvTeR/wCdJAePZXYUat97fFyeh9/o47ljBZ8fdjCp30jfa50Pc9/Im sHHuvnMOJMpiHrYykf9eN8TqbFFX51oJEyLQ5gBPIWF5oZrdBTEkBkkHJZqWmgrvtmncnf3b20vcS 8wC8Nu117GUJ3lO+CcSTqxxTf5eiyMn/E6TU8FGmXpNkdiSAJtV2tElE6lJBKeSHOH+qyuL5qIThA WmDim6UMO28VblH5IT1p7+l3I9Y2gaHsoHSyTOFGcFxUPfW0yI7X9cjkWNMQYqxuMIvkQNLGRQF7T 9+UaGGUiw==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fufR5-0003Ba-6p; Tue, 28 Aug 2018 14:57:39 +0000 From: Matthew Wilcox To: Andrew Morton Cc: Matthew Wilcox , Nicolas Pitre , Souptick Joarder , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/10] mm: Make vm_insert_pfn_prot static Date: Tue, 28 Aug 2018 07:57:23 -0700 Message-Id: <20180828145728.11873-6-willy@infradead.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180828145728.11873-1-willy@infradead.org> References: <20180828145728.11873-1-willy@infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now this is no longer used outside mm/memory.c, make it static. Signed-off-by: Matthew Wilcox --- include/linux/mm.h | 2 -- mm/memory.c | 50 +++++++++++++++++++++++----------------------- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index e8bc1a16d44c..1552c67c835e 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2480,8 +2480,6 @@ int remap_pfn_range(struct vm_area_struct *, unsigned long addr, int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *); int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn); -int vm_insert_pfn_prot(struct vm_area_struct *vma, unsigned long addr, - unsigned long pfn, pgprot_t pgprot); vm_fault_t vmf_insert_pfn_prot(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn, pgprot_t pgprot); vm_fault_t vmf_insert_mixed(struct vm_area_struct *vma, unsigned long addr, diff --git a/mm/memory.c b/mm/memory.c index 8c116c0f64d8..8392a104a36d 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1819,31 +1819,7 @@ static int insert_pfn(struct vm_area_struct *vma, unsigned long addr, return retval; } -/** - * vm_insert_pfn - insert single pfn into user vma - * @vma: user vma to map to - * @addr: target user address of this page - * @pfn: source kernel pfn - * - * Similar to vm_insert_page, this allows drivers to insert individual pages - * they've allocated into a user vma. Same comments apply. - * - * This function should only be called from a vm_ops->fault handler, and - * in that case the handler should return NULL. - * - * vma cannot be a COW mapping. - * - * As this is called only for pages that do not currently exist, we - * do not need to flush old virtual caches or the TLB. - */ -int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr, - unsigned long pfn) -{ - return vm_insert_pfn_prot(vma, addr, pfn, vma->vm_page_prot); -} -EXPORT_SYMBOL(vm_insert_pfn); - -int vm_insert_pfn_prot(struct vm_area_struct *vma, unsigned long addr, +static int vm_insert_pfn_prot(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn, pgprot_t pgprot) { int ret; @@ -1873,6 +1849,30 @@ int vm_insert_pfn_prot(struct vm_area_struct *vma, unsigned long addr, return ret; } +/** + * vm_insert_pfn - insert single pfn into user vma + * @vma: user vma to map to + * @addr: target user address of this page + * @pfn: source kernel pfn + * + * Similar to vm_insert_page, this allows drivers to insert individual pages + * they've allocated into a user vma. Same comments apply. + * + * This function should only be called from a vm_ops->fault handler, and + * in that case the handler should return NULL. + * + * vma cannot be a COW mapping. + * + * As this is called only for pages that do not currently exist, we + * do not need to flush old virtual caches or the TLB. + */ +int vm_insert_pfn(struct vm_area_struct *vma, unsigned long addr, + unsigned long pfn) +{ + return vm_insert_pfn_prot(vma, addr, pfn, vma->vm_page_prot); +} +EXPORT_SYMBOL(vm_insert_pfn); + /** * vmf_insert_pfn_prot - insert single pfn into user vma with specified pgprot * @vma: user vma to map to -- 2.18.0