Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp318238pxk; Thu, 24 Sep 2020 06:31:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyA6T1zDg8pBEnLZKV5tspwHD3qmHMbp26AnewNKEFAXZ70dZrAGw9TNGwLwVJeqXB0OLAw X-Received: by 2002:a17:907:104c:: with SMTP id oy12mr1085296ejb.450.1600954299141; Thu, 24 Sep 2020 06:31:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600954299; cv=none; d=google.com; s=arc-20160816; b=wgSuDvPePe2GP1KTIzSinmgzbExQG3iXjKhBe/zSZABjrnK6CIEkDc5VQFfU6pKctJ A8BPyhJgeTMIMcormkXPz0OYjDITYl4t9muvZBJj9GDfdMcZGANwzU1ZaxF3UarZ3/dZ jNiRpmpNX/k+9FE5Bq1jC8fz+OpZEOfcEOO12V+5S0vkTpbCCRNavj89DNa53sLTGURk bqY1aeWtXJK7fbQkkmsmqnKDpALp8PMw243D2bYzMHtOl4209SJeqdXHlxm1vBPfXO1f arDTTHh+Zf5CRAhWzCpEjkPjjDmOyideuonzDJKH+j03ooFeDz4y/njVLYaOv/yo7BWq IJEA== 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 :dkim-signature; bh=wpiN46kV6iLZ5OhqFKDaltdoG76QXFZl+z7nSaDHtto=; b=0JT+eY1DpXocb4L3DiZ5iMFTILPFZ3n/VNIiCO2ubOn/SiTGVWI0ucAiYPGacBQ5u4 F5JP33MIbgG64NzY+/eo0rl4kkvhyTQm6HK2Ban36OcNeUOHgRL+19zQzcSY9+PtzWHN SHXwZaf8i9jDAtnqVZyRu9/x3n6tmFBYdZhyCrOtqGthWm4wLrYSfZegQXYfxfq1b7j1 2051ZbXVMUSfSRXysztWs3r1BYkgiYEL/Tdz15n3rbilQW1Mz6KIWeMx3QSxQIi1fNSw uyXRmNdDCHfYezFVoL3nCCGsleAxbqiWTQqtwE/4EYEZwEVimbyj095664TtBzfp8oiw x9KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Shbp+drn; 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 r28si2262598edi.80.2020.09.24.06.31.15; Thu, 24 Sep 2020 06:31:39 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=Shbp+drn; 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 S1728033AbgIXN3v (ORCPT + 99 others); Thu, 24 Sep 2020 09:29:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:50194 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727953AbgIXN3s (ORCPT ); Thu, 24 Sep 2020 09:29:48 -0400 Received: from aquarius.haifa.ibm.com (nesher1.haifa.il.ibm.com [195.110.40.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0F3FD2388A; Thu, 24 Sep 2020 13:29:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600954187; bh=myvdsYeTVwfevSA9o3DuyixsLzfxCR/KChSuKW5WQjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Shbp+drnh8fK1DrEhu+FFgWEL5AIUbfmChWyV60FkZsfcu0AT4FEU7AUf3UYgKAeJ R5WvViv9hJbvZ70DLziTV76YwaxCDIv+me+5jFiIHmT5TMEXp6z7QIQyYeEZnTT62C tv/NuMg483zu9VTItgZKwU2L/JUob669o2aEJLxM= From: Mike Rapoport 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" , Idan Yaniv , Ingo Molnar , James Bottomley , "Kirill A. Shutemov" , Matthew Wilcox , Mark Rutland , Mike Rapoport , Mike Rapoport , Michael Kerrisk , Palmer Dabbelt , Paul Walmsley , Peter Zijlstra , Thomas Gleixner , Shuah Khan , 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 v6 2/6] mmap: make mlock_future_check() global Date: Thu, 24 Sep 2020 16:29:00 +0300 Message-Id: <20200924132904.1391-3-rppt@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200924132904.1391-1-rppt@kernel.org> References: <20200924132904.1391-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 10c677655912..40544fbf49c9 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -350,6 +350,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 40248d84ad5f..190761920142 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1310,9 +1310,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