From patchwork Tue Feb 20 09:06:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kunwu Chan X-Patchwork-Id: 20646 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp277089dyc; Tue, 20 Feb 2024 01:10:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUW/sBU7YLnCeP5Og9bwabBcdZmbaCJynvvB5x7n9q9HuPW8EPtNJrnUdWT0Y3zRCUxUHEo9MJNUTdyfTbnjfqgzLuH5A== X-Google-Smtp-Source: AGHT+IHHtnZbsFHp0TGJq9gIciP2ezl+XqBxk2y+sYM9mNdcSSMBx3lcaFTTS+a/epSVC1JL/9OH X-Received: by 2002:a17:906:398c:b0:a3e:b3e4:31e2 with SMTP id h12-20020a170906398c00b00a3eb3e431e2mr2970783eje.73.1708420208248; Tue, 20 Feb 2024 01:10:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708420208; cv=pass; d=google.com; s=arc-20160816; b=A+Y3d+xEEVFx/KlX3oIN1QIySCPgZtrH0ZlInozYLPq/h1yqEWDzRIjFvneaKWZk48 MpVWLg2k054TC7/Xx4+n0+6TXM+TaXYSPHMyaA38iSGqS6maTMrlm1bDxuNdBAUDD8YR WmgR+U61lcIv0/LBEG8VrRKa8lK4nMcxFGlZR+zzVj8gTce/tMWRpg//GbBP7N20fRFE EZBIvBgmm3zPIy5vrizxrKcB7eVWwex5goa2HRh33zuPDCOwXMmYC0zE073cswP7Fuwg XFk3htm4Tyu1c1i1aUR0rJEVcHker0IlyPheG4hoQ6/cEYGmBjoLy9k0bnsafKWsqjTk Yt7A== 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=4HW+JyqISytd5qgsODZIwitmS0Sho4q6aGeN3ZPLjyo=; fh=r9AOWaltKLAsmI3RNZg+QZInC8x2VJskXR9dcxDRRpM=; b=zq5/b9IjKPwHB7yjNcenQ+W/4XcBfz9UhXNFjuF7ybhhoBEtmD9lIlzZcFinu52/jP aizhNyvzGChfBtyEaU8DLWo2LrPjzK93a67z6tnOgcDQRzU6hXSKXP7IT4Jmz08iTuAE m84I1JXUCRg2xZkfTrZoql1fqtsjQSUO/u7ngc1NVyL3UF0ZG5/pn/WtOyPA9E8HNbSx ANVJAAJ9eIH68gVpFXF6f6DcMckIUp8PkueWNT8N2QXwX1XEahvjj79BnUhHh2oWj/uG zCmmGrB08FdMz3+B6P3GIG9p+Swwnya/QOGOlHlivdK1yj1l0Gas4UG3CaQoTs1uJ7sf UdPA==; 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-72654-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72654-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ka26-20020a170907991a00b00a3e275ff645si2915302ejc.203.2024.02.20.01.10.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 01:10:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72654-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-72654-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72654-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 am.mirrors.kernel.org (Postfix) with ESMTPS id D72871F21BB3 for ; Tue, 20 Feb 2024 09:10:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A899657AE; Tue, 20 Feb 2024 09:07:18 +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 AB4195D8E2; Tue, 20 Feb 2024 09:07:12 +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=1708420036; cv=none; b=cZHC0J77LL/vcDPmZVZCOWbHXo2bbVhDRGg8NgyKxTX002YzPrQVrD4dxUdQjHCExHMy/QIbLck0VEjMsBIz2EVK55gym4el71UHogvhG6sVapHNorjCBZY2NXhfTpL4E08zLC5k1+aFSdLhee+ppqE9uNAWJU810wJQkCQA4AU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708420036; c=relaxed/simple; bh=89L7B2tPg4QQrMEoKdDuHvkjb0nFM7NCl947SdmlXpI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=o8GAWGUpQgMJ0IPlkNfsMUtqmnVXrqyM2tufGSZ0lrnu9BjAe/phvAjFta2wW3lcW6E4tw4osfAZ8/nXG5vLA1FZzTDE1atq2tD6GSfFLeLvRSCl0W2LX90TrH86v3MLBRB0MB/Pm03VCy9Y0MKi1P626IauBBMTkm7NMlh0NpA= 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: dba871d7a0024eac958b009188e563be-20240220 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:055f5a82-0ef4-45aa-a79f-fecd22c7680f,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:055f5a82-0ef4-45aa-a79f-fecd22c7680f,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:ce169980-4f93-4875-95e7-8c66ea833d57,B ulkID:2402201707031O9ANZKK,BulkQuantity:0,Recheck:0,SF:44|66|38|24|17|19|1 02,TC:nil,Content:0,EDM:-3,IP:-2,URL:1,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_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI,TF_CID_SPAM_ULS, TF_CID_SPAM_SNR X-UUID: dba871d7a0024eac958b009188e563be-20240220 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 1096348071; Tue, 20 Feb 2024 17:07:00 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 14CF2E000EBD; Tue, 20 Feb 2024 17:07:00 +0800 (CST) X-ns-mid: postfix-65D46BB3-873425351 Received: from kernel.. (unknown [172.20.15.254]) by mail.kylinos.cn (NSMail) with ESMTPA id 17101E000EBC; Tue, 20 Feb 2024 17:06:58 +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 0/6] btrfs: Use KMEM_CACHE instead of kmem_cache_create Date: Tue, 20 Feb 2024 17:06:39 +0800 Message-Id: <20240220090645.108625-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791408428513634807 X-GMAIL-MSGID: 1791408428513634807 As David Sterba said in https://lore.kernel.org/all/20240205160408.GI355@twin.jikos.cz/ I'm using a patchset to cleanup the same issues in the 'brtfs' module. For where the cache name and the structure name match. Use the new KMEM_CACHE() macro instead of direct kmem_cache_create to simplify the creation of SLAB caches. Kunwu Chan (6): btrfs: Simplify the allocation of slab caches in btrfs_delayed_inode_init btrfs: Simplify the allocation of slab caches in ordered_data_init btrfs: Simplify the allocation of slab caches in btrfs_transaction_init btrfs: Simplify the allocation of slab caches in btrfs_ctree_init btrfs: Simplify the allocation of slab caches in btrfs_delayed_ref_init btrfs: Simplify the allocation of slab caches in btrfs_free_space_init fs/btrfs/ctree.c | 4 +--- fs/btrfs/delayed-inode.c | 6 +----- fs/btrfs/delayed-ref.c | 24 ++++++++---------------- fs/btrfs/free-space-cache.c | 4 +--- fs/btrfs/ordered-data.c | 5 +---- fs/btrfs/transaction.c | 5 ++--- 6 files changed, 14 insertions(+), 34 deletions(-)