Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp162594pxk; Wed, 16 Sep 2020 00:39:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzi8P5zJ/yi4laTddaXKSjCBQnK3gISArWMXA6W0tV0X//LFWbYoyUrlCDACyH530q15+2r X-Received: by 2002:aa7:d6c6:: with SMTP id x6mr26448182edr.338.1600241968046; Wed, 16 Sep 2020 00:39:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600241968; cv=none; d=google.com; s=arc-20160816; b=jO9MoVFzzHLu7dnO7OXdABFZcqwJE3FTv8hZd//cYtg1OcvG7nfoGCGr2kuluHpEMb 5Ki2DRd7DLmK8R5dTTtoNWLqv0dYaL6aWTNDM96wz6s1BwocY03iR2gVXnx67EJoxjqQ /mqKUUTMUhLhwuHFXZRLe0DJtvTMA7yP4mS8Bu/9SG707RrwrvKrBhWNTmn5s+/Y39D3 bbANYsdT8cL1L7Ps2tjWuDIQJn2D8GruHP1iwH6jCCQMKt+42q1pUpi2pkgv9VGvJaev esjEduJ/UF9UobUz5+4ABw+gUlK50BowL5lZBiHy2J608oTVn0eeg0Iu8lHQDCmiwUF0 GRcA== 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=wpiN46kV6iLZ5OhqFKDaltdoG76QXFZl+z7nSaDHtto=; b=FFE/htyVHWhLCv/q2bcxSGIDWoegus0H/2P4a2fMMzYqdG4pQT4YXxe/O4B7QAc/rY TZWzbz/oOAKDFV1c/Epa1wbAeW60u45WMs4Ap12xgDg5tcJZP/TkzDIX2D2n3BJ6++Gg aYGt31QUe0x4imMEthrZsbetPgBP3RKfA4xebdeTEl6MX67UZq2BQLQ5pSSimZJlhsRU HoDfsqJ1s53VU9yNXSFmNJGlGwIEfnlKPuK0Rim02fD+JZkOQJ0j/EeQLPnqVEFT8pBs YHiOr1lIMUH+SMyJQ2Qru//r7cqZCn+OkBZg2hifFxKL/4U9n0+ZRwgR8PVA7bab3KtY fqKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=R0SOTHNC; 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 j18si10649119ejb.50.2020.09.16.00.39.05; Wed, 16 Sep 2020 00:39:28 -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=R0SOTHNC; 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 S1726448AbgIPHgQ (ORCPT + 99 others); Wed, 16 Sep 2020 03:36:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:59050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726139AbgIPHgN (ORCPT ); Wed, 16 Sep 2020 03:36:13 -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 A30DC21D1B; Wed, 16 Sep 2020 07:36:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600241772; bh=myvdsYeTVwfevSA9o3DuyixsLzfxCR/KChSuKW5WQjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R0SOTHNCE0m6BH0/ZaBpzddz5BwXTJmu2prbD7R0pgGNmfNd3d8jZFVDCn+X0CY8f EzsD0svKFO2rYc1nH0gRXZuNfM6SPVdaOdDs5t7uyLxWSZd01L33sWUQF0nSDBvlTw vsCZF6Evbl7MSzrx2fX1V0GNfKJ8KE5TOHpyH0+U= 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 , 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-nvdimm@lists.01.org, linux-riscv@lists.infradead.org, x86@kernel.org Subject: [PATCH v5 2/5] mmap: make mlock_future_check() global Date: Wed, 16 Sep 2020 10:35:36 +0300 Message-Id: <20200916073539.3552-3-rppt@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200916073539.3552-1-rppt@kernel.org> References: <20200916073539.3552-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 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