Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2403104rdb; Mon, 12 Feb 2024 04:00:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IHlGCwH/bLWtCdf0Bw8V5j7Nq9PiL97RpI1adwSQ+aqjgLlZhiti1GBfuDMOfVz5i66QGTZ X-Received: by 2002:a05:6402:1845:b0:561:b03:4bb4 with SMTP id v5-20020a056402184500b005610b034bb4mr5030815edy.5.1707739217010; Mon, 12 Feb 2024 04:00:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707739216; cv=pass; d=google.com; s=arc-20160816; b=uKvTL7HUfH+XOq2kINb45nLt3fiZ8D3Z21X71GPPZ8DHuBWPsb+TsyxzEuS/SvTTh0 aEp3S3G2me4ohzCNMJS7OT+q+AWqhbEtl7Hw7Y9aSzmcUImG2qVr/rmI9YR6sd3D8KNc tjOoiU8HKChEHpdDG3j1WEWVUrhSPgRVWBnKSy0s4GFStsxBry4UsypsBeS9kNDFQkxy 2eNJLsxvTotA+Yfi1DNDV8I+eJAXXSHyT8FBiba1YRRIpA1Kg4r3Ly7fIVaq+G92HERq F0QNhJIuVvlAGlpLNQuZk8Hk57jISL9obrIyR0BJf48F6JuO+57wG/ypveC7ZdKLe1rs kdSA== 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=ocDV0xt8N038gP+DLg6dR5T/0PL4+pEI/kg00OQd02E=; fh=G/rcPYTQvq+LRAowgUkT0mOVAjmrZfunUXWgHx0q3JE=; b=hY5gfvUdkoLpt82ewagJV2zHzalQrCRIFR2ZVvFaARCGuFl+0dLT+C5xKzoGZ/lEmQ HCM71ll2/DkEZIvLJaXLTW/kMDCUCmiHeCsRAnyD2AH2PdAOTOtx4MYmw35E24P6rT2/ axaQQxbbRogsx6JkFq8q/de8o/MZOTj8+VDGzAuhjuo7RQ44qwI+lMQOAAAo5cD+gva1 rZvBvSwS68rBXBCKdlG2Jf2NGJZxCQ1Mk8cxBYMkZjjZRCTNGqFq1gHfOfVWk/Kc+biJ OXIc+yFWe1ncHG00xj+X+mFJTX48fMrykxCuaA5zmAq6pSMr2LTvTwBpKYtw3bV/nQJ4 Pmgg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=IZJmx41s; 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-61487-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61487-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com X-Forwarded-Encrypted: i=2; AJvYcCVAw+YOWiHgNO0g1oiiTToK89+rl3y6bsRHvkEBkeCW9Ha0hSUQA/ACVhh+wm0q+oDU7cAx5SlsXGAUVngBkKItkGikPPlsxYwBzhQa6A== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ch7-20020a0564021bc700b005610204ec91si2555796edb.651.2024.02.12.04.00.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 04:00:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61487-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=IZJmx41s; 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-61487-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61487-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 am.mirrors.kernel.org (Postfix) with ESMTPS id B48041F21FF2 for ; Mon, 12 Feb 2024 12:00:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8EE1A3D579; Mon, 12 Feb 2024 11:55:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="IZJmx41s" Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (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 D62863B796 for ; Mon, 12 Feb 2024 11:55:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707738943; cv=none; b=Y8s6Xz8QS1mz2B5A9oSybxP8msJ6VLjQBQVslGVbgfg7AUpIQF7ve4RMr/Wiy/HMC0Diyksc71MySAuAwhzqIxJIKHCBjOuaOGkSXpHo+RgvzRhWJMjw4ppOScwpVLfC+xVnBX/h7e+ulz1hh3Zayi1+pmd1BkjxCm/FVnnj6rE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707738943; c=relaxed/simple; bh=k0CWYvaaB/gYg4+a4TXJ9LeyRASwAqQNiIxSmINjJE8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=EhjeUd1znelsfbQduBXl4iBwubZp2QZNKgbe1/jc8T+xXlfLHHgpEExbmSk6rWuYjaHCXDMyZEM+VGzMPjvLXWAMM6y7hFO7XOUZp3AoH5kM3AlpV2aZtTOmpIZ8AxJd5WeZ9Du/iUwcn+c/dgGq1bEe9ns2XAdqfdccdh9t6ig= 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=IZJmx41s; arc=none smtp.client-ip=209.85.218.45 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-f45.google.com with SMTP id a640c23a62f3a-a26fa294e56so418849166b.0 for ; Mon, 12 Feb 2024 03:55:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1707738939; x=1708343739; 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=ocDV0xt8N038gP+DLg6dR5T/0PL4+pEI/kg00OQd02E=; b=IZJmx41sQB5e85MUhmyaPgaaKJ3MKSfH3br843ZYr4Bnvbuoar6+gGCwEMo1Y4WOq7 9wF7raaxCnybVi5aIiSbPm1C8sNtAu++rLq0CZQ2c9QeH+SrIIwaT+Rvqb25xpgJJKfE B+KIllN3nqvSpRsR5S071nSXq8a3WA01m3KG4H4f9p0Bt6D7tmHgnpkkhAVLCUFh8ZWx lQwATZYUBuPCx6GEfYwIZy+vALaXjmArT46Z9MW0O1InTGZJgwKlNx3PQ30TdyIqEA+B IILGXGOX8YgcwJNHlbLkG94IxOH4swpZOOA1qLvl+TgH/hALB6nAu5sBxwqb158YLFi5 PN6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707738939; x=1708343739; 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=ocDV0xt8N038gP+DLg6dR5T/0PL4+pEI/kg00OQd02E=; b=qS/i0b+tnrbjpFzSv2nhC6/4SM1l7xEPlYJdqhNVsJHCJBp9L8RQlPi7oLdCBinnZX 86DW+o7NcAZHd8jR/Le0NeWu+EOHURMaTuZE9jQRpCUrKeWkvWMZPbkFDqbv38EWXXLU JSAO4tqX/1uDLOlUhCxSvdBKJh5TV1uUDdZ4mhB2WNO0wFmMX6OiER4rvRmb0pWGH18Z L3zH3ipUm/A4DxSEcXFZhb2IzhtiRWUsnMEw6WJJa7S5ZvgffTHpSJDx369meuVc9IV7 mqrnGc0PQBT2Sat6mxPotG9FcafDE9ERyVhIY3EoRRJZ3PlmgsoGOPBLvmoTVvzHwInm rBow== X-Gm-Message-State: AOJu0YzO+LDXhFUIX6jfcWpUYGPKPdRpbNAP+Oqi6rG5SA05I13xD/84 HFRB2UBw80x39RW24YOeHlzBrh0ZUmOVWpX8p9VK6EGcV+hGj16ZucPEB/w8vCVFTJKG/GO1dit n X-Received: by 2002:a17:906:d10e:b0:a3c:caf8:9f8f with SMTP id b14-20020a170906d10e00b00a3ccaf89f8fmr813966ejz.61.1707738938950; Mon, 12 Feb 2024 03:55:38 -0800 (PST) Received: from raven.blarg.de (p200300dc6f267100023064fffe740809.dip0.t-ipconnect.de. [2003:dc:6f26:7100:230:64ff:fe74:809]) by smtp.gmail.com with ESMTPSA id m1-20020a17090607c100b00a36c3e2e52dsm139203ejc.61.2024.02.12.03.55.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 03:55:38 -0800 (PST) From: Max Kellermann To: linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v5 26/35] percpu-rwsem.h: move declarations to percpu-rwsem_types.h Date: Mon, 12 Feb 2024 12:54:51 +0100 Message-Id: <20240212115500.2078463-27-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240212115500.2078463-1-max.kellermann@ionos.com> References: <20240212115500.2078463-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 By providing declarations in a lean header, we can reduce header dependencies. Signed-off-by: Max Kellermann --- include/linux/cgroup-defs.h | 2 +- include/linux/percpu-rwsem.h | 15 +-------------- include/linux/percpu-rwsem_types.h | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 15 deletions(-) create mode 100644 include/linux/percpu-rwsem_types.h diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h index 878deefba0e1..691c50aeafae 100644 --- a/include/linux/cgroup-defs.h +++ b/include/linux/cgroup-defs.h @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/linux/percpu-rwsem.h b/include/linux/percpu-rwsem.h index 36b942b67b7d..0f427bd5217a 100644 --- a/include/linux/percpu-rwsem.h +++ b/include/linux/percpu-rwsem.h @@ -2,24 +2,11 @@ #ifndef _LINUX_PERCPU_RWSEM_H #define _LINUX_PERCPU_RWSEM_H +#include #include #include -#include -#include -#include #include -struct percpu_rw_semaphore { - struct rcu_sync rss; - unsigned int __percpu *read_count; - struct rcuwait writer; - wait_queue_head_t waiters; - atomic_t block; -#ifdef CONFIG_DEBUG_LOCK_ALLOC - struct lockdep_map dep_map; -#endif -}; - #ifdef CONFIG_DEBUG_LOCK_ALLOC #define __PERCPU_RWSEM_DEP_MAP_INIT(lockname) .dep_map = { .name = #lockname }, #else diff --git a/include/linux/percpu-rwsem_types.h b/include/linux/percpu-rwsem_types.h new file mode 100644 index 000000000000..0716d08b758b --- /dev/null +++ b/include/linux/percpu-rwsem_types.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_PERCPU_RWSEM_TYPES_H +#define _LINUX_PERCPU_RWSEM_TYPES_H + +#include +#include +#include +#include +#ifdef CONFIG_DEBUG_LOCK_ALLOC +#include +#endif + +struct percpu_rw_semaphore { + struct rcu_sync rss; + unsigned int __percpu *read_count; + struct rcuwait writer; + wait_queue_head_t waiters; + atomic_t block; +#ifdef CONFIG_DEBUG_LOCK_ALLOC + struct lockdep_map dep_map; +#endif +}; + +#endif -- 2.39.2