From patchwork Mon Jul 27 16:29:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 11687183 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 14633138C for ; Mon, 27 Jul 2020 16:30:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EF2672083E for ; Mon, 27 Jul 2020 16:30:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595867409; bh=i3ck5owJRi0EzoQDSEZTjtoEmjw9+HiuwoyKwgJ9tdg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=n12sTpC8mD2Q+bqwK782BIoEWEzNAQsEqB4TdPTl7Mxha+KgjXltaMXed7CG70/h/ 0K6k+ivlgSKutB3No2Mu9RjwghUS2DdDTsywrOyYSneNhE9u2T5AN9h+C76TMQBawo w1MQpvyMs790yO+adMrrcAlCIInQzwLBsiBl53QQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730939AbgG0QaF (ORCPT ); Mon, 27 Jul 2020 12:30:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:58690 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730778AbgG0QaE (ORCPT ); Mon, 27 Jul 2020 12:30:04 -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 E548F2075A; Mon, 27 Jul 2020 16:29:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595867403; bh=i3ck5owJRi0EzoQDSEZTjtoEmjw9+HiuwoyKwgJ9tdg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jYQXxt3mDojgCrkM9qOVf+6yiwFkDDov4EflZwIMMkgnm/BN9oWlS00HvA/SdRmtX bN3VmIfmqkFJTIFb3IIwfAQ5GcNm2s76hAWkkN4yuKapACBTO2PWtn1Hhe1s8bH+TZ 02+m3Goh4AYw7uT/WY+dAJ7S9qOSzd6Le8sgdhRs= 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 , 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 v2 2/7] mmap: make mlock_future_check() global Date: Mon, 27 Jul 2020 19:29:30 +0300 Message-Id: <20200727162935.31714-3-rppt@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200727162935.31714-1-rppt@kernel.org> References: <20200727162935.31714-1-rppt@kernel.org> MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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 8c7ca737a19b..ee92b7b4b185 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;