Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp265458pxu; Wed, 2 Dec 2020 22:33:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxb6l674sSWzrhHLwvb8mjojrBS5dssQetGngtd3fi7604GhJmEPn7/Uu2GNQn+AAoeJ91V X-Received: by 2002:a05:6402:1389:: with SMTP id b9mr1494960edv.178.1606977187142; Wed, 02 Dec 2020 22:33:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606977187; cv=none; d=google.com; s=arc-20160816; b=c/LAi1EU6PZUs6qbFXzFle5ZBo3GA51z8azHIZB5Ivva+ihcA/x2ARYCReqnuTXQ0v 3h4aW/QYydkM/wqd1rn1fZj/BuR53FMfmk42Qg7qkXCh+Lh9STDqqbjOh3DSjrb8Fk03 fGbS7Qv9l5s+YNk1EIsyI3w2zmHNpnEHKZwEBLO8fQHJ+btg0juwpyYXudkh0GpIHVRP sBH4cuyUvixU+lhotkAaH29JenubJmOo0kgQGumVhkSfblpdLMb9GuPPaMeV8YUSc5xk 0XhTO2JyqlmWBGZus6oiVc7swiIUrlBDb/PNH/cr29efk04Egs2JxzyQfTZhrGJJu40O Xsbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=F7IZJPpVplJnb/oRgygieaqt10nGC7E982jw8wjr1Hc=; b=E81DaAY/2+0nhkPMqdt2ebX78b/eMFmSHJWodq0Qu+w7HH07T18ETn//+WspXEm6Mq 7M0P+/Vdng7/K7d/Xw/+EWF2WAJbTY2ZNPp7KJhS6MqU96rsOzKWrBxPVVEPAkel1ELM VJAKixtsNFpxiOKPuEym2ufXhORdwlX5MSdXsQioA+xXaUChxkJaTmK7wTvMR4i39Bq/ xKYgcU+HbQLUA6IpbQnmnoYV+GVyDJ6q2Fjxky5+h94ONo4UZiH9vl2qjhbpnNWsDBw+ WNZWTLP5pVAnST7LwpQZrCVlurtjfp1y/egB+BLW5Tm6lRPa1sCL6ILv1XKEPU8n6o4Y QvdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o22si584011ejg.205.2020.12.02.22.32.44; Wed, 02 Dec 2020 22:33:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729691AbgLCGbK (ORCPT + 99 others); Thu, 3 Dec 2020 01:31:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:47744 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729378AbgLCGbJ (ORCPT ); Thu, 3 Dec 2020 01:31:09 -0500 From: Mike Rapoport Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: Andrew Morton Cc: Alexander Viro , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Christopher Lameter , Dan Williams , Dave Hansen , David Hildenbrand , Elena Reshetova , "H. Peter Anvin" , Ingo Molnar , James Bottomley , "Kirill A. Shutemov" , Matthew Wilcox , Mark Rutland , Mike Rapoport , Mike Rapoport , Michael Kerrisk , Palmer Dabbelt , Paul Walmsley , Peter Zijlstra , Rick Edgecombe , Roman Gushchin , Shakeel Butt , Shuah Khan , Thomas Gleixner , Tycho Andersen , Will Deacon , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-nvdimm@lists.01.org, linux-riscv@lists.infradead.org, x86@kernel.org Subject: [PATCH v14 02/10] mmap: make mlock_future_check() global Date: Thu, 3 Dec 2020 08:29:41 +0200 Message-Id: <20201203062949.5484-3-rppt@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201203062949.5484-1-rppt@kernel.org> References: <20201203062949.5484-1-rppt@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mike Rapoport It will be used by the upcoming secret memory implementation. Signed-off-by: Mike Rapoport --- mm/internal.h | 3 +++ mm/mmap.c | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index c43ccdddb0f6..ae146a260b14 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -348,6 +348,9 @@ static inline void munlock_vma_pages_all(struct vm_area_struct *vma) extern void mlock_vma_page(struct page *page); extern unsigned int munlock_vma_page(struct page *page); +extern int mlock_future_check(struct mm_struct *mm, unsigned long flags, + unsigned long len); + /* * Clear the page's PageMlocked(). This can be useful in a situation where * we want to unconditionally remove a page from the pagecache -- e.g., diff --git a/mm/mmap.c b/mm/mmap.c index 61f72b09d990..c481f088bd50 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1348,9 +1348,8 @@ static inline unsigned long round_hint_to_min(unsigned long hint) return hint; } -static inline int mlock_future_check(struct mm_struct *mm, - unsigned long flags, - unsigned long len) +int mlock_future_check(struct mm_struct *mm, unsigned long flags, + unsigned long len) { unsigned long locked, lock_limit; -- 2.28.0