Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1937702rdb; Sun, 11 Feb 2024 04:35:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IHArdHkr3uj/UAaqim3W8/zzyO6jrsEVXqdPjgMkXZoJa6VgG/9BShbeEdKuOG9DBrn1og8 X-Received: by 2002:a17:906:119b:b0:a3b:e8f3:25d with SMTP id n27-20020a170906119b00b00a3be8f3025dmr2447017eja.75.1707654940091; Sun, 11 Feb 2024 04:35:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707654940; cv=pass; d=google.com; s=arc-20160816; b=M5pGxhyy5InKm3AH4Cu5uSJRa44UPiCPDLCfClIMyAvlziCVmxwWv2pN7acl05ns98 4bgSCf8j2CehWc3qkUyjLIX8bI8djUORl4CR7f3hnwWxxDGvLrMzanRbp4mB0K7O/m8e pC+tRjWhxLiIJqEdl7MWyMKi8M1ZLDSGLbdIlD+xC+otRthhDhMiaKSS/JKc8m454dcJ 0KfSXc54fKdxbc6WNQrxAhfv9RDrEFI6qIwXTQcVoEC5CSX3Fg6CBYza8Wyd+/UHTp9Q fxtshcKjyjH6vNHQOdnbYqTxfM2+Pad8w7QzydUgeFmfroTyJPGQ7P1CdpGcnW+rK4H6 Uz6Q== 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=XATNuKhlyKBqSR95XEzaIUlSWNysrBVPmJ96j3W9lpU=; fh=TRK8kqcWfm/Nm8BdG/KSLS5ZYuAiZiKsHAr40HfaqSQ=; b=BUtKIIeR1tSE/XW6WDiB80B3B8tcUHWsNSu3HsiEVbgaLfiouUYR9r1ew6uqsCYwwo Jf5nteRkRCJagdSkK/KmfXvbAmm3kNar44fZaHtwGNEuAmcofpltcBs7M7/CRPihuKiw BlHU8CK/PpfkEE/qApzt2C9nh+fhEq4jE2LuQcwGgMAcHTz0Yx41V/6AjkLqdoUGoYJt q6cpH0Cb2l6kRlaJxWVsTcr0Ne7e0afUR0+VkkekhSz0ufMKaPEJ2ApXkZP7SUXlbCqy R8xsfrlFOCOB3J7SXaFC6fDjMP7yAT2hGqzzrV1opA88k6101WcTK9aM5kT1k9VEeELQ vVaA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=dBvMTNVW; 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-60754-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60754-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; AJvYcCVuhldEW1qwUFxaj3NrPxIocd31/nykNRIe3Emn+CnfftYhFU5iao9oD7upIDsiFwYNB/f6Rd4FY/K9qqspRuELek1TXPjthxJVIzO7IA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gy25-20020a170906f25900b00a379d8d3356si2748208ejb.818.2024.02.11.04.35.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 04:35:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60754-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=dBvMTNVW; 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-60754-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60754-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 CE6A91F211A1 for ; Sun, 11 Feb 2024 12:35:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F249D6025D; Sun, 11 Feb 2024 12:30:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="dBvMTNVW" Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (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 EABEC5DF21 for ; Sun, 11 Feb 2024 12:30:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707654645; cv=none; b=RMZEoGpLAZNCWnyqTn87cjoGzelsnipNTzocTlctyA507DTC+IlcioPNKKNDOerriZ8vs54F5ICn66HiRy0nY7g5a67ovHUhOrSxGwCAKwbjWZ+EFrdM/9fjQkUb/wAiNB/GFCxqPA20AXfnK5MF4lu4O72VldjVetQWeR297Jk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707654645; c=relaxed/simple; bh=VSrPFDVdzLC5KglvVyGoKnESxlS/kGrz7MitlkFgb3M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ATOtMuga7lUGlfeNZDD9/HH9w4hACQJ4Dsbpi9ttA5TzvEreEmbbF4xdLHDaO3rhCXptfj9sGlexT9FzCuHQsYemrvwF+hy9m9gZ3zszWMnAnRLnhN+5RxmsVFYM7ROU6reV4JuLhUkJbwln0tFevBe3kj1Zr18czscRElZOpKU= 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=dBvMTNVW; arc=none smtp.client-ip=209.85.208.178 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-lj1-f178.google.com with SMTP id 38308e7fff4ca-2d0a96bad85so34356751fa.1 for ; Sun, 11 Feb 2024 04:30:41 -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=XATNuKhlyKBqSR95XEzaIUlSWNysrBVPmJ96j3W9lpU=; b=dBvMTNVWMJaGqJ9qHGOhh7fj8C6MczyXIdoJ5nxNQiDRzGobL2eLvE0X7fssN9i0uY BVFAThvreu3BxTbTwN24EyC3R9/tGD2h+UF5oZhbFXsVH8oAsK3Gp/F8naypv2/Gb3VI y5tDPGm1m2DbVfCmRmLc7DGMhAQy9JwZ5vTEPHwHjMsnIwE+0jskNjdd6nRxgZYHNi1w 3JyLZEZVksa8OK4Tpf1eN1ZatbTLAGYU49azzj0pUn04oK5bcaQFPLiI08/cj/zPMxds OeQcDgI2xBKu/80Qjz9NM/JwKEwc7vqmIrvDjUlYklwsw3Z5VBHJ/tscPbhmtmkVVaA9 TFZw== 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=XATNuKhlyKBqSR95XEzaIUlSWNysrBVPmJ96j3W9lpU=; b=jvBn+fleJQ/dMA94wVFYVu9GXpnV8g31OAMFh9wXClsRLO2vNvJ0LhwmmT3N6eB9qz U3VJuHNfEuWyVnAEthZ9Et7/Qs3IeHVJICTSq9AwXUDntkQZwQPhnlkWWxC8ANKdCpfq TFkpfZqDnb150+JmWnNA4wEVevuM6F0ItW7YHtKItV/kUpZUaOp2jd2iWcDwRuu6hh6Z OtINd+Xrvd9IkmBRrxadfINZnxm/ItPZ+cjCIbvvZ0pssx2ztG2fd1V4Ml9WQrel3/Z9 57EzZTZqZePgxT1EQYkzhX+GYZS00P8NeMwXuRuoQDgNPd+S8meDXFBmRfX1VX0/nOeN cl2Q== X-Gm-Message-State: AOJu0YyWx3naTnJcCFw/EsxdaaJG9UsloVlcbxeXJr5fZeEKGpuIqEEX 1DbRNTJwgyAD0YmlNwwhPLlB7I4VlhAmKWtF1NxnRMxgxHcArmp7xi0Hk+yqHyYMWCp8/qDhMES m X-Received: by 2002:a2e:9d87:0:b0:2d0:c7a3:e97b with SMTP id c7-20020a2e9d87000000b002d0c7a3e97bmr2536627ljj.0.1707654639734; Sun, 11 Feb 2024 04:30:39 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 04:30:38 -0800 (PST) From: Max Kellermann To: linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v3 25/35] list_bl.h: move declarations to list_bl_types.h Date: Sun, 11 Feb 2024 13:29:50 +0100 Message-Id: <20240211123000.3359365-26-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/list_bl.h | 19 +----------------- include/linux/list_bl_types.h | 36 +++++++++++++++++++++++++++++++++++ include/linux/mbcache.h | 2 +- 3 files changed, 38 insertions(+), 19 deletions(-) create mode 100644 include/linux/list_bl_types.h diff --git a/include/linux/list_bl.h b/include/linux/list_bl.h index ae1b541446c9..39c14b6bad71 100644 --- a/include/linux/list_bl.h +++ b/include/linux/list_bl.h @@ -2,7 +2,7 @@ #ifndef _LINUX_LIST_BL_H #define _LINUX_LIST_BL_H -#include +#include #include /* @@ -30,23 +30,6 @@ #define LIST_BL_BUG_ON(x) #endif - -struct hlist_bl_head { - struct hlist_bl_node *first; -}; - -struct hlist_bl_node { - struct hlist_bl_node *next, **pprev; -}; -#define INIT_HLIST_BL_HEAD(ptr) \ - ((ptr)->first = NULL) - -static inline void INIT_HLIST_BL_NODE(struct hlist_bl_node *h) -{ - h->next = NULL; - h->pprev = NULL; -} - #define hlist_bl_entry(ptr, type, member) container_of(ptr,type,member) static inline bool hlist_bl_unhashed(const struct hlist_bl_node *h) diff --git a/include/linux/list_bl_types.h b/include/linux/list_bl_types.h new file mode 100644 index 000000000000..84229bb7bd02 --- /dev/null +++ b/include/linux/list_bl_types.h @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_LIST_BL_TYPES_H +#define _LINUX_LIST_BL_TYPES_H + +#include + +/* + * Special version of lists, where head of the list has a lock in the lowest + * bit. This is useful for scalable hash tables without increasing memory + * footprint overhead. + * + * For modification operations, the 0 bit of hlist_bl_head->first + * pointer must be set. + * + * With some small modifications, this can easily be adapted to store several + * arbitrary bits (not just a single lock bit), if the need arises to store + * some fast and compact auxiliary data. + */ + +struct hlist_bl_head { + struct hlist_bl_node *first; +}; + +struct hlist_bl_node { + struct hlist_bl_node *next, **pprev; +}; +#define INIT_HLIST_BL_HEAD(ptr) \ + ((ptr)->first = NULL) + +static inline void INIT_HLIST_BL_NODE(struct hlist_bl_node *h) +{ + h->next = NULL; + h->pprev = NULL; +} + +#endif diff --git a/include/linux/mbcache.h b/include/linux/mbcache.h index 97e64184767d..32ebbb428053 100644 --- a/include/linux/mbcache.h +++ b/include/linux/mbcache.h @@ -3,7 +3,7 @@ #define _LINUX_MBCACHE_H #include -#include +#include #include #include #include -- 2.39.2