Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1600396ybh; Mon, 20 Jul 2020 02:28:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYP4ek1OhcmZ1NWPHmxnoBsfT/B0ByM7AnkxwsN+QqqpQ/nl4qfRN06axyHvhjIo31JMo9 X-Received: by 2002:aa7:d446:: with SMTP id q6mr20825042edr.218.1595237301324; Mon, 20 Jul 2020 02:28:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595237301; cv=none; d=google.com; s=arc-20160816; b=CVcTAWyvT0uRTg48NhqbY+nsOKjzP9PJrJSg/6q0PS6N703gBkXskfTdsnkOJezsf3 ryXojDZuBV1t/bmCMSszsaTzz2ASEfCYmZzNuClZNr0MELzlX3V3sntOneHO8c43VSu9 qr78hm3J5B6o73fx+0OahUadA5x1kpXEo2jIOIvBzgsI6RovCgClOeL9BMmymv5sxAGP 8Af5kfE7p0H6kEAb/6+1A9IzTeUUxgBr7umLquiz0GcaqFU8seCUTd1OXIuOAbarqw5m 4wi1cUuxJ1fauKv0cCO9Ydtlo2x/3fiQxYSHYpXM2PaQw5yiRUajYrs5YEQSc5qft4Ia Vj7A== 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=g/UFcbzP+t0SZQzkNJvsjCcezJJgdfDnFTSPjDbAtwjyupCoqcG42IlauYIu77NgpG s4aDABNrdJRKKg0SvjM2GRE9crtFHYyTm6vTwAsTEP8h7HKcMvp/JrmkSkvfknSoOy1o b5qheufZH+/GPHhEQn4KU6vNpBfJL1GEeo+CyrbqJbylPiB9bRGXU6c86SWUntWcOkIt NpFeVdtt3jdQR+AJ+c9EhMJkGH1LUcOVON/9BvpYWhzKOSDyoojTWvqnW32V8Ekdztp6 eIv5HMSrD1HcuLpNczbX7nVHvSFiB002nx8GxLyUKx4RoSu0oHKRcdQ7ChT9q460I8+Q WDlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=g5qTGQIO; 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 nk4si9782455ejb.593.2020.07.20.02.27.58; Mon, 20 Jul 2020 02:28:21 -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=g5qTGQIO; 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 S1728270AbgGTJZ2 (ORCPT + 99 others); Mon, 20 Jul 2020 05:25:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:38964 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727769AbgGTJZ1 (ORCPT ); Mon, 20 Jul 2020 05:25:27 -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 738D922482; Mon, 20 Jul 2020 09:25:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595237127; bh=vyyX1LP4325hfnYgliYCjSjLjNxzM/CYe+v7FBLTqDc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g5qTGQIOWj1V9NU4yK00jz5UQP5Nt5v+OLzEYnJ2fYYF2s2RpuPHOjWCkAadxsvBt KfGvj5cZa5KE3IDq7FgOMY35cboLHnI1EYroJXHTtzwIE4rD8KANUXvfFp/YUVmUzZ gfaX0xMnS7xqZREdic3XBeaF92Yg2TjKzwFszmFw= 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 , 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 2/6] mmap: make mlock_future_check() global Date: Mon, 20 Jul 2020 12:24:31 +0300 Message-Id: <20200720092435.17469-3-rppt@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200720092435.17469-1-rppt@kernel.org> References: <20200720092435.17469-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