Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp180235pxa; Tue, 4 Aug 2020 02:51:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxq9P3ODFhVedAtP0OO7FrVi3ogfy5IKvnvNQLPjBtp0vE8l84pVSpgFQkAP+w+tyijmqS7 X-Received: by 2002:a17:906:95d4:: with SMTP id n20mr21692556ejy.485.1596534712457; Tue, 04 Aug 2020 02:51:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596534712; cv=none; d=google.com; s=arc-20160816; b=BFwIzoZfx3BGZroJxaG8sTki/rHBIcHhfIYjxyS31mmAjJQqcB0TFH8hrHIdFAT5Kn APVeBF/7YEjxPGU75lePSvioVGcL23Hr7HlxNuUGh2nKc6Aa2Mv5f8T6nG97OTN5gFxe KI/9fO7taV2a8jkXlPcIOcqqcKCEils/NdWF9lRGMwPDLWBeqGqn5iv1D7dzidSoM1PN R1Oe+u93GLusEh5GSvGOgA0zAsFhw3p8B1ohGMGm1D2u3h0aXJvqedvIXhBXi4heZTG3 WX+xtgYQVqzoNLlg2cMJbR0NsxoQ6keGO5tale4DRjXLNYw9AwGKDz3wjjpBW6snvLHA 9BDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Dllpe5O4jzCPoK5E+anC2oS6Av7Muju9Jgzfx5I8hXs=; b=eXMqhIA0YqTBtlGSUDaA5EhuItEYEZyHZxjG+P3EmbxkYFDi1FLB7JDT3EQNa3lgNQ aiOt9DHKHAfv/e8ys7ksMwBrgbSHlBiH1+5AGE44B9nLOPjZ/iJMFT/OEs/rTHYdF8Rk u6KIiphmMBHcN/O4PAyNPfyWdnYPMr+mQWTXzVWdZytxZO3QS81G892gNIELLqkDXTcS 1A/adJXRwobJGhhNnfkGT5pgBtPNAI45pX6MKmoVuS0wXY50srjxTAmGKi1qILW9BEdj bZy3+9tdjCwPrmMnF1iBktjMS3waCzR81j8WFJ4NwPorxcfm6+1Lg/+vMc1K0O6vnvBX daEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gPcJFTGB; 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 bv14si1134026ejb.249.2020.08.04.02.51.29; Tue, 04 Aug 2020 02:51:52 -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=gPcJFTGB; 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 S1729673AbgHDJvI (ORCPT + 99 others); Tue, 4 Aug 2020 05:51:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:45886 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729032AbgHDJvH (ORCPT ); Tue, 4 Aug 2020 05:51:07 -0400 Received: from aquarius.haifa.ibm.com (nesher1.haifa.il.ibm.com [195.110.40.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4EF2B22B40; Tue, 4 Aug 2020 09:50:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596534666; bh=vyyX1LP4325hfnYgliYCjSjLjNxzM/CYe+v7FBLTqDc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gPcJFTGBdcSo7DYfuAeKCt8HfW4DNdvAb4vfmr0YecDhf2FOFp+S1oTaJs9dfb+KC kkNKGdTLhePIw+eLMVci+QkBZ5NJ6RtynqDxIL4D3UbhhGID/Z4UW6yW5sOtNpsJDN J2xMyFEGi0cbT/pK0v/yLK+WQtaMB6FLIU6HCX68= From: Mike Rapoport To: linux-kernel@vger.kernel.org Cc: Alexander Viro , Andrew Morton , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Christopher Lameter , Dan Williams , Dave Hansen , 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 , 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-nvdimm@lists.01.org, linux-riscv@lists.infradead.org, x86@kernel.org Subject: [PATCH v3 2/6] mmap: make mlock_future_check() global Date: Tue, 4 Aug 2020 12:50:31 +0300 Message-Id: <20200804095035.18778-3-rppt@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200804095035.18778-1-rppt@kernel.org> References: <20200804095035.18778-1-rppt@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org 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 9886db20d94f..af0a92f8f6bc 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -349,6 +349,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 59a4682ebf3f..4dd40a4fedfb 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.26.2