Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp328396rdb; Tue, 16 Jan 2024 01:12:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IGWlHgsYvpIfAtF74shViU7XTPQ9cwv9UR2dKhYBcNWecAK4NYy8P1Nvy7dlezJitUoE33z X-Received: by 2002:a17:906:f590:b0:a19:940f:b9d3 with SMTP id cm16-20020a170906f59000b00a19940fb9d3mr4406409ejd.25.1705396328532; Tue, 16 Jan 2024 01:12:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705396328; cv=none; d=google.com; s=arc-20160816; b=f3TFOFDzNjogOjRIO5059w6AgVK9p5+uzAhM99JGssFFlifU78qJUyOL19h3M+nY/H LK4xOGHk1euDI914wPPeUuye+X8sBEUIGq3z2DeSgbumBYycM27BRV8Uy2q3tHP5fQQ/ j2jZRwl5/WfHMT8+BMNgBjF86l7q0EqftLw9OY/gM/nCNJ9My54lFH0VZmQwwU83b+hf 4fgWsn8ds2NjLT4YySKkNkT7y8PY/Xo2Mlecr12x/LKQ3/XPnRi1SFda/Togmc+PdtH2 haxPd2k8DsV6FZczySCfdWiKMQRlnZALQOud9J5dp+tFdWZSAEs9FDVSxc3ULQnRAA9u MSQA== ARC-Message-Signature: i=1; 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:message-id:date:subject:cc:to :from; bh=gJX0fwZQ9WA0Tw0EGdiavkbPErxzugeAHKedRQHCHA8=; fh=nGb4ng0b6HL14ZaXLMLBdhl1nYBCvlbnZFEhnPoEWZU=; b=BgpwIXliMHLj0rxm7MiYgFA3N4UBWdiPHVAQ45A5L95iL4Eh1A0a7pCpo2LEWHHhF1 uVHCB/CCVT/dZ0FuUmWMAxge7YBPPt3h3X3OBXqRyzPB/LoEOFXhxi2Wj2FHu+MO8wCB piGUt+tT6PqYLTvhFcxa7aRg2R256+WohOGTl+JZ5Q2VH8Uq/E4ZCjUY9We6Y5NDZ25C CYeeD/8bBBceXZxf5uXCPURUqNdrOhOSyhkIlWmFHQj4lAAXr5f35EVPwjD0YWN6+IY3 4UEYUDWNLaB29XOP2CD0h+2CoxLpf+GsspZCfjxONKAr8fSNCWoOJCEtmTtrgx9HovdT U4wA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-27154-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27154-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id d16-20020a170906545000b00a2e7870e69dsi368077ejp.844.2024.01.16.01.12.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 01:12:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-27154-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; spf=pass (google.com: domain of linux-kernel+bounces-27154-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27154-linux.lists.archive=gmail.com@vger.kernel.org" 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 48C561F24200 for ; Tue, 16 Jan 2024 09:12:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E5B9C12B82; Tue, 16 Jan 2024 09:11:56 +0000 (UTC) Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A358612B60; Tue, 16 Jan 2024 09:11:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 4720e67c28c74a629f859878749d6007-20240116 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:8f024591-b385-43f6-b9d7-3d5c201cf8a5,IP:10, URL:0,TC:0,Content:0,EDM:25,RT:0,SF:-5,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:30 X-CID-INFO: VERSION:1.1.35,REQID:8f024591-b385-43f6-b9d7-3d5c201cf8a5,IP:10,UR L:0,TC:0,Content:0,EDM:25,RT:0,SF:-5,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:30 X-CID-META: VersionHash:5d391d7,CLOUDID:8e0f4e8e-e2c0-40b0-a8fe-7c7e47299109,B ulkID:240116171145JGHZDUJ7,BulkQuantity:0,Recheck:0,SF:101|17|38|24|100|19 |42|74|66|102,TC:nil,Content:0,EDM:5,IP:-2,URL:0,File:nil,Bulk:nil,QS:nil, BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_FSD,TF_CID_SPAM_FSI,TF_CID_SPAM_SNR,TF_CID_SPAM_FAS X-UUID: 4720e67c28c74a629f859878749d6007-20240116 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 1565199830; Tue, 16 Jan 2024 17:11:43 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id C0AD6E000EBA; Tue, 16 Jan 2024 17:11:42 +0800 (CST) X-ns-mid: postfix-65A6484E-552022199 Received: from kernel.. (unknown [172.20.15.234]) by mail.kylinos.cn (NSMail) with ESMTPA id D80DAE000EB9; Tue, 16 Jan 2024 17:11:38 +0800 (CST) From: Kunwu Chan To: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Kunwu Chan Subject: [PATCH] buffer: Use KMEM_CACHE instead of kmem_cache_create() Date: Tue, 16 Jan 2024 17:11:37 +0800 Message-Id: <20240116091137.92375-1-chentao@kylinos.cn> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Use the new KMEM_CACHE() macro instead of direct kmem_cache_create to simplify the creation of SLAB caches. Signed-off-by: Kunwu Chan --- fs/buffer.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index d3bcf601d3e5..9c8156cce9b7 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -3121,12 +3121,8 @@ void __init buffer_init(void) unsigned long nrpages; int ret; =20 - bh_cachep =3D kmem_cache_create("buffer_head", - sizeof(struct buffer_head), 0, - (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC| - SLAB_MEM_SPREAD), - NULL); - + bh_cachep =3D KMEM_CACHE(buffer_head, + SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD); /* * Limit the bh occupancy to 10% of ZONE_NORMAL */ --=20 2.39.2