Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2172104rdb; Sun, 11 Feb 2024 15:20:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXulgalS3rNqIR9CiURMDcr304xUefvXxZNwGIHFuaJdM9AxA4B5twt3iIWMkzEqvfIVwFMTJufR/TQWsX7xU3R9l+g+eutnBlrI51NfA== X-Google-Smtp-Source: AGHT+IEPlLIUYaWU9qHyQ0ZsHpFKgWLMhcXcnuvoXlbLGYCQ59xlsNpAI+PYMMSzakFarH1dtirE X-Received: by 2002:a05:6870:883:b0:21a:13e1:deec with SMTP id fx3-20020a056870088300b0021a13e1deecmr6580139oab.48.1707693614628; Sun, 11 Feb 2024 15:20:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707693614; cv=pass; d=google.com; s=arc-20160816; b=CCbyCgOC0wh+02KfjI9X7nEUW/ElDtkoUavpcLX+J05D0WSRwel1m1d1O4cS3zYfKE vsNds2J/zHJcL/sRttnx0hcQjv6IbpE5f4zqanhw/ODEeP44Na2C9t1oWPkS/d2wyKA0 OdcC7VECyR+4D8Z4QLAkJxM6iy4lhrUFtSuoIGzRA6Y7A8YhwPhkpFUMrHOUSluJ+Dc6 uDv1Co0Yn/kZrFYtDgtGG3culjesvD6AvyY7x8ZOwbhcWt3bBVtYFdKpcd4KlqUI8PIN 4kniNlEkX6M3CnM1cKfmZZm9i6jRzvtCvB+SYD+tLg80tgFXXbS82y3DL0ihRSTvq5OQ FTyQ== 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=Tp2z696VR8NWwqY3F9Wq+iqFOb90p2c4cJNt6cvf+IE=; b=fsQebnQJMiuw80H4qgamylxRk3sb6MOW3Xrt0nWvc+1g4Zgq98p7RZAWyk9OLW2SXx yPLoiIm4F9lWyut25BDrO5/TZ3ekXrHO7KbT0SZc5ErekdZmBzOPuf8pOKQlNZ57g1I5 VDvh8PuyueUmKSraROWNPcMviOHD54QIhqP5nn3TYBek3lQVqUCaaxUT62nymmYc/V67 cG19vBT1Gc9KVbX0tgBEvj4yNnqcIF8j1lm/KSsmautrJYdrf0nKBeC9G4bhB/YqFOpa sIRDSatqiPu0xSX1aBAzKTH0ByePYwLtjEviG7iBf9mhxK7lh0glohgv6IEfLOgg3m4a 8ufg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=P9kTQrsy; 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-61007-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61007-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; AJvYcCXLq84s6w/7alQ4XS18zvSBhlXrVbqKdfhgYU5wSo0l1N0dxnDWzIUFn0TLgQLwF1PDdamHlGkA3gBNsBsPCIox+oruuqsBw7CyoacESQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id jm8-20020ad45ec8000000b0068c81b7bb7dsi7133001qvb.452.2024.02.11.15.20.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 15:20:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61007-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=P9kTQrsy; 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-61007-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61007-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 196CB1C2187D for ; Sun, 11 Feb 2024 23:20:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2FAA739FCC; Sun, 11 Feb 2024 23:16:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="P9kTQrsy" Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (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 14BC920310 for ; Sun, 11 Feb 2024 23:15:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707693362; cv=none; b=f0mdV29JHhAoii7RDBUPwZcg4fMuEYNyjsLp7rv1spo0k2l57gubhUtqh+KGjkJ8tCZ3yBWUuysKmsTkB8+Z4Ii/bjAqS3FRC/nQo+BLTXtP3RJ4Lbbtjl8dMEb8oPvCfJk9i1JsXU8GKBet+mJb4xIe42G86UK5mIvzZvWy+lo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707693362; c=relaxed/simple; bh=VSrPFDVdzLC5KglvVyGoKnESxlS/kGrz7MitlkFgb3M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=em9HBAGHvqIaSige5I8aQbSWn4iptn+KdlqyJTDXerSGqydGvDweKqxZjRiGFR0WZqt2DfY+RI0GL9gHuKcUhcliHPAR0FN9ySRRjNUnINTAVv2txfjvcTiF1hS5aMXxXM7gTmNQfLc25cxJ/kqV2xAljEWiwQuuKz10w7ddIQQ= 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=P9kTQrsy; arc=none smtp.client-ip=209.85.208.47 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-f47.google.com with SMTP id 4fb4d7f45d1cf-56003c97d98so3187442a12.3 for ; Sun, 11 Feb 2024 15:15:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1707693357; x=1708298157; 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=P9kTQrsyxSPKz6bKFX4cb7GeAdMXMozHyJuS920EZJr6qPjADrXEzmE6slnslYO0IQ 1nFjWXl3Z0wZcpZSsVlQjhSA9EA6zQRyUrfpbnzxcNA08SSrVi5nsUPDwkdA+TfhBeQd JUz54xqjaPX2EyIyPngHO/nTr61JqRZ0z8Fl5eAgoSNe9IyXiIXCTrQOEn99I11TCp/Q ZpF535dicfSt+C9mbeRsJaeO7J0HY3SaJdrm4pYO9cLraxWhBauXowIuaR9Gd2HMyeYE lzo9mjA9tKCJAkPKIaJInCs4Y0ET1ZWcRezxuFeX4p5kJGwkMN1bi7Li6XA98HcobP2H sVHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707693357; x=1708298157; 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=fTB3S/061jG6geKUdOrvrtkr2qNJYz7hKqoXOpSoBMpSCVUON9+abISJSgM5FxD+Mm S1OfF5Bmv+G+QQrAjawwhuZ7GXztvWguyIZ73szG69tJUIszCiyC+va31sBTFXfxJTqB wUk7UXt9L2jsdS1Vnt32fsr/8C9UuB122kCkToFHxwSuCd2ZDzTIrsZmdS5gZvpKCu0k j+JA6om5y0KyrcSxKk9r9UK9ExY888/9cEE/XVvsalUWCvXU0T8i0A6Ec3fyKb4a4zNp Pw8yDTdafnimC9TbkNe67ashrgAYKKfsE8qljIOX9TxIV+q78HN/qIaDPFXOBbXDj71f msxQ== X-Gm-Message-State: AOJu0YyPYKAsuMjSQChmuTn+v671P2l5k3N4kxbnOhiVB2qcw5wiMU64 CxwLcInLLnxjYVMoeQCPz1BZwKYy7QM5uDP2aaWt/hWROjDPbma94ZHAvCj/I0ADbJo9aLVoEjV R X-Received: by 2002:aa7:d5c6:0:b0:55f:e493:33b4 with SMTP id d6-20020aa7d5c6000000b0055fe49333b4mr4250303eds.15.1707693357206; Sun, 11 Feb 2024 15:15:57 -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 et13-20020a056402378d00b0055d19c9daf2sm2170180edb.15.2024.02.11.15.15.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 15:15:56 -0800 (PST) From: Max Kellermann To: linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH v4 25/35] list_bl.h: move declarations to list_bl_types.h Date: Mon, 12 Feb 2024 00:15:08 +0100 Message-Id: <20240211231518.349442-26-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240211231518.349442-1-max.kellermann@ionos.com> References: <20240211231518.349442-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