Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp531838rdb; Thu, 15 Feb 2024 07:32:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVoAVItJcbJ4IRSdxCAYj03HsJXZ/coVWF12ivo1SNW2ahKQT07SJZDblTGCd+603RmFMwm6Z+2CyytFXkefJmekkEEnT1gBsTiwmxTVA== X-Google-Smtp-Source: AGHT+IHlRls1D60iJb94qyZhujEOs0n/wqpHL69uxtw9e5ujRbSXl+aGfj2A4smaCV5GIKJF/y+T X-Received: by 2002:a17:90b:302:b0:298:ba30:789b with SMTP id ay2-20020a17090b030200b00298ba30789bmr2017719pjb.32.1708011179602; Thu, 15 Feb 2024 07:32:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708011179; cv=pass; d=google.com; s=arc-20160816; b=xcmiZVRbZ0NBs+25XGeeDoJm0q/a60NgtyDmECZi1yiZEWyW/weqA2VNlirF8mRTnn 5DGiexleecZzbbCR0qps6dwqvElWQzr27wV+70tv1cvxBKkSW/8RRsZNYRa5oL1EHpHB 2DBrdM09fQaItIyCVd7LeDCmdL1cHwgp4bg3OpuCbOelA6kxd3w2ES3DyCCD0Ov7zB6k xnTqfd1auKhl1bFczEDytELdD3i8nW4YddTNsuJBmX82St40rzqMG50G7g1lQ5O+XxzL Idc++QCFO2qlY/liPnFFwh/1Gbtu17/3BpexMEK8q2M3rfTt82UBVl/kXY7QxYF9yUzD bB6g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=hDi3zk+Z/SLj4QVGPle17xDH/MSBW8emaxfc34uAZG8=; fh=S5cvOgQaQ4GwWcOAJsYk0YpoRIWoJXal2AFEd1Nqfc8=; b=apiput//GZDe7UpOJ/KbtOIpYck2rEUh9V7X8dKELVyVweusb2MFMcNXVMBBpPvhGe 4VapipTDIru8yf2k7roDKyz/3LTEz8ZeNXm0fPrNcSD3qM7a8H4TaYHwHI/RYYrtSPZt KDXve+2l3OHOwWmg66GprBZJg3IU3cXZfPck26tqMQuCAC0HgxgXUf9MpnMylw+MK++X 9fJN5GEwGEmj/JNoa1dqzddhQk7xD1btd0g3QyMf9SdnHAYoGLrjyDawTjsI2Q5BOb0V lyJRF8Man/8ZR3uzPqtU1pAFQS8w6rry5yKKCyMdmCgb0yABmX3lJCoWf+Ynyznp2Lgy eQug==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b="Rm/Nobin"; arc=pass (i=1 spf=pass spfdomain=ionos.com dkim=pass dkdomain=ionos.com dmarc=pass fromdomain=ionos.com); spf=pass (google.com: domain of linux-kernel+bounces-67123-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67123-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d7-20020a17090a498700b0029692a93e67si3143677pjh.64.2024.02.15.07.32.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 07:32:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67123-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b="Rm/Nobin"; arc=pass (i=1 spf=pass spfdomain=ionos.com dkim=pass dkdomain=ionos.com dmarc=pass fromdomain=ionos.com); spf=pass (google.com: domain of linux-kernel+bounces-67123-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67123-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id EBCECB2757A for ; Thu, 15 Feb 2024 14:59:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BD65C134CE4; Thu, 15 Feb 2024 14:56:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="Rm/Nobin" Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 87E181339BE for ; Thu, 15 Feb 2024 14:56:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708008986; cv=none; b=H1oQKQpPNkqbpri3vTUPts6TqLD6/BOHUZbDdnuDkA++n6Qme/pTNyF7yUWiREJohQBeuZo7BDjhs8LtNAwMhtvTUbmzfosfP9TLOuY6shG8R9hLf+2pXfqB7YFFUdWgWkwaGPmIITZ6frVeJ8t27srXyq3iaKOgC+MFfe11/6o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708008986; c=relaxed/simple; bh=v9cPlxD645ETqqwrU2mneRRT1GLcfGc/VwKe6UrwJKg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ltvev8WHJz1MwmRVH0vqpvz0DTIqxD/mN777MzKuYKBIaT3Z7s5MXjWxh3TJUIxc1XB29ZrobMvEDjZWQ5ekcYJgjq0KBUIWxfwneA5PU5c+xCOFXEzXZzC+v0DLZT0wbNpF4F5nQ3U6Hs1e+GXBHRyf+f1gFxJ+e0/vvsP20Kc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ionos.com; spf=pass smtp.mailfrom=ionos.com; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b=Rm/Nobin; arc=none smtp.client-ip=209.85.218.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ionos.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ionos.com Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-a3832ef7726so123247466b.0 for ; Thu, 15 Feb 2024 06:56:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1708008982; x=1708613782; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hDi3zk+Z/SLj4QVGPle17xDH/MSBW8emaxfc34uAZG8=; b=Rm/Nobinc4rClo55Tp8XMgLCiLCZADV/QiPhWLiFYDZY5w3zhWuEPklPLGsZ73CbMS /36YfFuh0oq1dFg7k+bsAOe4wQtAVXfjYoZaGCCJhOCfE0SA2ejw4PcIuaxubql9MIDt qGP/U6I6qhtl0UQM8Hha2hpzX/WmwjSrxbvDW0Y8H0LMtwjbbyr/367PQ6k4HftV4Yp/ GxUUTgwMdYjyM9xjuCjYg2bH9V3QIH2x7dNe6T5JhAr8KBvWPg31Vb9rNofdzA3gZaMu O3axoPCGxj14F3S8z3RxfKDyVhq7tRinfCTsr5Ee1X+dxzdoj1KLAMl+ck5F+oyoxcmr Wrow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708008982; x=1708613782; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hDi3zk+Z/SLj4QVGPle17xDH/MSBW8emaxfc34uAZG8=; b=BqktQWosVnA1tBAWhzHP9mU5WFOeGg9RR4T+Lypfunfa5TBvxetroAL3yFmPZbrujS IWAPhw/12gYaDRSH8t1bPLB6d01CR1APdlMZID7rc0t+IP3J/U1FcuK+YyCUdhU/YEdZ CKWUTt+PtBP4TfbSbwJqS3GcBD8dvXf3bxNEpFtItQfOzC3Mc592sNKa8lGKQ51kkbTu 5pNIGT5V3AvszQb8JWGfHfX4QyBzJUGbOTIzeY83TvPFxsS+HKzp+bCZzBNT2rm+1pub BXzJKoF1MPp3dEza4x74mRk0QejRw6qvWhDTmTqAiVngb8VbDh91wl4jSF7m9Ndjjet9 Jl7Q== X-Forwarded-Encrypted: i=1; AJvYcCViZxQZuYjXyBLazkXZc+onHB8nxG1zRMwaZ+V4qnJglokyuyVVbJDJDq6fsQgI6blacPsMlPZ2Jq8yNJL/Rb0XQxLfStGwRoXKzI15 X-Gm-Message-State: AOJu0YwB3cG+1Vk7bJRLpa1ujgywPjLPm3Ez67N9IX1N6IyGz6JiKo0r l/O7Sa8urVp7RBVp/XzuLbvUnOtwHpPweQaRCZ/SM2gB71686swwkNOGdddG/SI= X-Received: by 2002:a17:906:5fc5:b0:a38:7171:e832 with SMTP id k5-20020a1709065fc500b00a387171e832mr1267787ejv.32.1708008982697; Thu, 15 Feb 2024 06:56:22 -0800 (PST) Received: from raven.intern.cm-ag (p200300dc6f267100023064fffe740809.dip0.t-ipconnect.de. [2003:dc:6f26:7100:230:64ff:fe74:809]) by smtp.gmail.com with ESMTPSA id s18-20020a170906169200b00a3d1897ab68sm631175ejd.113.2024.02.15.06.56.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:56:22 -0800 (PST) From: Max Kellermann To: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v1 12/14] linux/mm.h: move is_vmalloc_addr() to mm/vmalloc_addr.h Date: Thu, 15 Feb 2024 15:56:00 +0100 Message-Id: <20240215145602.1371274-13-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215145602.1371274-1-max.kellermann@ionos.com> References: <20240215145602.1371274-1-max.kellermann@ionos.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Prepare to reduce dependencies in linux/mm.h. Signed-off-by: Max Kellermann --- include/linux/mm.h | 25 +------------------------ include/linux/mm/vmalloc_addr.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 24 deletions(-) create mode 100644 include/linux/mm/vmalloc_addr.h diff --git a/include/linux/mm.h b/include/linux/mm.h index c7e53cd0cdd0..d4624940923f 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -1067,30 +1068,6 @@ enum { int region_intersects(resource_size_t offset, size_t size, unsigned long flags, unsigned long desc); -/* Support for virtually mapped pages */ -struct page *vmalloc_to_page(const void *addr); -unsigned long vmalloc_to_pfn(const void *addr); - -/* - * Determine if an address is within the vmalloc range - * - * On nommu, vmalloc/vfree wrap through kmalloc/kfree directly, so there - * is no special casing required. - */ -#ifdef CONFIG_MMU -extern bool is_vmalloc_addr(const void *x); -extern int is_vmalloc_or_module_addr(const void *x); -#else -static inline bool is_vmalloc_addr(const void *x) -{ - return false; -} -static inline int is_vmalloc_or_module_addr(const void *x) -{ - return 0; -} -#endif - /* * How many times the entire folio is mapped as a single unit (eg by a * PMD or PUD entry). This is probably not what you want, except for diff --git a/include/linux/mm/vmalloc_addr.h b/include/linux/mm/vmalloc_addr.h new file mode 100644 index 000000000000..86ad2dc94960 --- /dev/null +++ b/include/linux/mm/vmalloc_addr.h @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_MM_VMALLOC_ADDR_H +#define _LINUX_MM_VMALLOC_ADDR_H + +#include // for bool + +struct page; + +/* Support for virtually mapped pages */ +struct page *vmalloc_to_page(const void *addr); +unsigned long vmalloc_to_pfn(const void *addr); + +/* + * Determine if an address is within the vmalloc range + * + * On nommu, vmalloc/vfree wrap through kmalloc/kfree directly, so there + * is no special casing required. + */ +#ifdef CONFIG_MMU +extern bool is_vmalloc_addr(const void *x); +extern int is_vmalloc_or_module_addr(const void *x); +#else +static inline bool is_vmalloc_addr(const void *x) +{ + return false; +} +static inline int is_vmalloc_or_module_addr(const void *x) +{ + return 0; +} +#endif + +#endif /* _LINUX_MM_VMALLOC_ADDR_H */ -- 2.39.2