From mboxrd@z Thu Jan 1 00:00:00 1970 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=-2.6 required=3.0 tests=DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,T_DKIM_INVALID, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 551B2C6778C for ; Tue, 3 Jul 2018 12:39:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F2485249AB for ; Tue, 3 Jul 2018 12:39:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="beBSku+A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F2485249AB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932318AbeGCMje (ORCPT ); Tue, 3 Jul 2018 08:39:34 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:40504 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753331AbeGCMj3 (ORCPT ); Tue, 3 Jul 2018 08:39:29 -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=S9pbXtRIKNKl/54qwUkDhPMQHzYUxWMCzHXExoc4vOM=; b=beBSku+AuH+3cGGT/9Cj1us1U 3+GJaJIqNib5DCfguhtiPf9scaKI+qdz1lmYbeWOtEKCVPAcLmznilvmuNbixuXQp+nOO4aESyMaa ripPJQ0FkVNTefsu22BxmV0RzBjFSDRCe/Od/YaKJ/+6uCaMmmjwuvTGsiXrK3lzjrxGPqkGD8XT6 BCRoefbAi98ICemtHpmg57S1uYmNPFSnl11KFMsk4zxYkNTQYCEnTvMWuG2aQO02jo7JrVHCusXkA d7eL2E5JsP2hvGYnvhNGis4W1zXN3nmwu7QZgI4F00TiZCZCqE4mbJEZpLBMqF1P/1EF4x43ai+Eb SQ+XfHp6g==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1faKaT-0000aU-38; Tue, 03 Jul 2018 12:39:17 +0000 From: Matthew Wilcox To: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Cc: Matthew Wilcox , Souptick Joarder , x86@kernel.org, linux-kernel@vger.kernel.org, brajeswar.linux@gmail.com, Sabyasachi Gupta Subject: [PATCH 3/3] mm: Make vm_insert_pfn_prot static Date: Tue, 3 Jul 2018 05:39:10 -0700 Message-Id: <20180703123910.2180-3-willy@infradead.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180703123910.2180-1-willy@infradead.org> References: <20180703123910.2180-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 3cb763a38642..703a9962103e 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2439,8 +2439,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); int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr, diff --git a/mm/memory.c b/mm/memory.c index caecb4d995ac..73c5682310c7 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1828,31 +1828,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; @@ -1879,6 +1855,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