Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp7199788imm; Tue, 28 Aug 2018 08:00:14 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZRQqn6mKNvUX+rZ/ZpQTKl7lQPXW4/1x5ae0hoFObelgazXAKrgoMrr++hCjGhIUGWL59h X-Received: by 2002:a17:902:5a49:: with SMTP id f9-v6mr1966865plm.332.1535468414034; Tue, 28 Aug 2018 08:00:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535468414; cv=none; d=google.com; s=arc-20160816; b=1H83n3zEV+WDzEqQpXJ2nja3Kz5TSVd9sgrgt94pjppXOsp3QFSkNafWo5nSztRV07 gIpt/jKercuB9wE8b1RWzEG16aZdBeFxd0x3byT3toQqGGXghVHfcpspo8+IKvSOb+dH cB8Ne0POH0v0cF15V8RoCVqqKk+74uVaNEDkg4AHmn99IR0uRGXof0NI9ptfHkvjm1A+ Bt0W4fkIfd9gLoMItmVP3mcRYlM22WgwBwVJKjcBuFukgRw2C4B7IzNTgMBq4LMk134N KtgvPhxI21C8sYIPEKO/pAKHDReb6Oi/WW7XMzWwpZcPtXkGbdcvfnXVmjxqbwlOQ8QD Z0Yg== 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=Exkv+LQ8zSJPTyJeFocnVOLnkAEWo8whdsioYoMD2fw=; b=hAOparzGa0xCqITNxLN4YjkwQpnpH3UddIiVFqKzakLUEs8kD4dL/63SnkX7dnp5N4 dmfta4cfcjgx/QnzwFBv1CTHr0ED9w3ckFZ0nTY9FBQnvVQG4SIYYHXooPoO7QEamKuC wlLllrRXPafETkH/njGKKYSfl2zJqJkB1r84bpUVduBtYsB72yB2hpLbgrfLXYr3oc3t +2o6KW/zDz0yeRdI/mhnlgYeHSwMENPmEukWx5B115hwRbUYkDhhsUezZsTYWxZq+7Zu +zsZ6zI+b584Jxav6crDDtF6ObPJIjNiL340h4XLjsCfNvUJ4SpOuf1AcHoG2jXyZQSR qz6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=QwboO2dW; 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 d5-v6si1200917pla.237.2018.08.28.07.59.58; Tue, 28 Aug 2018 08:00:13 -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=QwboO2dW; 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 S1728363AbeH1Stm (ORCPT + 99 others); Tue, 28 Aug 2018 14:49:42 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:57538 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727827AbeH1Stl (ORCPT ); Tue, 28 Aug 2018 14:49:41 -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=Exkv+LQ8zSJPTyJeFocnVOLnkAEWo8whdsioYoMD2fw=; b=QwboO2dWE2pSRU5AMnJauS/KS mMb3BlCJKut71jT7XMq6iIyQvWlifU8RyEEY2yQ0DIXPIY5QUCkvgnOcdjCwRhvthLmzY6eaeZb/L NnjPDhHaexzFI23A+siAhvmeAjJiXIErHXJ+AIgxoDN7hG9Q15wMHw/N26JUiTu4Ehe+S13VNjyNs ndDeAxQ7+UgWiGsK/24/0JtME0fkkAU+zfoF+q5zLfg5rsheNo8Cq4jjpL7gjkEhGP41qwaFauGzv u7rlBgMJDck165FeXdPjkR4CpaBbkVczf6a2x/uLzSaeP0ihS5odedmoreD3p7GKa5OYESZYoOOxh uTxiR9mvQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fufR2-0003AM-WE; Tue, 28 Aug 2018 14:57:37 +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 02/10] mm: Remove vm_insert_mixed Date: Tue, 28 Aug 2018 07:57:20 -0700 Message-Id: <20180828145728.11873-3-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 All callers are now converted to vmf_insert_mixed() so convert vmf_insert_mixed() from being a compatibility wrapper into the real function. Signed-off-by: Matthew Wilcox --- include/linux/mm.h | 15 +-------------- mm/memory.c | 14 ++++++++++---- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index a61ebe8ad4ca..ce1b24376d72 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2482,7 +2482,7 @@ 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); -int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr, +vm_fault_t vmf_insert_mixed(struct vm_area_struct *vma, unsigned long addr, pfn_t pfn); vm_fault_t vmf_insert_mixed_mkwrite(struct vm_area_struct *vma, unsigned long addr, pfn_t pfn); @@ -2501,19 +2501,6 @@ static inline vm_fault_t vmf_insert_page(struct vm_area_struct *vma, return VM_FAULT_NOPAGE; } -static inline vm_fault_t vmf_insert_mixed(struct vm_area_struct *vma, - unsigned long addr, pfn_t pfn) -{ - int err = vm_insert_mixed(vma, addr, pfn); - - if (err == -ENOMEM) - return VM_FAULT_OOM; - if (err < 0 && err != -EBUSY) - return VM_FAULT_SIGBUS; - - return VM_FAULT_NOPAGE; -} - static inline vm_fault_t vmf_insert_pfn(struct vm_area_struct *vma, unsigned long addr, unsigned long pfn) { diff --git a/mm/memory.c b/mm/memory.c index c467102a5cbc..f0b123a94426 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1940,13 +1940,19 @@ static int __vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr, return insert_pfn(vma, addr, pfn, pgprot, mkwrite); } -int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr, - pfn_t pfn) +vm_fault_t vmf_insert_mixed(struct vm_area_struct *vma, unsigned long addr, + pfn_t pfn) { - return __vm_insert_mixed(vma, addr, pfn, false); + int err = __vm_insert_mixed(vma, addr, pfn, false); + if (err == -ENOMEM) + return VM_FAULT_OOM; + if (err < 0 && err != -EBUSY) + return VM_FAULT_SIGBUS; + + return VM_FAULT_NOPAGE; } -EXPORT_SYMBOL(vm_insert_mixed); +EXPORT_SYMBOL(vmf_insert_mixed); /* * If the insertion of PTE failed because someone else already added a -- 2.18.0