Message ID | 20240201093426.207932-1-chentao@kylinos.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-47899-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2719:b0:106:209c:c626 with SMTP id hl25csp34133dyb; Thu, 1 Feb 2024 01:42:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IEN6FIcnB5NY+kOaiszVdPXOtlMupvpTe8mvXqaZUg7nPQBVHSJaCdInkapOMlPepa8h1p4 X-Received: by 2002:a17:902:c115:b0:1d9:3f07:4343 with SMTP id 21-20020a170902c11500b001d93f074343mr3647736pli.10.1706780576431; Thu, 01 Feb 2024 01:42:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706780576; cv=pass; d=google.com; s=arc-20160816; b=zbdZUwEt3lmKIApGGO6bmWdjGZkHM91w6Zw9Nd04ocwCby9GLPzEgKbMWsc3l3PKsx DLSxRSEighc41gktFLcaaV0zRxNvZ31K+DlvQWs9eWHEC4ddtVa27ohuqVMZ9rJXba7j eqqkJ8O4CCQeTPXHX3NXvxJxFT0/ycwxhYWlgNqTw0X7uUpZ8tQrThuuNEk7r9Fe8W3p DT56gmKyClKcUtMU6ie8w+hW6/QD+twIQkSR4TmRkaokdl58AHUXIqeOYCpg9AsB3qq+ MHpGPIYLd21SNoTZXgYPywEckiOnwNEv15nTFY3x+qgGdrY0x+Saad5vu9E17gFVCPlj rspg== 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=NHq4wje7zNZvKtUAl2gZvGVGbwBZk8kGhW79EUxAOHI=; b=n7vV8ZNrfM7oXm7CzrHkoa7LsVG+VlF8EoGlFdkY+xcZR1dY3iiTPJI1lj1k8mlyQi B1x7wzSn92L3qzLPGBthkTXS6QgZzBhat5OFWHnPtzdPtkrl/vmdXQJpGsuH9TA+JZqt 9kUIYBYt1JAWCmvIo88hnF/3ubAoJDH8ANhYcuUiNLXEjdBN6T3ucBqvjezkPOD6f6js 79GBcr9uza1WP/htz0TmF4ewrycUV/Zchei0KCQDTHUDxvpbegA8VetX/j+ywC7l4+xo ytMtn8WSLP/bzlUoXUbcseWSs2AISaT6Ku9dzCs0xDg3SJR6cVXePmY9eL6xqAtxd66y 2m6Q==; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47899-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCUD6T2c4pjluWYZjV8Cys5SsI0FzRWehLeHLO2tGS07CtFblYxnnFY6pdU9nr/Fk/P77XSrLAZVi/hDzLEChG2c/pR3yQ== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g15-20020a1709029f8f00b001d949e48d3asi1413792plq.607.2024.02.01.01.42.56 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 01:42:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47899-ouuuleilei=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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47899-ouuuleilei=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 42ABA28E0AE for <ouuuleilei@gmail.com>; Thu, 1 Feb 2024 09:41:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8283515CD4A; Thu, 1 Feb 2024 09:40:17 +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 <chentao@kylinos.cn>) (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 <chentao@kylinos.cn> 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 <chentao@kylinos.cn> 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: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789689150036827632 X-GMAIL-MSGID: 1789689150036827632 |
Series |
mbcache: Simplify the allocation of slab caches
|
|
Commit Message
Kunwu Chan
Feb. 1, 2024, 9:34 a.m. UTC
Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
---
fs/mbcache.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
Comments
On Thu 01-02-24 17:34:26, Kunwu Chan wrote: > Use the new KMEM_CACHE() macro instead of direct kmem_cache_create > to simplify the creation of SLAB caches. > > Signed-off-by: Kunwu Chan <chentao@kylinos.cn> Looks good. Feel free to add: Reviewed-by: Jan Kara <jack@suse.cz> Honza > --- > 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); > > static int __init mbcache_init(void) > { > - mb_entry_cache = kmem_cache_create("mbcache", > - sizeof(struct mb_cache_entry), 0, > - SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD, NULL); > + mb_entry_cache = KMEM_CACHE(mb_cache_entry, > + SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD); > if (!mb_entry_cache) > return -ENOMEM; > return 0; > -- > 2.39.2 >
On Thu, 01 Feb 2024 17:34:26 +0800, Kunwu Chan wrote: > Use the new KMEM_CACHE() macro instead of direct kmem_cache_create > to simplify the creation of SLAB caches. > > Applied to the vfs.misc branch of the vfs/vfs.git tree. Patches in the vfs.misc branch should appear in linux-next soon. Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it. It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated. Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch. tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs.misc [1/1] mbcache: Simplify the allocation of slab caches https://git.kernel.org/vfs/vfs/c/879fe799ad2b
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); static int __init mbcache_init(void) { - mb_entry_cache = kmem_cache_create("mbcache", - sizeof(struct mb_cache_entry), 0, - SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD, NULL); + mb_entry_cache = KMEM_CACHE(mb_cache_entry, + SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD); if (!mb_entry_cache) return -ENOMEM; return 0;