From patchwork Tue Aug 28 14:57:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 10578665 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0725C175A for ; Tue, 28 Aug 2018 14:57:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BAD6D2A477 for ; Tue, 28 Aug 2018 14:57:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC1122A48B; Tue, 28 Aug 2018 14:57:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 315482A477 for ; Tue, 28 Aug 2018 14:57:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E3A7C6B46E4; Tue, 28 Aug 2018 10:57:42 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D73BD6B46E6; Tue, 28 Aug 2018 10:57:42 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C89366B46E7; Tue, 28 Aug 2018 10:57:42 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by kanga.kvack.org (Postfix) with ESMTP id 8029D6B46E4 for ; Tue, 28 Aug 2018 10:57:42 -0400 (EDT) Received: by mail-pg1-f198.google.com with SMTP id q67-v6so1286013pgq.9 for ; Tue, 28 Aug 2018 07:57:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=9tBcS1QRQOB96RExgqPwsrGxCmJ5quUecq8Bctt4nyY=; b=j6u5cpvdl1qBW9hGnXKgAdhropzu3F4/SM8nQpTxCTuBnLzHrtRgPS6iHsGZcqAe+D rZvEB2jg+eg/XucWAJN9nBorilot/WTfOKn3LvqfJyUT+G7O3jr5s6gXdLX7WENAN6D0 z4xP0Tgw3kKtj0EUtQHB4JtxANPMHZnFcOJ7Xq7jZXu9G3kYhNZKpQVs/2KfZH9sH14L 0+rKT1WbG/h4gFfrTSWZ1Z/b9CnP49O4hvkWUpuwGtjUzDvMPazBroJ8ToNI7QLq4uR/ d90KyO0Bk7Czlj9rUPrKOGnElOpHOSzXzRE3XyL/WaVhKmQkh4OZwjtSvY4oTX0hKD4V coxg== X-Gm-Message-State: APzg51Bb+yE6ZyRF9943MdoUjQ47Hqq75d9eALRkagr200OTyHakNlA7 TzQIJaDQbS8sBIR50jTBAqlPqAL6XetzEvOekq+wMDLTABR18bVN9NDpq77nxVyVs7Ma6sSRczS FaA99MKEY30EQ6KTTFNAxLiTO/Q4nhQ+wYDlXpfl7/R4fM7FbyXBAoskwhDEOmJ3FHA== X-Received: by 2002:a63:a112:: with SMTP id b18-v6mr1921795pgf.384.1535468262175; Tue, 28 Aug 2018 07:57:42 -0700 (PDT) X-Google-Smtp-Source: ANB0VdakThNdMNRb3+oyXE2VmwgmA+fYX5Hh5jKHb851W0tKn0vn7/h6Jpfe/WA4B86+vo4LywfB X-Received: by 2002:a63:a112:: with SMTP id b18-v6mr1921760pgf.384.1535468261424; Tue, 28 Aug 2018 07:57:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535468261; cv=none; d=google.com; s=arc-20160816; b=aoZKZOvuuSMHASDwguvqC5/OleYKan2bOjCnJtpXY0z8W9TsfpPeBnO6EowpcOvjRi XEwWD2A3z/JkYCCY7TxtJI6q3zoaAUw13spwla8IhmjtSrd1NnbU7XeH80YEn1kNPts/ IX+kjTaYECIsjliEyh1T7gWEgnDEz0lDYmFeUaTmPU23+rCMu1nHv8hpODVAoyWYUKFS 1qT03rYy26t3849kMRAOjvFXkQRbD7KXO7WNiYmY+1ZXKqRgKshiF5O5Z+0JeUr5eL48 X2RCkncEqVwyYaTxpNvK7jbCkeyfjpWjnt6rF5GdgWf/oUCqgmEtltZU3btsmxUqc66M dSvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=9tBcS1QRQOB96RExgqPwsrGxCmJ5quUecq8Bctt4nyY=; b=M2RK7XP7f0BDY0Ke4dT+2ruqt7tiaohHhpRQnfbph8UIVENRT2SSktiKCmGV0hb1/k tImE07P6I3Ie02YUEyowmzUdyVtx1KDN4Avc4SB0NjxDaSX22wVXC5RR3wUzcHSQ/sxn jb/5evXn1UbdjvxFrYQ9uE6HKvV2VI68mHMaolabWr2V82klLQl+IHubnWnexzKFUV8H 3scNw4V7NImPsRP+RfNjMOgBvFSygRsI39gZxrNTNDTr7Xh5BITI1FlGWIQ762+TfimR sTnoWZ5/Nrq8bBBAXuGA+CVAuV7161AkTycHchchiiCN60NRtGab5mHuNfzSKtAHp1aP e1Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=pbRVvCuR; spf=pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=willy@infradead.org Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id n64-v6si1289213pgn.247.2018.08.28.07.57.41 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Aug 2018 07:57:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=pbRVvCuR; spf=pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=willy@infradead.org 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> 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: X-Virus-Scanned: ClamAV using ClamSMTP 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