Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp55128rdb; Thu, 1 Feb 2024 01:42:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IER1idctgSnVy8s+HIwzYtPhokt4k/hcK8jrrySkzmU5xU21/oOBaNrGBAN6ij9nHZGalUO X-Received: by 2002:a17:902:e547:b0:1d7:836d:7b3f with SMTP id n7-20020a170902e54700b001d7836d7b3fmr5440645plf.9.1706780565042; Thu, 01 Feb 2024 01:42:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706780565; cv=pass; d=google.com; s=arc-20160816; b=Sg5XAcETcXV0l/xk1w9kNxvvnpzyyhmjcnsO+lM9PI/xmoP1CT2iFhxBgavpCLIJls wy20K+N29sF8qXX6BgYlanhHycgLRPl2P8KeFsGwJJ+scsu7Cm7tdXclKTrG8fQB7gYR FdjH6xSw8IDoX8+ygyAt5+i4pY2YU/XL5IWmsz+0rkLylhYoyEC1syiDMjcgPDX+hmme 8hFUUZqkbbL+QRha84DjY8JGMpZhtp7a47tovGOTxxxPvnOTcnA/AFtuOsLxFEdbYpXT s21acEV/TY3+8ifs3KmzV3RKrceLkppmefM1sxzf1wTOqGUQk8Z23mvZF0Hevs2jceUd goaQ== 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:message-id:date:subject:cc:to :from; bh=3R8gNUbjGMyEV2J2XIkDGJaIE3zqDWA/oUv9hYcbwYA=; fh=HwQ/VVGd1Tde8eyTMDXyM53oRj3LqUGKwdgmGfkYsko=; b=ezXI4Cznya8ZOFr3nZUB1ECfxdJRyBVuUehnhDK0+dSnLXLqYcnsT3cv/cqIESPxN5 Kg4pMMD+QQ1jr6bMIUgRhHm7uyC+LeNyimLsaDyqq8cghYRBMWBb0OXpvOIClTkDT11k wcQTL/fbeGcQGSZCAuvMGLNEEXGOP0mVAJIDeiU10vfgzCRgPQx2ZMZOoz/1Dn+XFlV0 DViAXBFqQE4InEPCKg+IakE4iR9HF+IE7yZVCTFh4p9rnKR/NjJYIn0e2xF1ow1HC4Xd HasqQ20SQY7zaBUo3o44eJsSmm81j8qi7H9PUa4KJa9VdhaB/crX9dC7+ND+XF6HViU0 oYdg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-47899-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47899-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCWKED75RMSyuzYpS9fjU+N8pklMfElvD733W63hxsj3ekMFMx/pkbY4PI9mOS+DV/+1uVKzqm6fYN1Wj4sdkMStNKic+B/hoFrEDZoiaA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u14-20020a170903124e00b001d783b5e8d6si12206503plh.99.2024.02.01.01.42.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 01:42:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47899-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; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-47899-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47899-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 41AA228B0FE for ; Thu, 1 Feb 2024 09:41:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3C03815A4A1; Thu, 1 Feb 2024 09:40:16 +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 9F54A4DA04; Thu, 1 Feb 2024 09:40:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706780415; cv=none; b=linFo12jbl8LBejog3jMbxl/r9HzsmUXcdBWQGqyY3d8Ul7vb9Qbx2yzM8K8iy6r6NOda7Jn48GC/eLUzU8UeqHZDvzWMu+3ZsosXcuzaPTR9SJ9TlWHa/XHNmKuGqlbuFmQ43KWzVNAc8gi6nXd7yJIAzTfbhiQWi3oCEv6Z+Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706780415; c=relaxed/simple; bh=vc+Am/eF9iicnxtvW7Z4hjqUV+fLMgxqF8JECJDqaRE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=lOYM6MiOwdPoqpQmqT9TkW9rqM4YQm9lcYycwdYXaEVGFAu1I87hwmYwlPm/P99gRnR8zDZ3Gl2e3esXbxTvLocxhXpWvd21UbnRugdaK9npLidHG/rMYrkyOJB+JhDIk3jzn3Uvz17mjXjoCgriopNp4AvKMgWrHuSDKZe+lhc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 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: 070b2b4eba1f41a0bacbf62848b6ff79-20240201 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:2a9da3b9-c96f-457e-92b5-eba60a138977,IP:10, URL:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:-5 X-CID-INFO: VERSION:1.1.35,REQID:2a9da3b9-c96f-457e-92b5-eba60a138977,IP:10,UR L:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:5d391d7,CLOUDID:38720180-4f93-4875-95e7-8c66ea833d57,B ulkID:2402011734352Y3RVKA1,BulkQuantity:0,Recheck:0,SF:24|17|19|44|66|38|1 02,TC:nil,Content:0,EDM:-3,IP:-2,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,CO L: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_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI X-UUID: 070b2b4eba1f41a0bacbf62848b6ff79-20240201 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 1510496774; Thu, 01 Feb 2024 17:34:31 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id A9E87E000EB9; Thu, 1 Feb 2024 17:34:31 +0800 (CST) X-ns-mid: postfix-65BB65A7-4971281242 Received: from kernel.. (unknown [172.20.15.254]) by mail.kylinos.cn (NSMail) with ESMTPA id C7D7DE000EB9; Thu, 1 Feb 2024 17:34:28 +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] mbcache: Simplify the allocation of slab caches Date: Thu, 1 Feb 2024 17:34:26 +0800 Message-Id: <20240201093426.207932-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/mbcache.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/mbcache.c b/fs/mbcache.c index 82aa7a35db26..fe2624e17253 100644 --- a/fs/mbcache.c +++ b/fs/mbcache.c @@ -426,9 +426,8 @@ EXPORT_SYMBOL(mb_cache_destroy); =20 static int __init mbcache_init(void) { - mb_entry_cache =3D kmem_cache_create("mbcache", - sizeof(struct mb_cache_entry), 0, - SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD, NULL); + mb_entry_cache =3D KMEM_CACHE(mb_cache_entry, + SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD); if (!mb_entry_cache) return -ENOMEM; return 0; --=20 2.39.2