Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1937740rdb; Sun, 11 Feb 2024 04:35:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IGfh2F/wlqN1uATva5djGPZg3/REBx2YkcpNTZqvX4O1kg1ANvryZQxcnevn2qB9yTxKtTC X-Received: by 2002:a05:6358:d093:b0:178:67dc:aba8 with SMTP id jc19-20020a056358d09300b0017867dcaba8mr5453557rwb.17.1707654945636; Sun, 11 Feb 2024 04:35:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707654945; cv=pass; d=google.com; s=arc-20160816; b=s/caf89Zxw7kEyy3L4vWxJ8zBzsMy77oYKAVPgFIa37rGe6KEbkXUD/5SM8WqNPbS1 be8PkeSppJqOM9mOuvmG3qAHdKobgmUQEQb0XOPYmFcbO1lRmVyz/DigR5WsPfYnt9D9 JZJyCvqfcr4pjV4qaDh/rdbO1aAJBwyrgxF3EvHjSp5iS2lgbNuFKW6JZchtO9hVXFrL /bogo9I5t7aD0wsx4YYF9kKd8qxl/rsxNqkzLTkaO3XoyXVOma66zbadhEf8+Gz4+k/O egb9SbKWC7PZllelg5oKIZNMlMsnw5MonrSHKRwGgonPtqRSidn2jqsoxnUKgPf+7Tyi GYAQ== 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=z4wqSfAZzWezWPdpkfwgI0R90y1UdKgZAi+HJFlIaiA=; b=HgVLcSyO5TAISPEB0bkMpGi13t/RIcwy4HAlPaNE5Yj/cEeu0QcATWIrrgHSmmB/CH yE91PdkWJViRPQO+q7tyecjTlO655j8kJfBbDHf7No0SouQUZrZuB/STbdxU73ZKFeKS wrkVGy/z8KgG5GDuU72ibXnNN/7Yj/UHvWWc4h6+dB/4hLR7yh3JaACWjx6sAuVKlpUB oxVdC4K9ef9yWzxXAAB94qfvqDIp1prNtuHYGH48Hkq2SPCYOkZf7Jhzs8K8u9giux+J 08k/eOS+2CALPMcV1DFspH5nl5qz5ELzDjXupw9cxnonsB/8/yZCcIwQR0Nr24+/sN+S 2KgA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=f6ZYB5xE; 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-60755-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60755-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; AJvYcCXQLN5hvbNUetllnYqKA0k6pZYXyfj/POXxwgqiQ/K74vvW9IIiCdjs7qGAa2JHBt8vgWxQwPCFKBoP28kb71edxzMy8nU0GYvQqtATnQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id st8-20020a17090b1fc800b00296f86d4ffbsi4799981pjb.90.2024.02.11.04.35.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 04:35:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60755-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=f6ZYB5xE; 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-60755-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60755-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 49A28280DAA for ; Sun, 11 Feb 2024 12:35:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 82CB260270; Sun, 11 Feb 2024 12:30:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="f6ZYB5xE" Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (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 0622A5F49E for ; Sun, 11 Feb 2024 12:30:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707654646; cv=none; b=kz5vHA3w3kbBt7CpqSwVLto+Dpj/KDtFGK27TGbKKzcuq3g7LacgXGvGcE4+Pq8VU7VWWq4Kiy8o4VT8Kefh3wGUTPNR5ANiJQckkQOFLiJKocWPyzdGSVwAfhAr30RdGavVK157LWEq4xFMS3wZ3SWFjJKbFDNA4s4yN3pXazE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707654646; c=relaxed/simple; bh=k0CWYvaaB/gYg4+a4TXJ9LeyRASwAqQNiIxSmINjJE8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kSM6d0JV/n2Iyz97Ou2NlyWDuQ1KCwzZM8LevKNkptrZxc083mtE1XTZoiwi1pkaK8YlzE/dKg3weUMRYh731Y/FKQwttdvjK0G7hru8F/GOJ2BKboDrpF8LeI7PEOW8UO9aVGuchrJpJAoNu+2u6stbToc28ePTd6aLoK/K/Ns= 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=f6ZYB5xE; arc=none smtp.client-ip=209.85.208.53 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-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-5610cc8cc1aso2398749a12.1 for ; Sun, 11 Feb 2024 04:30:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1707654640; x=1708259440; 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=f6ZYB5xE0VNf0k0hJMmX/jaIUNR7+6Lvo6P8SZ9aveFmBRpsOubfcyO216wwh+zvk0 DjPcM6Ev0r7pkyoxR40Rfm3dG5u+ZCuxByNP+LhLKrxhFiVz8IvZQsKIAkn/VBvoWgzM blVGAjGXaOlPQOU7T9btTKRQmxfY6QR3GeXDR7LcZFsP87/ibinjzMW6N8+kBO6CkHDR 9HXQvW6IlST5edxuodGSb76gGhKFxZuA1jwUlZhL20GvzD18tWfiT0VwkIbE/OKyHUru 5QMF/hWu8xRRvnJ5dXobr6/ggoFgTKG+Tx1QHAEQr0bN+Di3JwSp3MFkIacsIs/1U191 WeUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707654640; x=1708259440; 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=LZdyFFIVu6OQcAeC+nbdfUZw7YW1LGVHmmRFgJHq2USnO/qzprY8opF59McN0zNDcs GjS0G1Cr+6S9CMb2BSQA+TaJXPE63AKbkQO3H6AS+QEJCJv4rwbwldXTVSf9jNaQzeo/ Z3kq6SJmx8IFaVBvi2TuOw9+cDczkWRwWeBd5qOUw+WS0c3JmqsTmLpmMIS4+4XAVjKK tKtfWj62sfuFPvXKQ/AxufVFLihfG5Y+1ZPQ2JAs3ByzJlOvOTH/aiLYMorNea+VCUZh lHadddzcDpiHZl0kaoFoCen0vzQM6Qmc3PLhY6Ez17xMfYGWAAoRORRAtgpRByBXOKEP kyKg== X-Gm-Message-State: AOJu0YyArOLhkMflyoOwUNlTRKZLHX3GnaixNfoAk+KFHTlW9MO8ZMhb lhyJ0WbafTOa81Ml8h/cVsBRi0jeJaeTDWBF/ov6qi5rMxrBmM5ruudXFXC9kDypcChy2bz4qD0 b X-Received: by 2002:a05:6402:128e:b0:561:2f3b:7221 with SMTP id w14-20020a056402128e00b005612f3b7221mr2438701edv.18.1707654640647; Sun, 11 Feb 2024 04:30:40 -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 fj18-20020a0564022b9200b0056187ca4120sm1024611edb.10.2024.02.11.04.30.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 04:30:40 -0800 (PST) From: Max Kellermann To: linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v3 26/35] percpu-rwsem.h: move declarations to percpu-rwsem_types.h Date: Sun, 11 Feb 2024 13:29:51 +0100 Message-Id: <20240211123000.3359365-27-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240211123000.3359365-1-max.kellermann@ionos.com> References: <20240211123000.3359365-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