Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp63524rdb; Thu, 1 Feb 2024 02:03:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IGzeUNTnv6lOit+a/aMzQZGZGKP12rVwBlvVuLWI9o9PJNCbdJN/qThC3a+V4Ik5W10KYx+ X-Received: by 2002:a05:6a20:9f8c:b0:19c:8d73:721e with SMTP id mm12-20020a056a209f8c00b0019c8d73721emr4051920pzb.36.1706781796201; Thu, 01 Feb 2024 02:03:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706781796; cv=pass; d=google.com; s=arc-20160816; b=xKH/mYSzM5+q+RWN7xB+wJQ3fWApMFAT0pQ2L/IsAowxv11N/U4RK71j3tOKAxFRk/ WYmg1dtsX7RIgb0r0z4n7C2hy3ucTNeVaapLtvJgiM+wAKuO8aSiUvONSOiKbtb2UxwU 8VycTUc5CyBPPSUd8O6nod4G0TaXeRVIPp/UdC71X4CKIbY8c/E80gJaN9dw+WV1CUJp MiSKVLCQb+GrN3x5vYPErZvVmVevyWyu8kwu5PdDt5ny6SOS6sp3uxXuLsVEIcvlRUr0 AXBuKjgKsFNCDG2EB+uXGboG/YQroqFuNcLcnWDZtX3hc+InklPybld54sS52kFhbs7T fwmQ== 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=68n21SttGAF5BEZ18lhpZF19kF4ChVLU/N5eki3m6rA=; fh=8qvDu7WsR6cR+oaD4X+UKAWGAk8g/YI0d+EnUXbRL64=; b=XNmFB+7nDvZwsn1YPOZU0fJNZJZ9m77YYrMXrGd8wnE0mzSR5af4b8tKjC2rejKiJi qP5of963bm/t5sgu0sq3g8rkd0tsrX4f1jqYxq9HWmz7CBGbvFfASgyjrBUaMZTmFt9X FjtbRufigRZHXb4dbMmmZ5YE9A/oshhGpiRQHrvRB2uQiCIjHn2kjeMt3gdt8+z3nqS2 Sc5WxT0546y85bVBjUcH9EFDlutNfLA91+sh6CpnfzJhnbNaalQtsknEoGDa4kX02ePZ AilZanFzFwbe/KCSYuhanF9XkoVLbsaGIDtnwAcfTS4lnEh9SHE6BkZ4P72E2Uj1LESR Fq4w==; 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-47890-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47890-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCU6aNp3gx0GW6Wh/YRBMJo/SsS6Oe2AMWENPDhYa5VekK3PVpZCjUL/rjqK7Mt06+unqepvEvWjkyyvg0klRZSllIu5c4DFFxyi0B7vxg== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id jf2-20020a170903268200b001d93939c3b1si2559972plb.577.2024.02.01.02.03.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 02:03:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47890-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-47890-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47890-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 2B870B2A4D4 for ; Thu, 1 Feb 2024 09:38:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AEA0015B968; Thu, 1 Feb 2024 09:36:14 +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 39B814D9E8; Thu, 1 Feb 2024 09:36:08 +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=1706780174; cv=none; b=OR3zFJUqOD1jNOwHkn/bukQMvQr8YQhhz94M9xtFAURgv8c6hudUP2EDYPRhtbCjRYy7W16/5E4CKrnxIsPjBmhSMwDDQU4a48imFQ4fonGOyZ3VxSEL3tC3ng+h6uhDYmdMk4aQgvTg3SjDMjaVKq03TLfc/Ghn+/JGtmQOm0k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706780174; c=relaxed/simple; bh=jViJ3zJh5S2RCOGgf/S6HMEGoMjD40/QTYwYjRnaFjY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=HS5GINlUtSPDHBgaxnlczysipK+I5gPDGSpz0wNN0o3sGBA+FGUSWbRqvCzgzEkrxPQW+L86I06pFk8t4pkCiI1hqGrkw0hp7kkHyAxQLrjFBQX6dwqgsm3LOuwHeZj+dRbRygE/8L8AUFdQXkuJhPDtlJb2/iKqmlhrROy4Alc= 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: 92d47a634f2e4abcaf6f369d3549e3f8-20240201 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:f6e10d24-893a-4854-8526-31f5b5cd2053,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:f6e10d24-893a-4854-8526-31f5b5cd2053,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:dc750180-4f93-4875-95e7-8c66ea833d57,B ulkID:2402011735594VB9L5PE,BulkQuantity:0,Recheck:0,SF:66|38|24|17|19|44|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_FSI,TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD X-UUID: 92d47a634f2e4abcaf6f369d3549e3f8-20240201 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 1698438554; Thu, 01 Feb 2024 17:35:57 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 4C618E000EB9; Thu, 1 Feb 2024 17:35:57 +0800 (CST) X-ns-mid: postfix-65BB65FD-1124251252 Received: from kernel.. (unknown [172.20.15.254]) by mail.kylinos.cn (NSMail) with ESMTPA id 69079E000EB9; Thu, 1 Feb 2024 17:35:56 +0800 (CST) From: Kunwu Chan To: clm@fb.com, josef@toxicpanda.com, dsterba@suse.com Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, Kunwu Chan Subject: [PATCH] btrfs: Simplify the allocation of slab caches in btrfs_transaction_init Date: Thu, 1 Feb 2024 17:35:54 +0800 Message-Id: <20240201093554.208092-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/btrfs/transaction.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 5b3333ceef04..0c069d44e77f 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -2720,9 +2720,8 @@ void __cold __btrfs_abort_transaction(struct btrfs_= trans_handle *trans, =20 int __init btrfs_transaction_init(void) { - btrfs_trans_handle_cachep =3D kmem_cache_create("btrfs_trans_handle", - sizeof(struct btrfs_trans_handle), 0, - SLAB_TEMPORARY | SLAB_MEM_SPREAD, NULL); + btrfs_trans_handle_cachep =3D KMEM_CACHE(btrfs_trans_handle, + SLAB_TEMPORARY | SLAB_MEM_SPREAD); if (!btrfs_trans_handle_cachep) return -ENOMEM; return 0; --=20 2.39.2