From patchwork Wed Mar 22 16:58:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 73558 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2461804wrt; Wed, 22 Mar 2023 10:18:27 -0700 (PDT) X-Google-Smtp-Source: AK7set8i5EF8nJFDrPCZJD2FNVMqW4s/HreyYyP7Gyhm2pSNI+xf6Q4fmnWg6ZIijSW7Ge36hB3b X-Received: by 2002:a05:6402:281:b0:4fa:e8f3:968b with SMTP id l1-20020a056402028100b004fae8f3968bmr7879804edv.19.1679505506962; Wed, 22 Mar 2023 10:18:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679505506; cv=pass; d=google.com; s=arc-20160816; b=RSqFqIYWLVXwmXEatMQMcgYobZmfMa7+CtfeY1q1jXisHFVlh1rTbxBELeKjTUmIl6 mmFPWd971KJuNnQeG5UnYeUSIVIVB7/pAz3r/9cTaEOBTWolXIlUvu0T5+A0viSKJ0o9 i3EaKgH/63dNtpzGdEmlbrAkvMAZqMScMupdzM7X9QVTLpA9HsHwD6B8F0qCcGq+HkGq t2I8nxMau//aFhiBVbYJWLJgvyrkk95UlK1PbzEAESMJFPoreOMrSX2W2BoZ2GE8qpRK kGRH1wJU81FY9+D17STa1t5f39J15B5I9CVqbKfluU+5NbGKq/Zkolq/oHLH+h7no0qU +FHg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=JWU/bvQplpq32Knxv8Pox9YEw/v27hnBYemurc1ELJ8=; b=O6Pi5Xv47EvhcIUwv6jRO35UtHgNKA1CFSxmjGut+sE53dkwNe8n5el09GuR6DUJjB 0j8aDpWySl01ekE254frzlodhl+jjrBAdGzQ9kfGBfzQiFO6xysD8I9asrUbtpWnm5Sb xqda+Z/hU5eGbOUIa3UPS8O3YFYsWG8o4oGSh9pASXZ9LxkciSUovgrtwTnILKYsVixO 2/7d2BRh8+DC6pZZ2NwUdQGHVFpcaWD9BPaYUgPx7YcWKq46PoPzy1Vk3sFn0RPFsbVs QogB38XPex2AkKTfqp2G7j6DHhvjHjY2p2vE3RRaJE2Q6f88Ss4GEwd2/npgbRnxS8p3 NL5w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=dLnAJvqv; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b7-20020aa7c6c7000000b004fd241e4783si16650707eds.610.2023.03.22.10.18.03; Wed, 22 Mar 2023 10:18:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=dLnAJvqv; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229756AbjCVQ7T (ORCPT + 99 others); Wed, 22 Mar 2023 12:59:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230328AbjCVQ7O (ORCPT ); Wed, 22 Mar 2023 12:59:14 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2108.outbound.protection.outlook.com [40.107.215.108]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AA6B19C6B; Wed, 22 Mar 2023 09:58:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JJZSeWLUV7nK0VVISCGbzT7VRosfDS8+/eQWknw0PauuUOt9XdTVNyeLvc+S30WpOOZ4DLBtoIxiwUm7EJHcXx6JwKnkeJ1YpI3u3iHqWohaEpQoIfQ2uTZ6ja+NSCds87FTrdUmJUj50HnbcK4UWNlg3QIdHkFTfuTmNsRHd0q467PWZPhMTQH+DiKJzTT+v0mNTRwWWvLKoI/Au9MNtgvr7twjo88dZChXDaQleP01x2BR3cCrhJbw88+Wqigr7Q0n6IYtoLVJ8LAwVgItq3GtyK5bTeCJ8G3ThHEGmB/Zf4LinmEJybb6UShD3y0v0vQvofBpmVN22KZPhoxtQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JWU/bvQplpq32Knxv8Pox9YEw/v27hnBYemurc1ELJ8=; b=j81VP9v/KD1429vCbHILuNM08XyuVpOyQHzg/mMbAf2+HpXRpFABjSILNqLAZuF7JyxX4GHq2BuSIM250d6w0cecsAR0IASgplvHGwyTdfMKf3FAU0e383SFg3vfaX+fheKZ6aonI4KrZmwojQZiqvUHw+wjOJeiwdXR7cv/grqoSxHlzDhSDxIi8NKD8frwhISFBVjv7tYLMA7xoY3blwPF+wp0UPsAmP7718Odl1ZO4GghSIlZ3ngT0x4Rog9ndCQUCM4012+zVZrC8IHBBQB35vmHGejqYTHmYdpXBZTjcvHPX5/xbvNNaDFRzQNDOjXb3Pn1sLTVmymOPByP3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JWU/bvQplpq32Knxv8Pox9YEw/v27hnBYemurc1ELJ8=; b=dLnAJvqv7qCszNP62jfkaIDObQxwd4JQeWVotpDkmRYHtutvGhR96r37/7GlvDxU1dN5nCGic13VoA5T7bHl2LXpydgd5p66WjWYNZkebZAMBi/eK/RhXLC1B29AU4380gVHX7QHqMbZRACmiHqCSE5Yd09lDmMfMNIR9HW0hfb8S+wqHPX+xga55XpXeHTm7b1oNqIhBYZCBEMPYf54vpb7S7zgAn4EgreDxagXs8WORHp89J00hXqSszk6SAznKF/Lli/cmLfZT8hT290PJuhqG8o4+XaC+Md6C/nEh6LaT+GbdigFq0+S/ac1elKAbtcNXxA318kEk2MU7W8vlg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SG2PR06MB5238.apcprd06.prod.outlook.com (2603:1096:4:1d8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Wed, 22 Mar 2023 16:58:49 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869%9]) with mapi id 15.20.6178.037; Wed, 22 Mar 2023 16:58:48 +0000 From: Yangtao Li To: clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, jefflexu@linux.alibaba.com, jaegeuk@kernel.org, trond.myklebust@hammerspace.com, anna@kernel.org, konishi.ryusuke@gmail.com, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, richard@nod.at, djwong@kernel.org, damien.lemoal@opensource.wdc.com, naohiro.aota@wdc.com, jth@kernel.org, gregkh@linuxfoundation.org, rafael@kernel.org Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net, linux-nfs@vger.kernel.org, linux-nilfs@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-mtd@lists.infradead.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Yangtao Li Subject: [PATCH v3 01/10] kobject: introduce kobject_del_and_put() Date: Thu, 23 Mar 2023 00:58:30 +0800 Message-Id: <20230322165830.55071-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SI2PR04CA0006.apcprd04.prod.outlook.com (2603:1096:4:197::13) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SG2PR06MB5238:EE_ X-MS-Office365-Filtering-Correlation-Id: bdf0ab43-7108-4dbe-3a25-08db2af6b457 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9qJOVVxzLZDz0WkTMJRMgXev43UyXmXE57liHybP0/OZw/0HQYplTaY3Psqpr3YmL7Lj6w3yS+r3pZL8da67rpRhHdJDZHXtDYA9RUb6ap7kA3YOrb6a0I/CRFM50S3cOkwLSo2lXPAMU4mzFm88+OGD4fqK6YNAUJGZiufiVewQotc8P0ZXinyxWABRJLyd0jT6krlNwV+W+esDUixAFg7JU1n21I6I/ocMQlcCJ/JFUx5g/TA29eXFkTT391QCyycgKAql+pilxXX8pCHiurx6QkspOSMQJYd0namXkrkLbehwUovYhKwMWaZkNpetQedY22NoheqgxvXIFkpOth4s39Fj+NvKgRP9a6xOHbZF5t4LboYktQ0xf6rW5mqK1uZaJ9D5nmIQ1SDAoa0TE98TJ+UyKIyKV8JLPFtv4vOdVuiBuOilqoPs5YzDTtSBbcVmkK0Rx4OuMNyNFaXwwgQxVnMYaTqgWWZ9HTa7wK0i1my6Dph67nGCnWXMXOVbQyTmpJyfv3QYcQyOjR+sZ9/0apSzKt59dDZOSVbnWvy1swWKRmsfaHj+ZD21SsD+iTQrs9THhjC3WSmjfQ2+42+wYzc0wwI/sglHpPylpvGQPyg7LifIIs9BWDKRJDUPPkr5D2OA1U7GXmPWG0G7EaxDjCjweEa4NKqp7KqKEPvxSgAR841ud3O45Usot2+r051F3Bo9FthzAiBX8qPEvorqiCVXscEGOE72HPVOYbk= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(136003)(346002)(396003)(366004)(376002)(451199018)(2616005)(107886003)(6506007)(52116002)(478600001)(6486002)(6666004)(83380400001)(316002)(66476007)(66946007)(66556008)(6512007)(26005)(186003)(8676002)(4326008)(1076003)(8936002)(7416002)(41300700001)(7406005)(5660300002)(2906002)(38100700002)(38350700002)(36756003)(921005)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gNhhB9iRDFkitx4TYmdMrIr1teoxZmEMzrX0SYkD/a97ZfOlwCtHvPxP15hVgxC6OKAH535EdkPqvCypdrxHiG/9Kal3m5aXm3SZv2hpN+CEy58v7oN6t+aXRoRl4MjM2Dx77I7/JTWlIPzikCz6diNxQAM/FZCfqBOMUYynViYZeE3UXStkUrDkkH15aSZRL9stEI1SKH3L93ZdnV2BPYqqNDnue6ID3j3p8UZrA4WhZV02iXfizmVYtFQa9a63h11uYa/mOp4VhqJa5OqHrF5whaOFH7VkIgasWw6b+sLaRnTpJEzfjaNj2z6TQMnwXSh6pq8T3qsjR0bXII3xkuHhzyf9kbDK7sBdHswOI2/MjDURS1DnPJ/SwvEbsTM812LXFKIbFhx+p6Y9YhQO82EiXDisyb0aVFlJW3LBSDTa4qZ7CHnlpBSRG57Da2/0M5gVFDl+zTeDO74zKGi83Asg6l9dzO3GxQTXiYzVXdDW1X18e+anJ1hpL7tz+HkFmsX/qUvGu1v+LOdvySfWJnmsLQyaLmarepN5Ahxs1XsoAEtYD7u99g+VCl8W6FszN5r8mBSK3Ej+a/9TFUTdSLjJ4cB5ZQt92RKZfstT6jcQgCNyY+c1blGPQcHonEjsyTDhnHg6aGk8D6j1IxzDw+iZPAoKHdJlGd2xTg/xwj6P+a+8gAPs73IV6EF+A8RXqvDa9U7O3oJ3MdXS0rzr5YnewvkdbLhRbcCjQLT0jZh9srPcgaljx0fPWcgDcGy9UP6eBCh/5TI8mirpBDL+EA/PejA9Hk19Bir/Hpp3UNHZSRnLyjW8tpPeGA4s0T1JKeW3mLjSzd+5DF+YJGAiX/vDFbEE7iCDx8iC0KUrfIEWupZH0A4Mb9t/VN+1gag6vIsSX+eJdTljkBA0SXuKblNnnCWYoLB6umvSUGtmL91ELqeu7hJ3zVdeyrYxT1JMvww6K+J5OvdvJSvlKBOfKNliVWVbYvPg6Jd6MgWCRAw+OsQ43oIIr0TejAwVremaviuvzX6FNq2+qF0ba8otOkpNFSXIuW5cPs4Zg2pafAqDBVKoUALRRVj9hXRdAeX4IQUqma4Rqn3rnM1TGX9y1Qu98tV9Xh6Pnj+oNADfEADliSJZO2QxMcgPgjsyxM49aUSrdSJT7mQEjqtTBuTm9FPxR6YK+uBY1Cfp6RqdNAKDwfyRbhcIGfRsKf2CVKwYKR5xXhiu6vEC8STB0E8pma6xHa2GE+D27z+S1k7SJ4ftzSd86vSvsAZHRw+MbadKR65Vldwi8f3qLZ+CvYqSKtNHHtAM4kduUtzx0vOcHUQhB23TlsPA9WbMOfcNpyVjrtXdOHPf9FmlBsviV+qdAP6NNi204+TQ2upIdLhTMH1snkf2ThGD0YfJ3voU+oVXEyI1ydHnt4Cxb/7tRobk0Bd/hV83n9sZY5yV8Ka0f+dACyBQNr318wcV2VehahfnohpOVr9/C38VFDlv+pYsSjiaJOXlPVkW2Pa5rx7vh6voHbwyr7ttQwyah+bfNgFWqdNfGKlHnkDt6UNnGGOe3iKBcfrAsFwwFAzongLqIrvz/+2eHHWxvjtYnUQo9AEw X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: bdf0ab43-7108-4dbe-3a25-08db2af6b457 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2023 16:58:48.2130 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4D7rdYu7Yq229lsRULEq7gfQJ5DkHyu5VyyEhqw2D+ZJDCFYvuKotVGTwkB104E0drqoLD/pLsipFm8byl/LwA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB5238 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761089166654545653?= X-GMAIL-MSGID: =?utf-8?q?1761089166654545653?= There are plenty of using kobject_del() and kobject_put() together in the kernel tree. This patch wraps these two calls in a single helper. Signed-off-by: Yangtao Li Reviewed-by: Damien Le Moal --- v3: -convert to inline helper v2: -add kobject_del_and_put() users include/linux/kobject.h | 13 +++++++++++++ lib/kobject.c | 3 +-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/linux/kobject.h b/include/linux/kobject.h index bdab370a24f4..e21b7c22e355 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -112,6 +112,19 @@ extern struct kobject * __must_check kobject_get_unless_zero( struct kobject *kobj); extern void kobject_put(struct kobject *kobj); +/** + * kobject_del_and_put() - Delete kobject. + * @kobj: object. + * + * Unlink kobject from hierarchy and decrement the refcount. + * If refcount is 0, call kobject_cleanup(). + */ +static inline void kobject_del_and_put(struct kobject *kobj) +{ + kobject_del(kobj); + kobject_put(kobj); +} + extern const void *kobject_namespace(const struct kobject *kobj); extern void kobject_get_ownership(const struct kobject *kobj, kuid_t *uid, kgid_t *gid); diff --git a/lib/kobject.c b/lib/kobject.c index f79a434e1231..e6c5a3ff1c53 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -876,8 +876,7 @@ void kset_unregister(struct kset *k) { if (!k) return; - kobject_del(&k->kobj); - kobject_put(&k->kobj); + kobject_del_and_put(&k->kobj); } EXPORT_SYMBOL(kset_unregister); From patchwork Wed Mar 22 16:58:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 73556 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2461749wrt; Wed, 22 Mar 2023 10:18:19 -0700 (PDT) X-Google-Smtp-Source: AK7set8SEtNKqUhM3r5rhqvExg5DhQTBkJglKR45TXdZG1mp07fUUT9Ww0OH/7xm2dCXNvDJe598 X-Received: by 2002:a17:907:969e:b0:8b1:3a23:8ec7 with SMTP id hd30-20020a170907969e00b008b13a238ec7mr8606810ejc.43.1679505498944; Wed, 22 Mar 2023 10:18:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679505498; cv=pass; d=google.com; s=arc-20160816; b=0a0uUfOK9ThBcocdUve7HH5gaVd3KuX41z1M4Q32CW/ekvayqaj1SaWnWYsjkZbt// nY8ckKCzkhGUgbZ0GElSZw0ngAiZvTIpoGzfJvedq+NyW3LMqZRLx/mXFmzhWMlPBS+L 2aJxepdNevZMgwn0ZkII2EDdznfOzqEBttLmLfPvhCA+d6kwGfKfLJkCr2i1QvHzBLVA 0AupjrG7I18FNvMS18Q+53LElyzpQ1Zm/09MyTyIjaip3dtI2jQSPLFiIjgv0juy/HXw xImcHhkHeJCBts7ljd96F/LBQkaSbtKz4C+TZJAoI49DgIMe5Bed9q2RQuDx5P06hqyL 63qw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=sX4N8DgWgxcksV62oYRh79eSYh7nL6ePu6WISP6rzL0=; b=A7A44XJXEWsAkoEJzkcWSBKFZ6IK0i2com6GxF/jVn1WNEucpJs4MVubPRZQ/TSlOb YVm+O6GqaONkYvwzlkkcv9bR691QD+zfZFf0rrzoEl98vecFww/KntdOG+GhpMnxRp/b a/35JC6QKFeCDAqUvUEft+ikhlUbgSgHry2qAVHn2eHwS+rEodJfCI+OtcwEhVawyPp3 ztLNz8rzt/Ho6ytmuCm0BxL6lzUCpEKSy2G8KyY8EKSS38rSFIjkKSmeT+Bh0G4Xh/Fx ZNwT8Sqslfcn6preMCc/3UmAi5l3Ta/vynT09Y0c0ohuh6sy/aKNnmTB0G73zK1QIlWh dz+A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=cOQn9vgN; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d15-20020a056402516f00b004fb438282dfsi15849918ede.526.2023.03.22.10.17.55; Wed, 22 Mar 2023 10:18:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=cOQn9vgN; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231264AbjCVQ7j (ORCPT + 99 others); Wed, 22 Mar 2023 12:59:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231235AbjCVQ7f (ORCPT ); Wed, 22 Mar 2023 12:59:35 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2138.outbound.protection.outlook.com [40.107.117.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10E7243904 for ; Wed, 22 Mar 2023 09:59:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iW1gh5Ct73wMkwssD5EM4HM1Py54l/c6vqTYpIuWYyxpf6xLYq5PQw1n/HTDrsKTSqn/71PnWhJH8vqQ7eMxGV/dmFxrdT5DmCrMqCHID0WAsqEUW/jKMlmSqqM8fvxS24E2xuohURTINVHZVKMWSSxt6d4RUXb2VvxYtsipk3gylyIgOoFX7DTtd3yu/OJKPDporsj0Iuy2798f6NqfBvLMlIENHiGkqLXJze1R/6F5il7ddUlSNYtQ+u+Ia0vEptjxRj4TXbYRbCGSf7gk5QgNPCIfZtC7nyV0Gl+eeUVj6S3eeJF4ouE7b00viJgJHCRvyo+RoJNZJRAI1ZYnZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sX4N8DgWgxcksV62oYRh79eSYh7nL6ePu6WISP6rzL0=; b=WFRs9USX8l9ErnVThlNjQjj7bLMTiwFqVuLdi/ef6JfDnK1k6/IDIXrg2nwreTL70K/qGFGD3BQUEcS392qKuebVJFPmaQsFkXQKNy3PAGt5/OSc6glXxvschwzvlwwDCeQ/hzcVUxBXxgDszOLEKgZSXyU249sZSadMN963oK0hN+gMteunrB4xNqhrj9+CD2oRWSwVt3TX7fTtQ9cPNgG+vYK2ZOiH+28cgSzo/Us8EGL8HMCWrWWUrPt7hSjO8qZlE/s4zcFB7DJ8quCtKBSK/vqS6i1agU7c6hM/30Yzy8wlthblsW4lwvmOpD7ehWv80/0D2aehc8jOrkM+ow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sX4N8DgWgxcksV62oYRh79eSYh7nL6ePu6WISP6rzL0=; b=cOQn9vgNtjDVo3otiKrVw5NH8ytlY8RJmknoys1OciMIoo0m+m7p9kcVmsFb09Bidmn+2rJ+O3eJUCFiDNsjePTmL0emi843j1RaV/tTh02Wt1tZsH4fXQzlUA1GsWcgGowJiUi7+2suZp6YA8CMFxjvtlhAYaYJL9DF43uBgUGpfwt98VsGDSN1W9EuXeT6U3ms60dioT5vwRr68UaKMpI1WXJASqUFoHVlsXbeHPT79UP/KxXFFLNCwJbI1aH83fRC1e/dmK8N6QEwp8PFn49RizfogMqVwrWvMcmUK8Iz/VVMgLX1AMZiDa1YlkY4B2mJTffSeQjmDKBAyCjiiQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SG2PR06MB5238.apcprd06.prod.outlook.com (2603:1096:4:1d8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Wed, 22 Mar 2023 16:59:19 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869%9]) with mapi id 15.20.6178.037; Wed, 22 Mar 2023 16:59:19 +0000 From: Yangtao Li To: Jaegeuk Kim , Chao Yu Cc: Yangtao Li , Greg Kroah-Hartman , "Rafael J. Wysocki" , Damien Le Moal , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH v3 02/10] f2fs: convert to kobject_del_and_put() Date: Thu, 23 Mar 2023 00:58:57 +0800 Message-Id: <20230322165905.55389-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SI1PR02CA0012.apcprd02.prod.outlook.com (2603:1096:4:1f7::8) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SG2PR06MB5238:EE_ X-MS-Office365-Filtering-Correlation-Id: 56b51b13-7de4-4a54-0d8d-08db2af6c6be X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8oGgEjtarj9UwgRNDuVW1LH4thdLuu3lsIP4cOxXAzFfXPfLt43NMUm2GObDIvXlgSa9E6OXfQvWxCWEwG4lxcCdW2VSV+qHl0ab+c18LZ39ad2Lms2KV58JWmgmt4Z11VEgHNFSbhifFLc6CRo1OgIRBkx3kA456HhkAM9mKLEA8txunaB19zrK3GzUherZH7y63nOujojfCYiAcNim+q4VqRSHUGxwfI2ryZbMJ9tIy5gaZkczOmCNDxSgJJHerJk9mYXPLZ02JI83hAzcv7ft/U3VwHVB27nVW6r9IcagT8+KQ+jV/S0TsKktgiDxKOUfLe95pv4JTHGV9k780xdDuk1I4jUP05UZzQmUaahMMtTnZ0RA55w9xzLPoiSJVEcRVMzvxqYJOu6hWdAMqzmChS+y+dhpqSwFNcSAQL6X4oTAx+5V24y+FW+v4Kko1HgJodFnsLl3ZoQQIkZyYJKQwKT8bpJZOHAH3FTFcUrS59eTDJqoXx1ryRnjWCWoDLDXD/3Dz58AaDpAcMDDAJ7f34Y+vpLwV7bG88e8JssGUER/CnG2mqGgXP8K1Sv5YWxYWcP9ltOsl+Uka7opbvao5Tbq7A6RKdIze0A5GJmoWggMgj+CowjWwQqrFB3t+IMIFhafmqtekyfor0FwtyzJHd/wrL/Gcp+fn9uwLVf6u3scUcSrEkMozt+wZwiwEKsFUNRFkquB/3OnkbDEcw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(136003)(346002)(396003)(366004)(376002)(451199018)(2616005)(6506007)(52116002)(478600001)(6486002)(6666004)(83380400001)(110136005)(316002)(66476007)(66946007)(66556008)(6512007)(26005)(186003)(8676002)(54906003)(4326008)(1076003)(8936002)(41300700001)(5660300002)(2906002)(38100700002)(38350700002)(36756003)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2SuS710xo5cwPNs+eMsmsHQm1GFgGOwn0yovemWsrqKWiPlklfggxy1TrGwCL2MpZsEiHTRobi8/voam5OldcrKZ++HF58BsJAbLWZNxspmQstkzi5DUyA1tBn53nagoxuh16eDcV4yfritF/UeyoX/wq/2Uo7Tz7T8kzsLu06THK65dL/7ONMtmxhUIjMDVXfL/ovTYTY6S3Z6zvXvXvNGxWp2gx5SsgQdUM7V2XRs2L5XeTZd7ImRLgqXVViYHggjGIV0ZRJJBe5+O6RZfQxbkxec82Wb9Di9Dg3YFf+89+oEK4e8+PZDIJzEBXcbGzO6iiAbMvgFivVYwjNT1zdlmlaHvHFFvHt0jSnjp5647W+BjhFnF7CF2jWzLfASnp9Dxnbl3lM7svic8qXbxHCynCUdTMhZ/pMuXqVepImawFepYNQFXpQ1RAgf4v86BrJ5TBCesIjV2AkeOYu5bzMP+nxPqPCuB/eoOHWS1NkFsxNYOIEOWnmj1ag18vdXoj+owf50+QMkWwQQWbY3JOL/TnbDRYTU1Mfxa12Sms4PewByjnnwoMWcwAs0unjZc78o/S1L1RYC1XcsOIj9nSPu1UTmfBT+5DlEzVBYOPg+UUSoJ0/xE8D22mDUr+wfqhuPlXUko2l+lSXCdWg/hDVGYvT4Bpbcwr0midvvOKH7VyXaYXaLMmDdUlF9An7cnsaMM8TJEqmR/e/ps/34jZc+8lSPtf4bt8rtmkBavFovqPR9fSyCm0GkP3DEkKwjIZSJbi7y9Ausu+ZPE4kB3hHfe+vnZf62+Uxzo1JxcuEfFA2zlyzYHVkIBMR2ri6JBDZSmy4O/szP0omIOCK2SQPilhrjSOwK8vcHVErBuHRolgXQhbEoZNfS675gTo3GWo5oWEXfZETiQi1ZfAS3184nF001+9Kw6DI6T63ozwmOBVaPm5Bg0fI5r+bgWyndEJ2b/sQd3tTXdMv5yPqsyU21xbRf32+/imChqI8qC8LuWUQ1XD+CAsHyGPKqZlEcecpxZaqxP4alUaNX4o+n4ADkwlmwKbihHp/4YBqI5+0PTqv0DLaCQ66DOQnkXmdypIJART+p8S67JwilRrUT46oBeGM3YzaULAiDpvZz/IuVDToexbtasxrW7AQARYwFeYzHoOC6yuAsybrI6B1Rfhn/kcig4jD2UgZzMQTe/ujxTfR+8SW8YS9wuwhoeAtPWSvxSZcGfynk2vZb+xi06eIaXM6Jkb+FQYLGBuKrZxR7ocXW++qoJJu4odOKlKxSZ5J80At80FSxLCkrFRSY6YkVfNNRFQB2LhLk3W/67PPwp4QgK5XQmVAzHpF6icCjRcNCvuWtWJmbOIwhg6IuWRlwBGVr+Tib16kD+mbeoSIkKRWQD3M8O61PtTlSFv0A0VZHZ1jWt/0H6Y2fAQyBRVhvoJqELXXBj8PZ1WbfEQaw8PVdQFzURalUBOqjNys8f2WmsxCjJkgkywLqNHtXxtV0WSbyaG3Vg6VhP9AfgW+Ca0Xl+C2QSfuLH7ApblEJhPy6ohDqx3wv9ykb3jjX15MpkpmSLf1qWhbF4bDg7+or3YzBZYgsIfXYMi5xm6cyh X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 56b51b13-7de4-4a54-0d8d-08db2af6c6be X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2023 16:59:19.0847 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Rf+8mNyL3G7CG5EvG5nyj9kZczFQZ0f4IIAErLolaZ0gVFWLEqP1XnqM6TJoQwoTJ2wleMe5akdK5/dy1iBX6Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB5238 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761089158079863522?= X-GMAIL-MSGID: =?utf-8?q?1761089158079863522?= Use kobject_del_and_put() to simplify code. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Damien Le Moal Signed-off-by: Yangtao Li Reviewed-by: Damien Le Moal --- fs/f2fs/sysfs.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 9ddc6ee19433..b455afc12cfc 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -1478,14 +1478,11 @@ void f2fs_unregister_sysfs(struct f2fs_sb_info *sbi) remove_proc_entry(sbi->sb->s_id, f2fs_proc_root); } - kobject_del(&sbi->s_stat_kobj); - kobject_put(&sbi->s_stat_kobj); + kobject_del_and_put(&sbi->s_stat_kobj); wait_for_completion(&sbi->s_stat_kobj_unregister); - kobject_del(&sbi->s_feature_list_kobj); - kobject_put(&sbi->s_feature_list_kobj); + kobject_del_and_put(&sbi->s_feature_list_kobj); wait_for_completion(&sbi->s_feature_list_kobj_unregister); - kobject_del(&sbi->s_kobj); - kobject_put(&sbi->s_kobj); + kobject_del_and_put(&sbi->s_kobj); wait_for_completion(&sbi->s_kobj_unregister); } From patchwork Wed Mar 22 16:58:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 73555 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2461738wrt; Wed, 22 Mar 2023 10:18:17 -0700 (PDT) X-Google-Smtp-Source: AK7set+pqBM7OzrlKBzf2t76GfMgoKHNzuE8stXxH30G8LJjVmVaO98kVm86vq5N3GnEMczpEMM9 X-Received: by 2002:a17:907:a090:b0:93b:68a8:a0e0 with SMTP id hu16-20020a170907a09000b0093b68a8a0e0mr3514551ejc.16.1679505497352; Wed, 22 Mar 2023 10:18:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679505497; cv=pass; d=google.com; s=arc-20160816; b=BCLDPJu0E3IwC5ZrKKfB5GGyhjPaJJckfkQCJckJnFSO01SiWm8n+XOso5TVgNejeW Be4thVtGpKr3mkRusxvVi+QUUeRqNz6d/f36Nh0LcCDFBS9USGts0UQcc3Eom/oLDKZb A9o5ecFa06VX0NZLZjeFXpuhSdbphePzP2XKqu50ljfI1d88gmPXtL516m1QRDXvj6HS DMSJEy9BwGlPfeWlDvXKnpp8X0Gdr4yDz11E2tatffS5lE9lYpNK2YbmG+Ruc8hPcgDu eSfjvln7/0MvnJAgy+QWno9OmTUrbzkV8jO/91Adv0rx5lMCfCpAT3AOQv3+EzdCJ0+c J3GQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Gi/SB7uU/Vm7xG+VaANHu7liHPdOo0JIwPJ5priBNiQ=; b=iED3Pwj+V90HTcqpxVXWuxkAOKOBlkX7fF8Brsj1ya5dxn1XhwUd8PZ2i0ls5GM3sr rd/Sclli3knQj7J4QFLRhCTUuPtQHyBGCS5bKn4dRBUT14lit+ihOV0O3OjBtAdB5UFm W4R8DBVp/Qi0+gnuQlkSNKTLEHcAUGUdeNo8QpYRskM0LIOGvsla15DCtt/26wNGM5GO +I226B/98aI+UFVTTDcX10OgIuZz/X73mRSqr7e69MLt7aoZkmQIuI3qOjEz+FjLDLIZ 6zT3DO+A0cZ8pkfgGXL9u9qFle3p6SB9oitNxcLqAmBiopJeCf6sSi3y9JE04D9d9YI1 Vqyg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=HVVPnH7y; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m9-20020a50ef09000000b004ad71106d26si16740351eds.60.2023.03.22.10.17.51; Wed, 22 Mar 2023 10:18:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=HVVPnH7y; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231288AbjCVRAE (ORCPT + 99 others); Wed, 22 Mar 2023 13:00:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231340AbjCVQ7u (ORCPT ); Wed, 22 Mar 2023 12:59:50 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2094.outbound.protection.outlook.com [40.107.117.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F39B28D3D for ; Wed, 22 Mar 2023 09:59:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cWIMsgH/aGCG5e9bEXCJ6cvR6R47MEPVzFH+c41MxgvdhsicsqpxT3nFbCoXuYJd/W5hSC4yILjeID7St8qEyKD6iuDmYlc7gkGE069AUkLeupUDrxhl9eYdJuVcG8g3bzd4jIjHvs1jnWiPpmMEmInqUybo9gu8g5ba+YoRyHMueIPyVbb+vJO8dpfVfWiiAM75/m4D+eTNsSvGP05Nih35m/CDHh359fBujI8lXg8oJW4i9Xpygapklh9zpRbQZPNwgo9Caz9NXyAZ+mFJZvioXtVlxGiSeNd7hhbgAKMQeGrnD428cn6QEAxW7dKgYKxVvKVl2+Y8SOtMgPi46w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Gi/SB7uU/Vm7xG+VaANHu7liHPdOo0JIwPJ5priBNiQ=; b=L2t4AhjOdoKEiuApLGF9LCio3OSWfV88LssMYhpL00xf63P9v4dIADiEL7zE6mru/oJNJ+nrUPpzUL4GB+lm1a3cO97Qy8Yl0x/SjamSksG507hYToYcBJUdOEedQIta0n3zWB5dDLv30e+9CYbghFYZrPDZkd/hxnETkuzk5a0JK1+PIwI64ingHF4DJSo0c4fdCQoOjvS0ykWcL55hkSqZy9EBtrX2ATMnRpcQDjqJig8HO4Y/8/Iw19bqNWmHVRBCOvm4JZ+FOk9zKX0xokpyJmggSTVv9afqxIdKoGgOUJXIp91dgaAWdnDJfL0kHsutZZOEiBgtVXKqaPCR1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Gi/SB7uU/Vm7xG+VaANHu7liHPdOo0JIwPJ5priBNiQ=; b=HVVPnH7yU1fLqUyEUsCqiSbJbTkHQV/Tumis4/OgV+ID8z0ETAMxmb5SSSuG8su9SW5GZg9T/dhqbYUu2RQNkWZuUqlRz5433oIpXHiNgywM6YN/E2WHynGP21CvsAB/oKIgNPpe/+DhBzwnuBOCgvF05nwf+SmqVhLb4C5wYEuUZz7i3wBFdrXPbEFSBsd+85bM4K/lWhZhfUFdUt3wypoOPVjnaea/18ntRw7iE7+AWs7n9sjyHa3BAkh7XlecC+1iofwdeqvfsJN+tbSDnSQp8cRrNOCgwTq083x1OjULMyxNruiGSGgnTd5yK/JcIyUhehmSPbE1xgQ5WlBFZQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SG2PR06MB5238.apcprd06.prod.outlook.com (2603:1096:4:1d8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Wed, 22 Mar 2023 16:59:34 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869%9]) with mapi id 15.20.6178.037; Wed, 22 Mar 2023 16:59:34 +0000 From: Yangtao Li To: Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu Cc: Yangtao Li , Greg Kroah-Hartman , "Rafael J. Wysocki" , Damien Le Moal , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 03/10] erofs: convert to kobject_del_and_put() Date: Thu, 23 Mar 2023 00:58:58 +0800 Message-Id: <20230322165905.55389-2-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230322165905.55389-1-frank.li@vivo.com> References: <20230322165905.55389-1-frank.li@vivo.com> X-ClientProxiedBy: SI1PR02CA0012.apcprd02.prod.outlook.com (2603:1096:4:1f7::8) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SG2PR06MB5238:EE_ X-MS-Office365-Filtering-Correlation-Id: d89c2428-7efe-4647-4dbc-08db2af6cfd7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ja/Md3+4XLTascUojIsAaH/+vXNfWIetuvfwOmkzlURwjrymUGX4zXbUz9qT8+TudtumEuvALlbIZ9s0zknm4jX0WnEJnTRnSdDt/SZM3J2+kkTk11x0bPJKLI3rVvNj1hvZvwK2aEN17OxZkpynL8Wmoy3QKRDYxX2uZodPHP//Qr0fuqcLN9GYuIiguP602AiAZXu3i9z0UCmBk5mfqHebyhI53SraXDMkX6B2BInZAEYo02CleBkPo7WjvFEI9u/eMmdUzfMF+JNSLuoc6AP8aIaIDwVM/yZiP6++NTEBobFPvkfEBLVNkaU0if6rWjV5ou8RKXXvjxGerSVzltqU78Ro9ahvq/wcvLOTv8KHGxS/jdJp1C89fnFlMHR1cEpoBzzYnE34W25JCPBfA9DUo6jw6skPj3X4L1emtX3rTQMPJBGg3sHQ78jSAlRadUeuYmdCuZ+1a4E3ZYp8eIbFsQqpShVFuRHcx5z4NbH2EedgxfAJ8Xgi5advVocC1MQ4MUS3C4wwxOherqzFNOfnTOyblNMX+TrR4+l8mbPQb8RFMG5Om8YYv+mVARTGGutng5tC25jgjuT2/qLm/YNcYXws9mG2hAloZC/4MU8qvZW/K+AxJh23gK7wgh6E1KktXjEKCFXSrav9o5u1SxprfBRMEFiNMnaNgWPbtJ1su2nXEcfgvqGXDhNRotL4sIxLsBSj/IZzu7MASujT1g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(136003)(346002)(396003)(366004)(376002)(451199018)(2616005)(6506007)(52116002)(478600001)(6486002)(6666004)(83380400001)(110136005)(316002)(66476007)(66946007)(66556008)(6512007)(26005)(186003)(8676002)(54906003)(4326008)(1076003)(8936002)(4744005)(41300700001)(5660300002)(2906002)(38100700002)(38350700002)(36756003)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6PMzENuswHEjU5t/l9xsPxxaa868TJMzYdajTv1mTyVu9UxS1ukDTLkyL6OvYTSQcMrwmTifM/mcpf8pkuNBmHIsRuQXG4bNmBK7yiZVu0h9wnMw6q9j22OZwXI1VMJ214DtxtibCrd9GRzRNiTSOYcJdPF1eI7OmGGPQW1ZlFD8l88DebS6RPSB+dj3yZ4tXzCNHeRh64fkwSClZkHI3WdLxXS98CrXQsHLhKnTw+HAgrsjS95NFKugAzK9knQTGpZpKQEAcybzV0VvUHA9x5bdpZVtgyDnjDkNYyqm8BFOoSrSsWhkSVDH6a29+ucJQah1EG4iidgCiSRj6aZClbWd19kELTwZa1xH7yvLWRbQ97q3/u8OysJ8UPCOKISPhQt+q4LNqSQQWXEvkpS1UuattIEUxxmn7AJr2WLRpf29d86lB9X4rsAtFVnJv5L/dEUl9EUbq7VrFbnGHa1+ITQmf8tXJDesPsqZ0SRYHht4X9F0zST3pSqxTojyJf28InPJc3uNXvcYrcUS/hOLJxAxjKSgET6AcvDSoMhRDH3X6oHrt4SfmNoC26uBv3SvS2u1C+hTEl2hr9ohSz1yTcOg2JBiAzWqousTzDAbxy7Ey787iFeNu7GprzouGwce/atPjQ2yZ78JxVRNTqBo1LgquwCWL6Qdcxfc7X+z8OWSfCMyhKGVOn5TFiVUTjMXoBX7pC308IJ+7tteG/kka8K3u89KTxI3j+JeNeU2B32bKi8emqgIvw5pn7KjRLY0CeoxaQOmj6DdwE4LlA8l2IxSznDa45BDMGJErSVLW2DsIvLwlKsreoavqEm3VhpKACMP4IrwQj8MWPD/FoFopgeVSiIQI0MxFgl6wfCKaMNGW6NzamYcKsDaLRfvcAfsKrQHly4MO43SWA+GJE3va5pk40mi4VlK5r3lrJfvkQyc8YtUsV72JjCWtn3DeddxtDvLD3cUEE68UGUWJ+TndQoX9eBo9bDE3uyv/ABGd0mvLZMTT2GN00OsJpMiCK9NYOdP0gqPS6XMZmgCSCTrcIAIgu5p0ZVOJpIjF3XmGUYQ5evk/V5d5BZfiAOm2+xVOb29T6OQCwKcM5aJWWncFiNvn/fxOse3JYQ7CRjDeTMO/9v0YpCW7MBebbicZEe5WfyaUR2yIsnJc+wc2p+q5EtokHMQaUhuDCXtf5uu/YLyN2XkEQVwJ18H0dnIUw/MT7LJ3D9dm8qOHIfJI413qbYMtyU8ctoCZha8JmLQ6YNhrvh76GXnWGY0/3PtHX/Y0WYM/RUgNvT9sIjfftVvrM6ift2AuOC1uJJ0+OdLCOjjz35nUxE2EWtq5d1jZD987IRWxZAshGNRq6PajRSJyTvhpWWyAUdkda+ua11cWGzEauJkarv4UEAPa0C0Qtrb1hf2GXI1bsP7dYmzDJXSC5ivmAv8jYN+nW0yIfxSmDHHSR8rUeH/8hwTv7/FmHYcl4l4pX1iXiK7tcNRfzfppPNVJPMqETLOUuaCN+TSg5qiE3KpR1FtJLqqnP75rvyts3wT5ox8RIaI8mlJzgEbilSS0u5v58yXAX2kUIrfTCemSuWHWGn8QF2g3lj4bJTN X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d89c2428-7efe-4647-4dbc-08db2af6cfd7 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2023 16:59:34.3509 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lz9ovNjaymPachLyjewdT90IjkHX77kfsey2EeFVRaqO9xKiu9vVgTrtVywED52BPulRWHfo+RoamMWxeD4w4A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB5238 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761089156322727180?= X-GMAIL-MSGID: =?utf-8?q?1761089156322727180?= Use kobject_del_and_put() to simplify code. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Damien Le Moal Signed-off-by: Yangtao Li Acked-by: Gao Xiang Reviewed-by: Damien Le Moal --- fs/erofs/sysfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/erofs/sysfs.c b/fs/erofs/sysfs.c index 435e515c0792..9ed7d6552155 100644 --- a/fs/erofs/sysfs.c +++ b/fs/erofs/sysfs.c @@ -241,8 +241,7 @@ void erofs_unregister_sysfs(struct super_block *sb) struct erofs_sb_info *sbi = EROFS_SB(sb); if (sbi->s_kobj.state_in_sysfs) { - kobject_del(&sbi->s_kobj); - kobject_put(&sbi->s_kobj); + kobject_del_and_put(&sbi->s_kobj); wait_for_completion(&sbi->s_kobj_unregister); } } From patchwork Wed Mar 22 16:58:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 73534 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2453923wrt; Wed, 22 Mar 2023 10:04:40 -0700 (PDT) X-Google-Smtp-Source: AK7set8ED56PDMZ2TTQRRwDCvADJFBlviCjjTKG05/LLxO5ccPVGERwa1x79bewIYnObXcP4xL0Y X-Received: by 2002:a17:906:b084:b0:931:75f5:36db with SMTP id x4-20020a170906b08400b0093175f536dbmr7370858ejy.11.1679504680054; Wed, 22 Mar 2023 10:04:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679504680; cv=pass; d=google.com; s=arc-20160816; b=LcJbZ1wXRFARsVDah2uzribWGbyRQCg12hEOHeGyDVuKFN/Sbq2CQiZfkho+Xwm2J7 P1IPxZdAE8XWSPDJwpzw2r5yn8STRfH+e4CRxKoSXrzDFg8SpU0NNyKRacbe8pqgzSXJ FU1HqyT9w1dCO9uBZk5omd5Y+6KcCdixD9Gt3rJK7Vz/LAxer6zsj2/IwYogAhWumyaa dsyRyyS8lK3mUudII5spVH+HuwGcfGqLQEHjk4ZR4ZEMNMQXoFdXf3q22Vxltcmm+lKG fiB+EfPMAdrWP6+npjFU9/tOEgdJ+uRZ4LgzrGtkkeCWEkUhaWNF/bGacWQLfJtd+8K7 ecvQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1ecBOFBL5r+bnKKNsVchdUNnMVHFYGZmRu2mS3y21Ns=; b=B7qdrNf57IQPBt7ah5OOoJx0fs/rgYAXaMlshR185MpKUrRLFx82s9ieHX1AFF8Iho nS0d8B+oDZ5ESVK6t7o2j8GpoFVcESlHi+C+3K2M5telcTs8k9r1+VG3UKvm8lFtXMz5 MKt0jr+371gQBh7OsZPbKfwJeZJeEtUwFDUET1lJKaWuVgo7sNjUBhd47Sgu8nurjGpp O+8G5m6juGHHe4GksVsEZD2LnJ8ySQ8FxPUsPFWOYOXasfXYAozdmtW5FWezE9UDgVeO osaTybNM55KNLK+V/d8TeLlsM4dR9k1jJA63r8UEjuXxywbbOw2/MuA2M1JGsdyEaSzO jkqw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=c9lb6r1H; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z7-20020a17090674c700b008db13af5641si13361633ejl.261.2023.03.22.10.04.15; Wed, 22 Mar 2023 10:04:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=c9lb6r1H; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231308AbjCVRAH (ORCPT + 99 others); Wed, 22 Mar 2023 13:00:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231350AbjCVQ7u (ORCPT ); Wed, 22 Mar 2023 12:59:50 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2094.outbound.protection.outlook.com [40.107.117.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 461BD61AAB; Wed, 22 Mar 2023 09:59:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J7xLpHYwOGdK5ug/T998yB/7RkJgrgLuIulV9r2BXxLhLlSq61FGaVUdaAOEGqMBwQYkSk2h98ot2J+4FPEXEcfiZ3CYHKNJOIhQUp64CL+ca6EyC/66XdWDJOO8Is3w4w8D4IvHubRPESZKua5KoPV7mtCOHY7ILim2CtHeGYNff+KzDto/Ous7Dv9RI/oohhFaatDh3FpHHgZZpmZgwVESQ+HTpque4YpDREg3yXYbODY9XIp8D/N3BXWPhxrIe0pfEiH5YmK/VcJCNJ6AjT49mRytGUCJQ4Ei9zvU8nSy1886nRkXTfQ/w6TqA+GRlJ7ltrfCXfwoV3cEy3SBrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1ecBOFBL5r+bnKKNsVchdUNnMVHFYGZmRu2mS3y21Ns=; b=FWDIv8fwiEHcMKMKR2ev8dd/q744mP1zMGDbQwNV0h7iy5Kk0DNiQwEQsIBB8jl6ZySHIf0EhtNARwSJtmIwMyZ3bgIbK+BN18EIwHzNGcyWK4sQ3CpYP/2wXcSSFfpwAnTQL1a1DP8b/RUXa3pJYAHGRI0J0oCpveMZZEZc8BWcePrKT+8IYMMEFrn7zBQ5G4YjxKeLZ0ARAOXQ32hGYrtCy+qD5nIPAiUk2fG3So0F6SzA9hxk/F9Nl3eMgrwj8YEcEjn5/tZhayq2KP678Z8jaW2ogHK5KvthrTGoLnMN4xmwDDHxtZ79Ae1X+7xNfnftcgh6fBZ3VfEF2pGEdw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1ecBOFBL5r+bnKKNsVchdUNnMVHFYGZmRu2mS3y21Ns=; b=c9lb6r1H7Rpv0moDMTBx1tBnGVjIsfssaS8/Z8FHEvlCkfn6yUSPp3AaE24JaeVZhv9b87lTHz9Un3KwsPGWcaFspcE2LxHkgglsVY14y5QS8U193SChy/ZJyeelole7/qVT9FGHmUljkfdwuRDFJIaQS52EL6fyVr5zKNSvOeS8IYhCsQAjEVLyp6boRy+QirxVQdu+WGSUJX0SRMK+HQg0dd7LFGFUB/dNpTsf555woq6TlxYqQtM0wCY2jObh6XysZhNwbnssbHZmEC2RS3H4mIecn5KOG9eF9nAxzqxShQuxUPcXD9y8uqv2NY+7Hai040KIwzp4ytkT1hgUJA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SG2PR06MB5238.apcprd06.prod.outlook.com (2603:1096:4:1d8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Wed, 22 Mar 2023 16:59:40 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869%9]) with mapi id 15.20.6178.037; Wed, 22 Mar 2023 16:59:39 +0000 From: Yangtao Li To: Damien Le Moal , Naohiro Aota , Johannes Thumshirn Cc: Yangtao Li , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 04/10] zonefs: convert to kobject_del_and_put() Date: Thu, 23 Mar 2023 00:58:59 +0800 Message-Id: <20230322165905.55389-3-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230322165905.55389-1-frank.li@vivo.com> References: <20230322165905.55389-1-frank.li@vivo.com> X-ClientProxiedBy: SI1PR02CA0012.apcprd02.prod.outlook.com (2603:1096:4:1f7::8) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SG2PR06MB5238:EE_ X-MS-Office365-Filtering-Correlation-Id: da99ab68-5a3e-472c-a988-08db2af6d31c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: g+Txg/37YzT4+X3Eygw3GS4f3rwgKPGdVxMClhKnPuh6c1nnl+uJ/yS+k1xC37s4DDtn9AogFuAGIlP2W1pKHH/6btGAcDawNBGteJ61vzwaTxciX0V+9W2VRiLkkqGS6GuxUYMD9J4kyQqvKoqZfDU0p5gcJ356Bq6ADkFHf7RL+8JPrq+1tM39FbnHkQTwO5Nn5hiByfMkuQdO01ZPUj/nXGTDXVxOOr+WtWZctIr9m+y04Bi0PSbVsUr0arZUCBQMIXOmnN0NOrwRrBBll23Y3lITzA1qNG9iDGP5/EOjuYPG8lxzECF7Zjg86BsiHMcOW8v/3cVpBdm76sdUE9LsYyYciWeoYfyDaXlCqc82hBo/BM5DGmLTCf51FRf3k4GeshevHXKWJGP2sVOtrjux1iybH3npUkBeWFNGlY483bI7V5Cz/yEqsO2dTNK0u9JVSIDsi9dtDu7ctzIuq11TN0S7nAs63GfV28DKCsyXgQD/IZ7m4RE+fKkm3vo+hiZrF8+skrlP7xxsFRXbtMHfBBntu1poeEK1rPSZ7jlTfw3fOQDJ2BO2TgQ3VISQAJtCXrg6iPURiLK4IWInStp1roYSEjpqHlmKP9VDm+wOTgtPogzX79TZuZ4yb4c2Uqc/mrO1RGIusns3pliTn3Bk2rgnMPv4QfUcGKOZV3D08/t9eGj/8hhsAztK92vyQdVX14BNr89YCKrSpipROg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(136003)(346002)(396003)(366004)(376002)(451199018)(2616005)(6506007)(52116002)(478600001)(6486002)(6666004)(83380400001)(110136005)(316002)(66476007)(66946007)(66556008)(6512007)(26005)(186003)(8676002)(54906003)(4326008)(1076003)(8936002)(4744005)(41300700001)(5660300002)(2906002)(38100700002)(38350700002)(36756003)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oFTngEOiHyR2je4N3zLoLge8Mf/kA2dSlBxmb2bR1dYy8guWZIW2ACpGZPODfYn6fz9hRy7igZAJSG1iy9W8kULvkxXDLiqcZORJ/kmsPiUP6caYak66tVZIbogGnUvzKqSuA7baLKochSzsezgmoG7D88MSpnPQG65eUfIWX6KVT7kd6/rHi0cU7j4wz0CGnv1P6w8q+LCpTcWZ0RkE84Fj8DbYkahnN7c2yht6Qijt6hZ4QmpqeZfN/3Aae4ZT6EEV/guIxXYrweO0DiR1b0zseE+UYbkEkIxB6vypBZs2rZUGH4ypkhnM8R1Cz5zJWCWvojLgDtGpTJrcHG1hQMeyTYE1t/XLY4bNCB9oeC+k7klUdMe8ov/F5bL9Uv8Nv33bk1aBCqs6YalYKrVa7gW2NwOT2LbTKN53O6sDL3+KZX/1Pz6+4GCjBoO8/lbutJMGQmwx/yAJir1vwuW+B0DmfrZiMa2x4m4mu6IPwB4B8fWVq4PjGDWk0b3n+Y+uF3NDTMI/18loPnqHky7KALCH8bUJI8N9cddobL1Tf7OnsnbOctewUqf8q33IhweWOQRMqFU6YKXPtaIisqh6/DR548i1kb441iMR2oKkYTrqmL5D+fuWWjtbtG/Nc1YjUHQMvhxrcKbe9MyrXKd/Cxe+msNZszrGuOAw6qLaA06i9898eNL1FSP0BCYE7J4ZmIGFyIx+lId7rngz9cyaVHNLCMQzTtvu8mimn1FR4ior3jNZmy3PVnT5Z/v8IITRNJT24EaGw40JIS15TdBoaeIzbkoc8j7j+sbj9OmWTkVxDFVPq28aOsEqCG+t4j/SLo6wt4B4qNzhATj7l1P2x42tswOy6PF0YEL4wGGjuWQ2coljoI+GGLBWr6OJeLGo8Vt1qvd8FSpiKCn9CQyQ82264ZEGxcYfBLkftiYG9ULNZprJJGYBaxuektOCocBkIBthYpZLHyCoXVjB2YQwmi65lRdvZKp3c/YSKa0rml/o0BDZLiZKUq16bQ21+m7vTiJ5TYSP/jouy09RRNCIuLpFux4s8RYyyM/AEVQCPkYD5/nwHfI4r1NRaG5zSjZfqzLyYV+azppFjiw+L7JvxcyeqnFXPzLM/b0siX/s3uYmtve57U5EeIa/FIn2trEjoo4X9LViazgAOS4x5go4e0NdjLVRJAdKYKx+wRfOHmba9BeITjSGJfn1YE+p8pSetKdVrR1a31pzRCgaHlFGzBcS/5KUKcYIQnRM2RXLqK/BrcnMYiilkx7O90vAxphb2C8PZm57Kg45cgBpU7p0Ijje9s8MIq5cfCaGjSlRwDWiFRZA35dENbGllC4vUu85tX7YilnGi+4r0fhDOO/8b0xldOITagEAKR2uPcNp+g6QUW1UmzDJ452t4Zrm1m5B5kw1Cs6rYnXAYQ6OLYeYYXmBwNJsB8Z3T5poY9/YXEACeZ05dEltPqSpIoMNOjayQclx5NZYmmAFHb5DWJIOoq+aEfJuxiRdMQMxPhTIDPcT+pefq4yHv+CusUkTC3shYtZ4y0fGnOoEyiNjxxQnLCiBUztUzjekXmYOiJ5gp4z9IWRmExiT15ME3ZoKMQRz X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: da99ab68-5a3e-472c-a988-08db2af6d31c X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2023 16:59:39.7592 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gi2U7ZaR7deqhVriXbvHyMpXVpj3dqfbkk9a3q99UzSTwvnaWEOMSXhRBidKzUNWzch14uTt4N88xDzvy+XKpA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB5238 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761088299589377486?= X-GMAIL-MSGID: =?utf-8?q?1761088299589377486?= Use kobject_del_and_put() to simplify code. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Damien Le Moal Signed-off-by: Yangtao Li Acked-by: Damien Le Moal --- fs/zonefs/sysfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/zonefs/sysfs.c b/fs/zonefs/sysfs.c index 8ccb65c2b419..5e117188fbb5 100644 --- a/fs/zonefs/sysfs.c +++ b/fs/zonefs/sysfs.c @@ -113,8 +113,7 @@ void zonefs_sysfs_unregister(struct super_block *sb) if (!sbi || !sbi->s_sysfs_registered) return; - kobject_del(&sbi->s_kobj); - kobject_put(&sbi->s_kobj); + kobject_del_and_put(&sbi->s_kobj); wait_for_completion(&sbi->s_kobj_unregister); } From patchwork Wed Mar 22 16:59:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 73550 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2461214wrt; Wed, 22 Mar 2023 10:17:15 -0700 (PDT) X-Google-Smtp-Source: AK7set+1PFRn643N5F197QPP0X7EBa2lMZBnTcPXw4eAhOGuKcNlqrMnSBWaxEAxFGIeMqe7k3kl X-Received: by 2002:a17:907:c306:b0:920:7a99:dcd4 with SMTP id tl6-20020a170907c30600b009207a99dcd4mr8439968ejc.62.1679505434926; Wed, 22 Mar 2023 10:17:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679505434; cv=pass; d=google.com; s=arc-20160816; b=BBCLQd9OffowV0xCFHjPwnrtWnZRPo9/160Gf0wSlYs6MWwnzNgs+D9sGJCHQfTqXS CBA/zCnR5a7wDu/2ovdS6/LDf8gQ9yVkHUhw2Mxlzr4y+OjaAGAxmvx/ejpXd69jGx8l dgi/ie1C0KzkACYVwJCMyvcp6KQQKuakdw72If4ahud0y4ONEElH/tSEETrQG4Uymwck 8fW6bzBFGuPVfnqrlYB/pgEbwc3/efbFiHE8miH5h7/RLT8MNuatWXNWcdI94dSubiJc 7QPik+1jXKxyU48vci59HGljA47fvSO2LzZH3owlItD4QDhLLQYosDW49bGYKZ6iKUvh L8Qg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zeQHK9btMEEetoQ258/+zZi9o7P0QMgrRsf6CanIx3o=; b=r5PfRYu4RHg1ULgm18t4wUQrkI+abVp3DpKVo5eCeFNSAmXYtpaTquVPEKMS12bEOC GEOBL934AGd3aqrQR7yJfVhTopWdF+9cF3NUqyl3DfcMuXqNcBPge1QlxMBGJYI6t+nx avjUxLfyv+bZ49bCxCvFw5QJXoJCqMoHnC9ozsDxCXnmNj9IAu2RYz2FyKKmixFbUcAT WG/Zro+XOVad5yqEWFFGZTMaLkUKJN0o8RvkV6Noo8HVtE2bem0UHNeJ0hE9UJwh9vzZ uEQe/NNQdU3lvXm8T55HhIX2UAuvQiPm6S5ZR+ppHALDITsTqcFfHsTXXRTAyopIDFzc sqYQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b="Fr4B6MV/"; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd12-20020a170907628c00b00933d7a0e4e7si12211662ejc.441.2023.03.22.10.16.51; Wed, 22 Mar 2023 10:17:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b="Fr4B6MV/"; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231357AbjCVRAS (ORCPT + 99 others); Wed, 22 Mar 2023 13:00:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229864AbjCVQ7x (ORCPT ); Wed, 22 Mar 2023 12:59:53 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2094.outbound.protection.outlook.com [40.107.117.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83DE228E8B for ; Wed, 22 Mar 2023 09:59:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dhNF/RzQNc+fpWIx0DdgQ85QQfrDFa1ybi1J6TBGzwALqsF0bWBmSaQAhngW1e6jFgyeCH7k/oJalLW5zi43w7S1iJjBhxmTPT/w4X7zoDT9mRdtI/DZ7URZQyRP+MDrGyIH50ia4mXIdwl+OzefSaHnre6aoCtTQkqXi78o3Z8f9YBNuIgFOonxyzAnCByrkpNBGR2hzGG5lMnm8uGakFyBg739y38suABtr0VuG7ypWlJ+DlHASNNCZtvFXQhOG7MUW2qna5pnqqC+FCBdUjY90dmlnIoHfnd+ROXPHt+wvPw9d8+nVltYA/Ggdudu8PCnXWQOsdvgI2cxLNipmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zeQHK9btMEEetoQ258/+zZi9o7P0QMgrRsf6CanIx3o=; b=TbIGKdmQsgLEKq8224wvjugRLBJJMb4iAZFgvMw4dn9qBnXbV9OEWIIIvzu4vqdmz8TfuhbI/wTknDDVzWb7cXsyRynR1PwraDq/CPWMTeMjbw/JW1aZjh2h5ztKF2rYohA1Y42fSIQycOUqWXR5Ey0uha/JLgRJka2tRHd3ufqqa8Ii4cdQ1xULtF2LYN1nfi0TrKbRMac3M1F1Wo5IgPDlTr4m0XOFw99E/kwTohCuJY46H/4wPNw7akBk+L/5RwwixkqZ55/V9h4YMhquZds8LzgT2BoG9Kh1wAI7brjUxeYmL+J4ezq+10qWzKZKeCTOq3Bg0ObFd6XObAxjkw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zeQHK9btMEEetoQ258/+zZi9o7P0QMgrRsf6CanIx3o=; b=Fr4B6MV/U4v5MDOmSdjE7cXXP3ITeZ9epkKH0V/xXFtNWv0XNIv61o29kazUn5QmpOWbs7MrOVckvjQ60gblpciXElSk1tsmUQslDVeQ3SZr1laP4aFwV+6gLNmMGHCzPEU4O52H2pvIwtexG7fjPcZ5GEFMHtwzfNViuyBvMAanhNbrr0QfBkq05cYkOSyAMGFAtg4uy82YxUdVORZimqxptYyAgnbiDJVib4YrRuwC8k54yjKcRF8Kj82+QeRKlbMC4s+ubdGipSB/6xlGStuGQhZGZXjDHiM3kiAaBNdTBCrwRQcAr6qyPVVc9QAv/tSLY3p49MT7DVTmaLBfeQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SG2PR06MB5238.apcprd06.prod.outlook.com (2603:1096:4:1d8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Wed, 22 Mar 2023 16:59:43 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869%9]) with mapi id 15.20.6178.037; Wed, 22 Mar 2023 16:59:43 +0000 From: Yangtao Li To: Richard Weinberger Cc: Yangtao Li , Greg Kroah-Hartman , "Rafael J. Wysocki" , Damien Le Moal , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 05/10] ubifs: convert to kobject_del_and_put() Date: Thu, 23 Mar 2023 00:59:00 +0800 Message-Id: <20230322165905.55389-4-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230322165905.55389-1-frank.li@vivo.com> References: <20230322165905.55389-1-frank.li@vivo.com> X-ClientProxiedBy: SI1PR02CA0012.apcprd02.prod.outlook.com (2603:1096:4:1f7::8) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SG2PR06MB5238:EE_ X-MS-Office365-Filtering-Correlation-Id: 574b2aea-b45a-4289-6fa4-08db2af6d564 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JPCM7jg44gW4dKN4xtdG7iHtiE4N2NsGi1Ohdc4O46oTAJlgSxrEqVVUzUkyKpTkxVbi2Z17ei7wcpFWGvoU95A74HEtuTcmv0IzVJb9/dMUTvQaTItMGDQarSVeQpUwat5YGYgZ32J6cfM5h8F48r4Zu7F3LnQNWYj7AEA4A4M8NZMY1h+Zf1NGXdnJ8gL44Pa2ZqUSuMj+u9zufRJedG1h1OB8gVpc8MvmWph7l4VaQT/0zOrxOWrGVyivfzCAu2NQ/BBOToj96Kd8r9acl8VmpmtTqnuGkXjta5xDijsbqJSK886MXLnfg0wQ7JissyiWC8suQrgCRUqAPHUEo/mlCVVaobPyCY+G8OcggxcgHpvsdoX8NQiDv9tpLW568zeWRorFGyyrT5OqFEp+0xy06Lnejtl+3mq4hJ1dCuVSVrwgHSKehZLs08T3EzCX3LZkEP9IbT/UBOL1qMkoRM+7990+u6rkZdubSY3bewbxLEQI4j34PEOV2DSxEWF9fH1blvQoGGY5TrHOaTgDlSV7N0fdjSZjslsy/WhMfAHzuqOPvqVUXBU56fSumI04uQ/r3YnrEfaSXMTcP8uVqq+oxzu2WXcIVIDjxrfEshsyM+yGUaYSTF/ksd5uZnyptTsF4GrKZU87lzs2H7e2ET2IY2hhxW2hIMtcq5GfbLsPiZ4AmzQaBwFSsywc/DfBEOPYpFSLeMlUFJ00LD7oZQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(136003)(346002)(396003)(366004)(376002)(451199018)(2616005)(6506007)(52116002)(478600001)(6486002)(6666004)(83380400001)(316002)(66476007)(66946007)(66556008)(6512007)(6916009)(26005)(186003)(8676002)(54906003)(4326008)(1076003)(8936002)(4744005)(41300700001)(5660300002)(2906002)(38100700002)(38350700002)(36756003)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: E5utXRMp2izd11Qlu2O9ryZY+NvvFBdzrCZOElIip+WOWrheOlwta9vzgFueT+XFvT3Eeyob3lePU2jnoF/wrceQ7pvB9xYaVhlkvEs9KRJx/U1V2y/nAzCDqOQfRYn0pQA63ZYQBukGwDtkXjFRjbW4iNC9fZGsMzqdmidBHNzKJ2JUDm5tpmvunU8RA/7glDQOhjqvcRqsMf02iIUifx7TtolOjM6sx8wQZuvpavJpRcrk4ho9HLwdSDXpB3xRFrgX+PPGxbt58FjMBszXTIcfWAnyN6s5EC09JFgoSyKoeBX4tHKaGFKy41o72fVjiZTG5fA2dicki4+wpMILdvUlfpsKjdnuER7Esdii90Fc+id3n5g9Kc0ZUo7lUTkIrHJIy4yKhg0uWss5bGP7gLICN600CBZUw8oS6LRuIdyzzCOR3QUPOgRSOWwRZpWDC7bAA84a+KRQEpnGDyP063DEVtOpwhgkxovtM+zhgvskivClZnvmArFMNWutLvAvamFmB6Ptgp3IhApEAinYR1sKhPNHMXZAC+d8zEWa+r5FhNIOrXEWyxP75K+61VwDmfjpV0yDaw/YXkSpSUFnSeQDa+BH99LsvPZiBZHSlzVvzB5M3Tab0WfWALK42765CMH4tp/EPnKpW3k9A6v83Wc3AAODh3tdQkczqibZQ54AdJtLsDPW44dmRG8Yhf43PC9416wGGLCCPax3Gt755tgHLfhzNNqV9i4bZqMc4KheZkghZ3HG/i6ePbVIvCcDjj2dciTCEc4Z47cFx3wNPm8NWeVkRqqYDkO6FNA4bQA4seNFqdkNjwvNaEwpNDEShuHTb9nisBlySi2782FIIs+QWyugxtENP91ehKBR0Hp5vZZfJW8/Ukk+mNN+VEq0e00f2j+bbVCZ8jkD8E7gq2H1AtJS2lmnetK2jFRkCNpvi4WJvJLCqYL/of/K1bZ39blv2iQDsxOA4fWDGu9WjaDx0MY7KaE9bb2XZk7szNhDH7kbe4ud/mEJh6SH3eLQgrXWRKL9hXy5uPJ7hRlocAJJ6wl9JT8HsIxkfVIUoWbuWqDrgzl1LdHw6d+flKfDNQxwW0Zbro7QYBhspsCVkGp512mMNhu9hTKBkK9uqfoqaQTPsEX+8d4oY0SW3JQBrV+vAwCy6Xs+bUTqsap/MDAQRuk8B9pOVNtydT+oSf8kzISdbKFdgFdONFdSTLbwI0k2e8NzN8/Sp7mDwIlyWoxFHrLV0nWH1QUWVm2Hd/vWHyxTYLXjbECgVeaFWT9416Bt+ZwVXgw1eD4Ht672AXUpJIAsUph6bg9FMD2ryEOn5RlhslWM1HVK/91CVSdwq1lo1Lvs4n0VF59f1dBAnfulB4Udzgw90jPL9caJMk9QX2QUXxfOafURnsjwGgndGyQukzVZJfx3uS65GyVAEie2oRTdN+AJFDPbYZFsD0twI3oDa9b57ZBjOuOrVGpAEz0jGnDPMnEBtBGR5/l7PAZnkMO/P22695aPybuewI7eUrJJ+mCPGoN+o85pMIJMYNvSbrq8x2P5iVv/M3u6M0vEP/jtsmZZqA+UQ2tWJFnH2sNbT4CTTY0iSguXKwWb X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 574b2aea-b45a-4289-6fa4-08db2af6d564 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2023 16:59:43.6788 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /zjgb+F1bBo8UWrfX7aNQlrnq+N+zKL8z7UO27F/t7N9DX/0WxT4FfBZrawbNUueRSShVvsh92TONJYO4pIaSg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB5238 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761088988782036192?= X-GMAIL-MSGID: =?utf-8?q?1761089091086467806?= Use kobject_del_and_put() to simplify code. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Damien Le Moal Signed-off-by: Yangtao Li Reviewed-by: Damien Le Moal Reviewed-by: Zhihao Cheng --- fs/ubifs/sysfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/ubifs/sysfs.c b/fs/ubifs/sysfs.c index 1c958148bb87..9571718e61a9 100644 --- a/fs/ubifs/sysfs.c +++ b/fs/ubifs/sysfs.c @@ -130,8 +130,7 @@ int ubifs_sysfs_register(struct ubifs_info *c) void ubifs_sysfs_unregister(struct ubifs_info *c) { - kobject_del(&c->kobj); - kobject_put(&c->kobj); + kobject_del_and_put(&c->kobj); wait_for_completion(&c->kobj_unregister); kfree(c->stats); From patchwork Wed Mar 22 16:59:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 73557 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2461756wrt; Wed, 22 Mar 2023 10:18:19 -0700 (PDT) X-Google-Smtp-Source: AK7set8CcDudybaICSWfR/ewULPewUlPh/RZ7juiXRvcnUgEHDGkK5gQXO3lZg2E9k/6HKkKwc4c X-Received: by 2002:a17:907:c08b:b0:8a6:5720:9101 with SMTP id st11-20020a170907c08b00b008a657209101mr8711304ejc.4.1679505499621; Wed, 22 Mar 2023 10:18:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679505499; cv=pass; d=google.com; s=arc-20160816; b=t0T4KrMm7IlAsul4fiX67UJBkv2JUppRbLb3Ig6KbnBcf2EW0c65OX157hSK0Cmrxk fqMS769RValGFOeWcNCAWv9xv9Odh7QVSKwdI0tj8NbfZivpaMhe6t7vrr04x/DDSN1t YFua1Q8eO61d0shk5lzOb6kW7JVA9/05nZjqk+Fh5a59JW7MdrPLd33GnUcvo3EXjIj3 Ly963KDazO7jUn+rGuAUgrGS51Azv9rnh6t2QlGSN6n1537vGaXbEnqxs0nAvKEvVbDR 01GlSEHWLq6zj1z1wia71rMLcqRWjAnXWOvFQApMpNn3cZ6fkuS/D/AdNPb+EKAiCrFp U2Ww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=V8liiAhRP3jWHYEAcCPeXHcbpyXMgVmviKu3w+LZzZY=; b=UyVl+AbNRwZXEknFIOS1y6ckAsZhFOSI8YHzGTog5BQdbnncDU50HoJBQ0nRQ0Qvxh uN9UPrAzjmriaVb8EWdlUGeFpzvTvu+wW9idAnPeJLNOdNRBmxAJcouVLUrSGC3mNK+n lgp9eeLO4E7U6bLo2YBECx2MsxjJAi2B+bP0qxUo7eYI3nW9BAumBLC3DAfyk299tLYE MPoa1lzDSXkQRfb16btR/AHHoKgXh3w1M7BDnXg1ApbbEP7u4XFLeLQWfFEI+NbUkCCJ rUAlk6I2NebFbycJ95tEied7Ke45uLR+QwtxP3wPgBXGmrDF4+DMvdr59hT27c8mroTu SzdA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=mxau7oYt; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id vv8-20020a170907a68800b009327ff6d591si13111235ejc.224.2023.03.22.10.17.56; Wed, 22 Mar 2023 10:18:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=mxau7oYt; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231361AbjCVRAX (ORCPT + 99 others); Wed, 22 Mar 2023 13:00:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231253AbjCVRAB (ORCPT ); Wed, 22 Mar 2023 13:00:01 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2094.outbound.protection.outlook.com [40.107.117.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EB1F4FCEA; Wed, 22 Mar 2023 09:59:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IQSRA68JJTxYODBuWWq5271Y9IMi4icgpv+sNiYhuNS5ZyC240Man4CrkNZPQSp5+yzn7A/Nz4B+PB1Yz+r7rpdZXCzlf8TRuOFKquu10JEPrlYNSgefrBo1m3QKZtGI8N+QZwhOnhsJxahwQGETwSG+0qFJobbxwtA3Vp2dV0Zx6GuZSZx7+I7mFa7StnHdTAZznQa5tbJPaWFMOBB76GsKMXLHpDtkynOBczOfteDGknb6Jc4sSTP2xlkmm7UW+AYJEbKA9X6fe3TDEW4hERXylPplhi5L3OjhOind1gzlEpNvOZWIUMjv9DXxVDTe4o6qDaeWK+17J09NNKZpXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=V8liiAhRP3jWHYEAcCPeXHcbpyXMgVmviKu3w+LZzZY=; b=l+oV2OLceVBASoNi9DJvQZq+1HxoZeH8Ibl0dd3z6Mpjrc4I93SLTwHsjIdyPcI54t/djTVN5zFKV5DMgfLihYRBVE30A4OQ9KUqjL4SEw4hdMtGDF4gTQKJP+ei39o9l9gwqg7oxtMtwQRXahioNB5u7C//JXYokHOi8bJNJfBTzWU88GbMqW7t9B5lNVaKr7YEf5Oy2JvGQK01HFpp477TCUYN20bTvisMtt9AJJA0t5P+mmmTuuXYS1O9rF0Drj6X5ipBwfQAsWO/SOv4nyJ6HVXx71g27+VEFgd7/fs/2SBnroU1Q1HEShobCVp0RulvN4sNcLAMv/Z0+Zia0Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=V8liiAhRP3jWHYEAcCPeXHcbpyXMgVmviKu3w+LZzZY=; b=mxau7oYtbMzTCsWfZ4ZLpQW5Z3Cg1KTcOM1TpgF1S+gyMLcu9QmaqBR/p1P5W8blIcvmN1KcQmjyyAkFLe/ys1zwY1oaCYuca/TwK6kuQAQpgEEz8KYn1o9Vhj6cj5NxSMmKT7OZtgfwqwfPpJ20hvP9I6F1Kkb6dM/NyWWD+Cazp2zwZdsGU2+SvHjcdWpw58oesuNJHHJfTRCIOp7P0r+fbyeTr4JZgWEuLtfiSLvic3vuKXmWR7C8n4OQL7bqaRe7YfYcsP2lsOf5JBIFJjFyDVJY82a3oh2VSd8CfoertlbZFd+vpIQMsDjocpo3AbPqXxooUXmzfPdKzDXvCA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SG2PR06MB5238.apcprd06.prod.outlook.com (2603:1096:4:1d8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Wed, 22 Mar 2023 16:59:50 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869%9]) with mapi id 15.20.6178.037; Wed, 22 Mar 2023 16:59:49 +0000 From: Yangtao Li To: Chris Mason , Josef Bacik , David Sterba Cc: Yangtao Li , Greg Kroah-Hartman , "Rafael J. Wysocki" , Damien Le Moal , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 06/10] btrfs: convert to kobject_del_and_put() Date: Thu, 23 Mar 2023 00:59:01 +0800 Message-Id: <20230322165905.55389-5-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230322165905.55389-1-frank.li@vivo.com> References: <20230322165905.55389-1-frank.li@vivo.com> X-ClientProxiedBy: SI1PR02CA0012.apcprd02.prod.outlook.com (2603:1096:4:1f7::8) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SG2PR06MB5238:EE_ X-MS-Office365-Filtering-Correlation-Id: 8c93a3d4-68ca-4dd6-8f01-08db2af6d925 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HEH2ltGWjIXrnrAZUjcyPCitKak/i13jR+Ws9zZVhuvbEl1QlVub+7p1qj0JuQnbgAXKfVWgSnWJP2w1YVCeXqDR22nYE5UM8EsyQgeOaNNe7sBtNeuYNn7dgEa9vVKsTN5folFlLheIGrjfSUzGMTvCIXNFqcNY8DXbF3uNYo6R8iFUaeGttzYGg7MTTq7vPCaUj2F8RL15EUJ6zIfpFxoz/1EZQDdcEM22Cz69r4tu/6hDrPD5iBhlvP+C9vj4tlIDcR6TzF1lVMIeEkdnjpkHYNGoxnhPgmtSpz3oTVVGmTsDuOw9HYJE7eck0kGdsdwvb2wP+h49JNxl/WUyyPprxYUXC0rA1FUvEO8E964t7ciEjiJjm+xtP2rkbAJ5lBCnl2D8jcP5+4batKive4ECMa/3S3D/QtOtmjssFl8qgYs5MFubXYO7TqOTKKuOVWq67XEJKr/POkLbMjjRbt6LDVtxpHgF4n0zUuINc3O9deWlqTIsp/9iQJ2Huy+lSQB50nzGCIaKSxL2U74TtANI2Qo8634hXxjLkF4i86jM0SNorKITEXXLO8YOU3nkbkz07Zdp5M0OQY0GTNl4ij5aEpzSkVuQMxhZfJB6HngqEtTHd9W8GSbyWkTHxj6aYw3Lm49tvqP47dYd+MBW4XgliqC1bU5Sf7eadN5RH6KT/9ruYmL7cSFoCWxCiq6jAEEqW+2sVGBpggXHxaKT3Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(136003)(346002)(396003)(366004)(376002)(451199018)(2616005)(6506007)(52116002)(478600001)(6486002)(6666004)(83380400001)(110136005)(316002)(66476007)(66946007)(66556008)(6512007)(26005)(186003)(8676002)(54906003)(4326008)(1076003)(8936002)(41300700001)(5660300002)(2906002)(38100700002)(38350700002)(36756003)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: I6eb+6MxFN1e8eMrNgOeaXwxkwRpDqZ1itx6fxW4C1fkQTHjsu1o1U+8ZaUnwYuRVyakgNyKIfqOm5Vj7HaF5JLjvgVV4FtHeD5lN/gfSwnOnZbHyAJGqNRtqsWqvLch4826E9U3xMxyGxuPCh+3kwbD+EurhwXxOXoIWx/+h+9x1bC6XYaeIGzvMruiqzWuVxkQx7wRATM0UQHHkeF2riFf8B6EuhVkcJjs2dSJ+TtW8tfQuERRMz36k279cDarheTnJDPLJeOoY3IzKuMo0F0Etn6wXfp+fosF4sDLn+NdvXZpBILMsLMZQpMnOVpwboF5qrw3hNnPaFmTb9XaPBrkJnFLgYVykOOkOljPr5e6Swv285z4TXRPrYGZ7tr4+1lyf3hBIvOwAtK9+/H5UHq2Bfqp90yIo9cQOq7gHeF03yPwLHyQMDTlb6BgjL/p+jZzMkRNJyQ1m5q9Z8o+6ubifevuaIYpIxgIBji4t8jjNWSMLsnpGl+0xQUFSpsV+1z6iNF1Gz4Q6cDKAqLMHIlzMMPw0Bt1ioETeRWe3PVPsEoGBwncdWd604o+ig9blgjNKCsyJ4Y8ngxAxlQCkaKLERUhSF5Sb3+iJyfOBISNiXES+FybcJd0yl9LDbHweKKUSK2xRhB75/uer+TNnM0aF8MbzdkcQKaqO8+zpHleaqg8j6TvB+5M8cIY0FakbhSuMHWuc56/t0trO5qqfxhetOdiqtMV8KI++Px+C7tdiRpOkJJ5UchI8zMiLQVPvSafbPA5yjE1QjwPcIqgFsrjdCYkE/AB2VJQjD7GEaNe03RC9RTNC2cKZffGax3XEsf/Ez4j+B0Kesz25nGDt94kCRkEhD+0d5kndQxTclxdeB/zVfKC36xfQzvqa1fX2hwcZs5sufM4uWHBsz0LwklY7QWJeB2407ScvO5aSdoL0BxfxbapYEPv4qS06c7f3MJCyfiSPAUidZbMyyAUcQGUukPhKOFmSoMPBizHvjE7RU0jIUb9dsoI4sdHD7bKlQ6AGA3k75tOcB3aEaRquzhyrWUMHByHzXfm+JA1cB7XZHDmtI5ay5nvxlBynXM+KW364rc1VpB8wv40wYl1xB1nMDSW6Sz3owSQLTB8xVGJ9nuP1MCkPIYUehE6eiqZfSn2HURSlVkwofvxBR8mVpOquuuP8AjRlRqEj9/eIM1n59MCkajGYYQXEUBQpSWRfizVJdrUJUYfCDSQ9GOyTB3STOKhSnmWP4xSorSOrHpmRznYnATOEY7em50xZ+fiapd0YZEGKg87R3G3bCOsJTbknxuAabRrcjzkfrCsYG+M8/orb2jsaddBDQvV+kWh9RJqsjbNUvbt3+fxTem755DWL3Otek3PQlPUwMKGBLBcZ86LugHpNLI4HtVJcb4s7qs1zXqlxKd+kg+Lvt/dxeJrm7E/J02xmPiuA/sMP2tENAiWA/H2VxrNvMYpzIzJM0/aJ10bBIFt5hHaAS3dJxfnx0XzKENxx7n1fbdj8ZDr792Px2Bsw/Yu8CsX00IpXrC09kR3g3QVUoTWc0vAVGgHvyNuzpeN12XTcx483B9TC8JIeZH9vq5rsyigCOuo X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8c93a3d4-68ca-4dd6-8f01-08db2af6d925 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2023 16:59:49.8370 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: P9LR7c8BQ7IG888oPxUMRAidFegL4EjLm83RedobsfV1SFw1NwTCfpDcKTYarqObmOmrpCkARJ6lIrMsIK8JIA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB5238 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761089158764124380?= X-GMAIL-MSGID: =?utf-8?q?1761089158764124380?= Use kobject_del_and_put() to simplify code. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Damien Le Moal Signed-off-by: Yangtao Li Acked-by: David Sterba Reviewed-by: Damien Le Moal --- fs/btrfs/block-group.c | 5 +---- fs/btrfs/sysfs.c | 38 ++++++++++++-------------------------- 2 files changed, 13 insertions(+), 30 deletions(-) diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index 5fc670c27f86..a2876235c6dc 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -1125,10 +1125,7 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans, } up_write(&block_group->space_info->groups_sem); clear_incompat_bg_bits(fs_info, block_group->flags); - if (kobj) { - kobject_del(kobj); - kobject_put(kobj); - } + kobject_del_and_put(kobj); if (block_group->cached == BTRFS_CACHE_STARTED) btrfs_wait_block_group_cache_done(block_group); diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index 37fc58a7f27e..49b837561135 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -1390,20 +1390,17 @@ static int addrm_unknown_feature_attrs(struct btrfs_fs_info *fs_info, bool add) static void __btrfs_sysfs_remove_fsid(struct btrfs_fs_devices *fs_devs) { if (fs_devs->devinfo_kobj) { - kobject_del(fs_devs->devinfo_kobj); - kobject_put(fs_devs->devinfo_kobj); + kobject_del_and_put(fs_devs->devinfo_kobj); fs_devs->devinfo_kobj = NULL; } if (fs_devs->devices_kobj) { - kobject_del(fs_devs->devices_kobj); - kobject_put(fs_devs->devices_kobj); + kobject_del_and_put(fs_devs->devices_kobj); fs_devs->devices_kobj = NULL; } if (fs_devs->fsid_kobj.state_initialized) { - kobject_del(&fs_devs->fsid_kobj); - kobject_put(&fs_devs->fsid_kobj); + kobject_del_and_put(&fs_devs->fsid_kobj); wait_for_completion(&fs_devs->kobj_unregister); } } @@ -1445,19 +1442,16 @@ void btrfs_sysfs_remove_mounted(struct btrfs_fs_info *fs_info) if (fs_info->space_info_kobj) { sysfs_remove_files(fs_info->space_info_kobj, allocation_attrs); - kobject_del(fs_info->space_info_kobj); - kobject_put(fs_info->space_info_kobj); + kobject_del_and_put(fs_info->space_info_kobj); } if (fs_info->discard_kobj) { sysfs_remove_files(fs_info->discard_kobj, discard_attrs); - kobject_del(fs_info->discard_kobj); - kobject_put(fs_info->discard_kobj); + kobject_del_and_put(fs_info->discard_kobj); } #ifdef CONFIG_BTRFS_DEBUG if (fs_info->debug_kobj) { sysfs_remove_files(fs_info->debug_kobj, btrfs_debug_mount_attrs); - kobject_del(fs_info->debug_kobj); - kobject_put(fs_info->debug_kobj); + kobject_del_and_put(fs_info->debug_kobj); } #endif addrm_unknown_feature_attrs(fs_info, false); @@ -1620,13 +1614,9 @@ void btrfs_sysfs_remove_space_info(struct btrfs_space_info *space_info) kobj = space_info->block_group_kobjs[i]; space_info->block_group_kobjs[i] = NULL; - if (kobj) { - kobject_del(kobj); - kobject_put(kobj); - } + kobject_del_and_put(kobj); } - kobject_del(&space_info->kobj); - kobject_put(&space_info->kobj); + kobject_del_and_put(&space_info->kobj); } static const char *alloc_name(u64 flags) @@ -1681,8 +1671,7 @@ void btrfs_sysfs_remove_device(struct btrfs_device *device) sysfs_remove_link(devices_kobj, bdev_kobj(device->bdev)->name); if (device->devid_kobj.state_initialized) { - kobject_del(&device->devid_kobj); - kobject_put(&device->devid_kobj); + kobject_del_and_put(&device->devid_kobj); wait_for_completion(&device->kobj_unregister); } } @@ -2255,8 +2244,7 @@ void btrfs_sysfs_del_qgroups(struct btrfs_fs_info *fs_info) &fs_info->qgroup_tree, node) btrfs_sysfs_del_one_qgroup(fs_info, qgroup); if (fs_info->qgroups_kobj) { - kobject_del(fs_info->qgroups_kobj); - kobject_put(fs_info->qgroups_kobj); + kobject_del_and_put(fs_info->qgroups_kobj); fs_info->qgroups_kobj = NULL; } } @@ -2304,10 +2292,8 @@ void btrfs_sysfs_del_one_qgroup(struct btrfs_fs_info *fs_info, if (test_bit(BTRFS_FS_STATE_DUMMY_FS_INFO, &fs_info->fs_state)) return; - if (qgroup->kobj.state_initialized) { - kobject_del(&qgroup->kobj); - kobject_put(&qgroup->kobj); - } + if (qgroup->kobj.state_initialized) + kobject_del_and_put(&qgroup->kobj); } /* From patchwork Wed Mar 22 16:59:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 73563 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2462247wrt; Wed, 22 Mar 2023 10:19:27 -0700 (PDT) X-Google-Smtp-Source: AK7set9DJgccdpRVEXB9KeR2+yGqD9Sj10eo+HodT8iGHqeCvMGrw/w8phkl069fD62LCvQbNmFT X-Received: by 2002:a17:906:646:b0:8a5:8620:575 with SMTP id t6-20020a170906064600b008a586200575mr7784514ejb.3.1679505567734; Wed, 22 Mar 2023 10:19:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679505567; cv=pass; d=google.com; s=arc-20160816; b=FdHwcBq69NOrWtj//NjEj1avP+sNZO13K4wOYBhZBdkKUZXtrIc8n9RGb+DauQCKNj YbsPven+iHdgIamRwuwiSIsjYuArptr14fyDqNq3KyufD4xsjCHiH7EYkalC6u+MmZKh lNoQEcwY1uPDdAf5ZtSAfTJqoLjRrY5xEigIFODmsAB4SJ80WX2F+SY59t6RkT7LR09t D3kAgaDrK1lR5/WxvzN/hQMxW/9Y//5FUhAb5idSsaZFNOw20DPBRtQQpLmLGEeryOLj AxG1K65pVPSC4xO7KRAqtjb+4BqYSl5sohlV6zuiCHJul97YArWYRUyLlticQKxJyW0K 2ceQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WV8vWGKFQ2SpsYCXDRkcEes8uHuerA+1iOZq5yPEi9w=; b=vye++XJPbZC4SaVmie2Bs/ytapWbnVzioXgXF5bhbJkABWQlRhbOgEhlMqmpDerfkj aw2KM6YHk5+JCV4FsOqDngk8CQgl6IZzyRGfdLObZE1o5CW1u2SsjUZ2s+7+KIlP+QMB cYwwWuLvTxQ1VSdeZLyUk74oE0Yxpe6J/Tdj9AVLlrsR3dEs/TBn3bhh65+dxYhI9dcH bxr/5+vEM1Od6KYNJiTaAKuChHrsXZUVpw+KPkN7pox8Awo36oPLu8uUMNehOjfuW+5V s5Lqotp3yWM80I45wIi/8n//d1DflwdArKzyOchYdrhQNdK4S4IWklptEeLHc9M1Lo2F HxxQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=B2wbSRQU; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rs1-20020a170907036100b0093bab66424esi1701302ejb.773.2023.03.22.10.19.04; Wed, 22 Mar 2023 10:19:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=B2wbSRQU; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231272AbjCVRA0 (ORCPT + 99 others); Wed, 22 Mar 2023 13:00:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231267AbjCVRAC (ORCPT ); Wed, 22 Mar 2023 13:00:02 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2121.outbound.protection.outlook.com [40.107.215.121]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7639C2823A; Wed, 22 Mar 2023 09:59:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oY2WDcniWteT4RngVY7hMP6WbEIaFQPuRsjU8Pc+FuOjNMy0hkSNQwFkXwHp9H53INUjP6qUd9y83l0H8kx75PYH3VR4Xik6hDiTh7qzAOrpE1/JSqrw0fxySohv3lKSEqxFssz6W3sjhIawUTpHGab0oKofZQtKV/Ol/+hD3RG07k1+5niny1wrWzUfpbV8FCjRf/fAoRZZkCQqKZe10b/jt+VbTOlNHYOi5tM3nqjNdfBeLK2roTkwQwoQ6NBPZjFIq39lfvGHvDv5gOKkWZw10Phmxa9+uwdAVOYm1J8DobhtbOCZbT+xy7s+uGeK+e1snlNh/YUCv++Zu8QJQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WV8vWGKFQ2SpsYCXDRkcEes8uHuerA+1iOZq5yPEi9w=; b=FkFJY8I51zoEq6SjBpeKNuDTjGoAR7a3prfvx2AyM1hBzhJ2EDsv49KmdSrKfYomvymPH8uW3SuVDR3k2EiTqPBBoUh+L3Snt1hoCwoROlsTZKkgeuBdN55Aqu2bR9nqKC67APpoxu9g3bz6AIeCOkwuN8+0i0cYLfJsVfgOKLRBNk1kFoh3uJC2Y3Ad5Ys+NWK51aL+4HfBgKMrfsw9h5Lcj7nH3eYWF1/KxQzoBE1DG2imm9k1sdr/oFwccFnl5GukEpehUaa9v57HVlgP0mWi007SlCU28Ry1zBicqSkQYUgykDnk7uI1xstNDNyrWGe7Fm492gq2bLudd4++Xg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WV8vWGKFQ2SpsYCXDRkcEes8uHuerA+1iOZq5yPEi9w=; b=B2wbSRQU3Lh1dcYFSAkPoT8TPBEA6fOM725RJaouswD/vXW0i/jJRGQ8KwyWrcj2bLEwBZTYN65UF7K63y9LfimbFNGbGQbA9xX16TqpFTFOHdKIeoZfb4Au5MMgd8DDx628l/xfrUNDA06byuU6Ve0Am4jSlSXHElYCUr1VB9P/HQZc4Z4gS4AlJrFFTJ5q66RQQHX3U4hZaT53qzstJMClbNyJm0fHIaidVaKxWnBXuGS4HI0gjkng6QsJaL65lcvbvdgUXN64BmUqp+D8ZZ9uKiQ12AkBM/6BXqqsKAZFWHbFU+p/EggXcnPkk0pK8UPtF3mkFHnC5+aYK4b6JA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SI2PR06MB4107.apcprd06.prod.outlook.com (2603:1096:4:f1::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Wed, 22 Mar 2023 16:59:53 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869%9]) with mapi id 15.20.6178.037; Wed, 22 Mar 2023 16:59:53 +0000 From: Yangtao Li To: "Darrick J. Wong" Cc: Yangtao Li , Greg Kroah-Hartman , "Rafael J. Wysocki" , Damien Le Moal , linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 07/10] xfs: convert to kobject_del_and_put() Date: Thu, 23 Mar 2023 00:59:02 +0800 Message-Id: <20230322165905.55389-6-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230322165905.55389-1-frank.li@vivo.com> References: <20230322165905.55389-1-frank.li@vivo.com> X-ClientProxiedBy: SI1PR02CA0012.apcprd02.prod.outlook.com (2603:1096:4:1f7::8) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4107:EE_ X-MS-Office365-Filtering-Correlation-Id: 6e199792-08c1-4890-65c8-08db2af6db02 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P9UQmxOb85J1qfXFMo3kHjkDDWlmoJqGNmA6Zf2mN8Lz9eAz1SZX6BSil0qy87Ddq4SokHR59iRtal1vuHNVeqScNwEO6frwj6SdmaBRvP0tkMwMc3iotvYELgT+nX6vsUSYqD/1S+ijxXzPKAp8IDo5ZfCQIP26sCqVSSiqh5Tagtn9DV13/3cxjPQvu4a/WnDx9q/XiQDSJ3EMY/ZOyUsvnU21IK7Smwz9an0ZijWHgeccV+l08C8fefKf5jPyICsPgV3kV1Vke60WLff+CVhgCAVehOMY3GclFR3AL+jSAWX0MF16Gj2O7poVM8iKxam4bNY6mtmiwckCiImxhwFfcMl2s+xpvMJ4rvQak8AKGx1PAgR9xvn4moOW4e9F7KNtG4tE8af2avjdqPtf2pi7CMZtIy/joKVCORMXzFE61xnnZ7kCp/5PpLwliQHSV56+1c8nOeP9Z7xbICcgepLIrVApzVRP/kIm0C3Bf8vEtxAokpv7tjHqOZQPwsE+3Cn0bPSS+vT4VuZVH6n/q1NJIROO9cIJv6VaovLwp+3l4U65vAX3XkPBHCj601LtI+9XRi40bxW7k/No91aYQSJ/6flA8c5V/P1s2yh6xFG9haePOgHQ9W8TxtH8XWIl9NCDqALgKzw4wF552A6fxlBg9kP3CsZwHnWc9h/UwqU6izJN1WJl5mQ5smU/IU4O5oUV3h1fnsnlHtFYvILrpQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(396003)(136003)(376002)(366004)(346002)(39860400002)(451199018)(6512007)(2616005)(6666004)(1076003)(52116002)(26005)(478600001)(5660300002)(186003)(6506007)(6486002)(83380400001)(316002)(38350700002)(38100700002)(86362001)(8676002)(66946007)(4744005)(54906003)(41300700001)(36756003)(8936002)(66476007)(66556008)(2906002)(6916009)(4326008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: u4ZSM5A8Tyt9IzAtaQpqu0z6C13X4yTMYnkVSpJMA4HdtdrKlnXYbT+mYgJfHxLVTR0yOwQK27S/IyUoYIzzepu5dT1PY+ratLW7wSZdCe+pKSOi/U4/ABZ1RDS0VHrn3zMPDz5QPfEXbm5hOxFr8guhmkaOmFub71k0MxIeLhUq0DL8p3jyWiRGB/w4FMN/b8a4EqxrnjIaKQON9oo7vRlAhW/RuILz1b3QQoqJqn8FAk9lsXoEhM5Arn9lRUs7CJfhvvX4FsdiL5j2D28akLOcveYT0inEtS3xRNawdAlnFepUsGUpum6n9eVPe+x9VoS6kP6gX3TtcTMuA6DFBn3MggcO4oipHNPWFd+sHzk4bHjz3pEhW5iRI3p+1/AOU5jZ8xTvh8uiAESvuD8ArydK7/FbMcxBHzhP8B9EYd9yFR5Z33VVdmWH9s7jwHetj3kbgcQkm+ALZpXQgC/BktlqT7UYFYIw208mK+a86yvINTRXJ8QKHul+ZG3gKmispGDWNlWyOLUBt2HVlQ5/Lk6R20JAkIo2LK6XaIOTvmzlsw0GhmmAHqHCQDI1eBkSBiQWyw8knkOOyalL3HhZZkz30gT+NGz+guhKO5QVcYsinwz2S9lvX42Te2iGRfW+dw5TiD38IkqIzIlNHOOviDCyNjvUyizgsUjQpYs0hGXt+d4Cy7PWpRCIYp5WI7Psj/PPR5TPb6EDxpjVlFWhT4u7bM/LSCxQkNvTZEBUEv523sr2PRjiD6c1bZBUufFnSrcoDD0NZddiWV1iI9LTbcAx5RaQArc1Jm7X6C9clUoBGSDDNG76BAocR1JiUOBZ8KgB5dm2DsIFrk9dYDrwHG6VSScNssaJ4hM+WDxb4hzaod674OPzU8NSZCDC/h7oJ8ftKE+JYdT6QAJH4cxccAsRnBwMKJo2SSwVmEoNlOegLMxPhjtUdF/OMTOF9hWZ2GaPy4/tt5GIKTA26px0BuexMpvsBoJVoT5eoDEb2bfdYiOls0QFgB79wEhdeKQxJILy4A16vD0ujx9I+iSgJJUdG4acwjXF9S6OePCvbTfmIQcGPENVsqNBp9hxdIlG82+4AQ9g9Xaw9MpBw0h4S8E86i2Vz43Xbb3o+CAh/k5fv+s+JVVyBrR2l8dxCVsgDmMUCdyTHD2Cuj7WPMxXxMzJK4OQEWRe1F8ZYuPjxujfOsAQP2/vdgf8QkEcATKziXaDUPBiocrpJIa0zmcarpPU4X1DOQNFA5rQRR9xR0CIEzDpu2JgrNeP1Tgv+l3g+hsX/DEsvyUI4VG28W9EgboaJUujLlwpBQXiy7aNiT33qO5x7FUuuWqQ3Enle+xWV4LrY/yyy4e1zrMpq+fV2aq03ZbtU+WncLhlOdH2GxmBV1zxrAuANspe3W8ekoM/5elC5C4/euM7/QAlqhrUQFqfutRWeStzpaUgisYk2MOhlmmLxnYjrcVE5fJ5oM7Yx2RcXBLJI17mVDDW6ZmsMK5b85eoPHE4M2D8+X/iRzyt5vNjooW8RqiDT780gS4yvTQMoILD9+B79MTbVjYBVUYpfcBeccophZSCijken9loYzxGDOvzWUFkWLqoE2bf X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6e199792-08c1-4890-65c8-08db2af6db02 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2023 16:59:53.0557 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0woDf1NxD3GNWu84fo0lVD1uGFExiZTkyUkPO7w1i/u4tuLvYHkf7oq9qRqE69sPlBMJvtegUZGDSlbLXT/Tyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4107 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761089229884942523?= X-GMAIL-MSGID: =?utf-8?q?1761089229884942523?= Use kobject_del_and_put() to simplify code. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Damien Le Moal Signed-off-by: Yangtao Li Acked-by: Darrick J. Wong Reviewed-by: Damien Le Moal --- fs/xfs/xfs_sysfs.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/xfs/xfs_sysfs.h b/fs/xfs/xfs_sysfs.h index 148893ebfdef..e2ff063e2c29 100644 --- a/fs/xfs/xfs_sysfs.h +++ b/fs/xfs/xfs_sysfs.h @@ -48,8 +48,7 @@ static inline void xfs_sysfs_del( struct xfs_kobj *kobj) { - kobject_del(&kobj->kobject); - kobject_put(&kobj->kobject); + kobject_del_and_put(&kobj->kobject); wait_for_completion(&kobj->complete); } From patchwork Wed Mar 22 16:59:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 73545 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2460623wrt; Wed, 22 Mar 2023 10:15:59 -0700 (PDT) X-Google-Smtp-Source: AK7set8WwvOtJ7t7WGNaguuRvU9FCjnu3qqHOA2zdtavUbgpMaOQgmymPCvFlmAEaHigiDkJCxl4 X-Received: by 2002:a05:6402:415:b0:4fc:eb46:6b63 with SMTP id q21-20020a056402041500b004fceb466b63mr7294568edv.17.1679505359212; Wed, 22 Mar 2023 10:15:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679505359; cv=pass; d=google.com; s=arc-20160816; b=piojB0AsnsKBMIdl+7JwtyujpStPcz0yvdMnPuP3g3KXZRUPzFMx+nLCXkL7MV8KU7 bugILG0yy+yi8f1qYipLGrg5IH/tLTMUYXA5YevC2C6M/L9+iSUBhPJ8p62hYGo0z9F6 9eQTyui1RpDqI2UR2cm+U7ddYIaGjZ4Uv9Ih+NF2DOopjUojgk9odjBHzi2nONcoVuJe JKoscwD+fpgK/vMVSZDTuDe94lOl0ER+yuhaW9Sbg/yLcQ0d60iw2X2+e5i2jthTNAIu YoMPIo4YXeAF3yX8/o3IxKC/HOHyutpgCm2SLm/T7W4ZUjacc5RPMhw1BrP7K9IlNG/b XXzQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pNtRww3+WurnR/ssb+TOIf0NNF1vkQf8qeCiNRBrFJo=; b=WviguvyAs/B7LEmYsvDkRsZhkPYJumDI8BRmwlVhIOykKSzWDAoNZXHhe2yzg4Cvna BaPEeurIEhXfCDCqMRZ5jShshJk40mCihOVfCZDQPnxpmU+qCNQ49fj7doUZxl8awfzs KyHMGVKT43Ja53Maqap7tL0zvW+p5hm374WDZAVOYTEY/UV8lcpBUG51fNmlyfyEV7Tn I6mr1qhi1xZsiPx97irjosK+8q3qIQYfV8FxNi/FHBa5lVucmL/w1YA8Ag5qcHloo9wR NYSO3vT1mqhFQEcYqjeScvxH/HgF/ukVVe9+1RDsiMQhv4+KG/3F4h4dhhTDNTa0P+53 r4WA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=XE3ghHas; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i5-20020a50fc05000000b004fcd1adbb05si14806418edr.210.2023.03.22.10.15.35; Wed, 22 Mar 2023 10:15:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=XE3ghHas; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231326AbjCVRAi (ORCPT + 99 others); Wed, 22 Mar 2023 13:00:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231319AbjCVRAJ (ORCPT ); Wed, 22 Mar 2023 13:00:09 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2121.outbound.protection.outlook.com [40.107.215.121]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B3DE5F6D1 for ; Wed, 22 Mar 2023 10:00:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EsMaX2Ln0gYXXnjF0ga8gs+GXleJJK4l0WAIaoA4t0U3ifLGRnY4O4phXxKDgkBuPBtTRnAqWiuBQL8yIyU/fqjDdd8obOvcef87CYTXYmyxvg6yYBt4q9P5VJMWDAn1R9X1DvD5Ame2A4RAqlVDz7S0NO8y2XdBA5TLJnK0ZjvvvxAVawp/uRNyp3bp8trCR7r2DKzKh8hDEmXrgLr8pUjXRC/hyo72YepqTVGPs2jkuVG7wi7XRElc1Yoetx89R1/2eqEdLGoHC470Sh44yfmCw15aQqjv6zcKmzAfwFgkhY9IRqh2kKSeJWBNSsUwRhsNulCU3ksdNh9DhNJw2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pNtRww3+WurnR/ssb+TOIf0NNF1vkQf8qeCiNRBrFJo=; b=k/SYhU3gLi0qHoKU1TXGJnvg7/nSZ24jc5nEzXCVmfZ0chm16oKfAC0c7wKrEwvPHvOuSfCum7S5A5Y37aLV9x2abNEKKORLm14IfurjrgPUYTW+n8ElYdF4zydKPT/HUrTiDaf0R/xGhnWzVzd0JE7cPwTam6844KdEb6vEfOsAFVTYxD/q1IRwfV7iRNWe5eeKF2VyAg+tbiUlr/54VXZzaSMC70OdJCw8hB25+RYvY5xnEuy1vwh6++qKJXruuZ0YaW/JI9BwJUkeqExsw0VD0oQp48QR+6HgPsO1LWfmim0yggUUymfbLGm2yFI+P80cgQ+ko/t6uLs59DinWg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pNtRww3+WurnR/ssb+TOIf0NNF1vkQf8qeCiNRBrFJo=; b=XE3ghHas5VmID4ddZIi6bW7Z7mU5WN/ugus7njcwadlqp4TRads8EjFFplE+aO0mhfeenX1jyQOgTs5CZZkP27s5lhBPDnumPYMlcsjOPLpyy2++7KQeCzYOJtA4VaWp2NkKRWPIwS3DwLbW1T83RL5/7q4sQks0g9hiAgLxqNwQAupwa3php+iTpnDYvUOTELF+auI9GtNSDLkPhHiBRWuHs3odl6WpmELt/Wgx6v2p49nS8jiBZAz3+Wb3FzSB333EhxSszOJ9BU3liZDu52+raLyLpVHgO9U6+9ahNwMkybVEtTCpEzThoFIfANHeS5U1GYqKO0+zK4bTByaW2Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SI2PR06MB4107.apcprd06.prod.outlook.com (2603:1096:4:f1::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Wed, 22 Mar 2023 16:59:56 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869%9]) with mapi id 15.20.6178.037; Wed, 22 Mar 2023 16:59:56 +0000 From: Yangtao Li To: Mark Fasheh , Joel Becker , Joseph Qi Cc: Yangtao Li , Greg Kroah-Hartman , "Rafael J. Wysocki" , Damien Le Moal , ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org Subject: [PATCH v3 08/10] ocfs2: convert to kobject_del_and_put() Date: Thu, 23 Mar 2023 00:59:03 +0800 Message-Id: <20230322165905.55389-7-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230322165905.55389-1-frank.li@vivo.com> References: <20230322165905.55389-1-frank.li@vivo.com> X-ClientProxiedBy: SI1PR02CA0012.apcprd02.prod.outlook.com (2603:1096:4:1f7::8) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4107:EE_ X-MS-Office365-Filtering-Correlation-Id: d746dff5-adf4-4331-1bd0-08db2af6dcc5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pkDIC8842PqoQRUBIHYym9rii+8ZFNM7C7EYGZCPuyEDSdmNs6huNFAyw9v7yGp5Z34ImpDdWTGHkDyH5uQRUZu16SRMLxPk/sby3FicdG3ebwSAeiQTl8MMMwzi63jgKcaEEjMubbsv264JGSVUVFB21gQQWyL/p82wGGx7TeaPXf6G41Zzb3MUKQIw0GAQPejcxgVhTBT/LksgzSk72IxstEaBeVcsUpkgRsr4/DDxhErNPHzMOC5SCdYgQBrYttUX3vtfQMxODYbX7lkzX6dolycIX1XL/2xE+RH264KTDIrxtztTLbwJfkW+ukyUkbHqpSTRtNX0rZBglq22b0y5C85MLzGzmdGHGiY9CcJR7vLg8moHQKnrEOsZ46RdzxYZdb3fBMH5i8uPS1j7d3Yuy0wtmbCzc6Z8/IJ4EdnEThZMTRd5++Fnz7otGnU7GK2ORZFIYzG3d+vZ2fIbrCdQXKYmXT9s2qvD3kOR93H+EE6JroLl9oq97pgSGcp/yJVxH7ZP+8UNr/y57LTiyTDEpb6o1m1b9VyucRh5E6xFyWpehhSB4zQmgx8PvWSkpTe2DgyhE553osckoUnFuvAMrfGG7G/FOw4P3lXabUceWi6q4J70LQTR6C8920MxPAJyKaAe5zbXuvlyDIfiQC9bEQQAU5FyxqUkE4ZKp0+5pPcYug/muJa055hb2GfJ50jah7vAtuLlyA+D7qWFag== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(396003)(136003)(376002)(366004)(346002)(39860400002)(451199018)(6512007)(2616005)(6666004)(1076003)(52116002)(26005)(478600001)(5660300002)(186003)(6506007)(6486002)(83380400001)(316002)(110136005)(38350700002)(38100700002)(86362001)(8676002)(66946007)(4744005)(54906003)(41300700001)(36756003)(8936002)(66476007)(66556008)(2906002)(4326008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: l1+S78XpM+CouZwXt1Rk4latGQCVLb076NKHd2zuNPYX1hdzVsV/ZWJHVZZ+FF4UnA+okT9atxx0BDVVrwnSxh+X6SvJm0GSarID8qfoev9QUn+jVZJBSfxTdPy2hNw7WJTib0woPJTWDDYXY9fY8EyO7sN6tqwDpI5z7KuclKwL2eROi51wFteaLQ+tPd+6y19SEzTo/rtil/yPs869jPM4GsW7/8Sn8N/7fpVw5eeRGlW67GEoPSBS3TWlv9W3IV8bhkdZXYSuzVh5QMiZngPFh2x/9htmmP9egBJiBESTRE9rOTgG94kmv8CtK4dl7Ssl8tTJ2BSrROpsr3BgJSAp5YFCJSzdH8ffg/i1VzciKpPpBl8JvGTlDdUGAKXDAqmJDw+wIsIveUT5EdMxsPiYzJzeWDsEomru8Idv7mv3yCGt/Vmj1Vv5EOBRGcKh9DtyOZsJZg1zxallMKst0ZMFFQFvacqeiHSl3zHW+hdbefC94JiCAsh4D9dpVX2nR6zOLQT55q2dL9vkMgmIewUjJOjnCFOTzmPmGMY5zRt2yBOBRDi93QL/7WOcc70WXFjKt/45LsHeoEn31Wc06NGlwax7AbuqgMPL4ktnywZsFXg7dE8o1MQpXBFgT2hxyEDmYLNs3SP0i1S/NYI+M+N7CaX+xzuiOtcsgBbSlsH4rkAsdyJmgRMX3skpHxwQyQHG2NzNXigb0e755Ry+wQOvKf2Bmguy8yck2dlEvN4wj3oLuMXVgwz7DvXnw/wwGUJLI4aaSZVILga692XsbijoYKlyGsnUys6bCSdeidbo0p7z+Y5unUltQqv2JYMegBaMlQT6JNeOLja3cRZHEPN2fB/LREnV3qRVijXDRDjAX11I1vNH4LhdX7A9/Eu5s8MpicE3JT4hcmb439Wk9uW9aW73W/8+8jtcqpMu2o71Z/T34ZFdprRWWVob0wQklWR5O7z91F7fIC13cz+sM5FsbGfK6n8nE7XxFloaLHg6SYGOzBnaxIy/10RYxjbsRGrMnB8nMDIY8Dq/Lsx6V1Vi0GoG0lH1rLzNMx+cmYasbw1Rbot/d6YjHwXpYuDdV1s1jhXB/Knw2CfsW+fMAQJf2MEWzAyNZh+ei1cmaI90WdL3RQoiYkpCyHS1YIttWikg+vCNzTDBOKFCQ9YvQ8yM8mqhnJr6BqNcjkt5JBJGvhW1fW+mFhT3vjNygl3S9omXfpOl0X3uLQHvQcBLfd3k5SdVvhpK6JxMSijGVhMYvZOatGirQflXyQzGRdpWCj4gCLwWZrpPoNYYQOat79AAtHjfx2PltgkfNN5/cSZMomgXbns0MU6yYzaQeIo5nAQGnb4i1L2rmuTvH0bNPW9qXK0v+xrdY0la+e3RjzAFRkl9mCudh7+I7PuPZXzy18qeS9kqcQW/29f1llTrZzj3svuGYVj8IJn/mrBCOvZJwVv4HlGuxds6nDiGn/TtsQA0NiA1zWwNo/zKPeAahG6eke39IejUeW62COxAKc2Zo5xqzyhGqPmGVqKP9nutwmxTixXamDvBjQX/PpeMHoQ1tQ+NsM2aosrXRfnYbSahAQr0JIzcN1F6QPBYbbSz X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d746dff5-adf4-4331-1bd0-08db2af6dcc5 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2023 16:59:55.9783 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RU8g0mPqti4noxp9nSPQB0Hjooh+40B+95jx1t/IMrf1d7CeYJUgXSjwJPGzDcsH4tspViaxVh+fb+YCL6FySA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4107 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761089011420264462?= X-GMAIL-MSGID: =?utf-8?q?1761089011420264462?= Use kobject_del_and_put() to simplify code. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Damien Le Moal Signed-off-by: Yangtao Li Reviewed-by: Damien Le Moal --- fs/ocfs2/filecheck.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/ocfs2/filecheck.c b/fs/ocfs2/filecheck.c index 1ad7106741f8..fb9cf601245b 100644 --- a/fs/ocfs2/filecheck.c +++ b/fs/ocfs2/filecheck.c @@ -198,8 +198,7 @@ void ocfs2_filecheck_remove_sysfs(struct ocfs2_super *osb) if (!osb->osb_fc_ent.fs_fcheck) return; - kobject_del(&osb->osb_fc_ent.fs_kobj); - kobject_put(&osb->osb_fc_ent.fs_kobj); + kobject_del_and_put(&osb->osb_fc_ent.fs_kobj); wait_for_completion(&osb->osb_fc_ent.fs_kobj_unregister); ocfs2_filecheck_sysfs_free(&osb->osb_fc_ent); } From patchwork Wed Mar 22 16:59:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 73553 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2461602wrt; Wed, 22 Mar 2023 10:18:01 -0700 (PDT) X-Google-Smtp-Source: AK7set9o3YQR2WIZJsfsEXLD0R4NWLx6Zx/QIKrg2gGyZXbg2L2JcDN/q3WDWIOZmD0Q5Pe0cvtk X-Received: by 2002:a17:906:2c4b:b0:931:cac0:60f3 with SMTP id f11-20020a1709062c4b00b00931cac060f3mr7071603ejh.60.1679505481033; Wed, 22 Mar 2023 10:18:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679505481; cv=pass; d=google.com; s=arc-20160816; b=McbzhWl+B5yfzw4j9b5+JreDGp0UMGw1D1MxbW2EwRO8dsCX75Kg6t7PVhGYrJnyT0 ZqGfsUN1BdGxyAHc5bVHjHtKxNPG01TIUhHKQNwkwhenREDSF9w30cNhc4Dpw4PqeGvK +AqU7Wqbp7MBi5dMuBju66rwOQWzVP+KBdwbh61Xq63sWtRetpNVoAm3v4UZPQMWKwj9 BTuPfBfzTyWk/Y3hHzUqBQTO4eMrkd/IuisVwlWn4yM86gMwc4W2Xdu3kxktjxZslZix 4x3L6FWqfcNUsMP8Zrf5LKzqcyyl4X7OVQsTbtlToYHuZGjnPzIRl0tNfLMTkXZ8sG27 jwQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EC23nHvmsjk047LeZyGTlxwogRKKTMdhTbyermoaPGI=; b=Ex32KINIu9ZMq8H1tZ7lMYwdBDWN54BNEs8uISMO0N+e1n0BI5NSHdSXoee/lsJMUu ACIZsNfUoV5LiUSStqKZmwMKRY6dKVNlINFe4qUlqgrG0oGe2xK7TKKuAqaeo9EssrtY Jr/hNVaAFWe1LmFrTSHoskCjKHtKQVoD4A0OrwGzE7wAhOH/ui6xzCMCQZ5IdBH4Iu9v QcMDtOHXh276wkpoL1KL2DfCF4sFCYD8TGV/vEj+FQYKeDLHSNmUmcU2+QXaVOoZNdlb EDPwO89BPJOsqFSd3PyWTUK2zriouxQDsV2NWuCZoQRyhtkmVMFeS0WfDXY13oYVTPMu ymvw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=Lk1xwnCQ; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lv26-20020a170906bc9a00b008dc76bf3a69si13397357ejb.735.2023.03.22.10.17.37; Wed, 22 Mar 2023 10:18:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=Lk1xwnCQ; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231240AbjCVRAt (ORCPT + 99 others); Wed, 22 Mar 2023 13:00:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229864AbjCVRAU (ORCPT ); Wed, 22 Mar 2023 13:00:20 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2121.outbound.protection.outlook.com [40.107.215.121]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A0F96424C; Wed, 22 Mar 2023 10:00:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QL/oOhQrSz35vBE9J7e50R/FitHYcoL4INcXJQf/2gRU7hS+CMUmWtC8ZIBSQCig7u5LWYEckq69TAGFHfYsSA7QatKHfqBVumFbmZkMp3+8dW7JYhbiiJaJV30FsRwhnWSxuv2L7iMUN2sb0NElDyJy4y952FAUye/AqlalmxXMomw11tUMo2YcA5yhykpzQfkB+J117Sn2WXtymgAAZyzeABtQU5akeDPw0E2H+hNvnS8h01TOhkcnqzazNe1TQU20ymQTAuTf8deg7Ea2Hvwt2cY+XwIT/5iu5KXA+BeYxwijFrS5fURiRu6bCXVsX9IzBloPvpsQgxuZCZ3yBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EC23nHvmsjk047LeZyGTlxwogRKKTMdhTbyermoaPGI=; b=FBfP00X+21Il+aLnFK+E83n/g9WiQOXqCXuBOPUdeiSQq5AIBvBy3TckWwkKhlP86hyxsr1CuYPKXqobKET6cZ7IXlgq994fWCC8Cd6SXAvbjua40baI0Qa/NFXSKEhUE/W7/z3EP1LyfkOgJ8mu8JiKdgHNHOcDRWeCv0pHVclwH/xVjkeYGrpU877y8JHD7A5GfV97xS7fbkEvOuMsy2FnVZBPuHUUfr8YJAKpRg4eUP2aCUJlhA6YSncuYIv7BZBY+QRArKDHl67oMufvt33DqOfeVNuhSd7PQGJyGlWzyq5u6eTwoKPV5xJcXfME9NVePVKVGj8h5CEe4RfZxg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EC23nHvmsjk047LeZyGTlxwogRKKTMdhTbyermoaPGI=; b=Lk1xwnCQtqD47+KjWPuBwnu+xm1sbuzeWiCSZve82uPNCyHbiYPYx/a9vLrSHwC06WHHwJn3myFXZi7NCv+SMRFIVl2S9It6nbT3vM+sfnwdyDSFxQB09FxWygHi/CuDlIgaoR9rmLTvCN+89k83/eI5H1HX98ctR6XHtqkzmhDQDw2m5oY4+KieVHtgWEEbzIakGzPeH0TGFhbXAh07fmJPORofmV5J/iB2eQGuL0Ol2gn5dUV4Ac62tsDI4Owpr+M+h1AVTjC5KFS9qDWrdpacALXhza1mybn64aRpRncDuGf8XleTwRsl2bVJ8fbW6FQj9USjjBCQtsGUk3vtYw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SI2PR06MB4107.apcprd06.prod.outlook.com (2603:1096:4:f1::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Wed, 22 Mar 2023 16:59:58 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869%9]) with mapi id 15.20.6178.037; Wed, 22 Mar 2023 16:59:58 +0000 From: Yangtao Li To: Trond Myklebust , Anna Schumaker Cc: Yangtao Li , Greg Kroah-Hartman , "Rafael J. Wysocki" , Damien Le Moal , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 09/10] nfs: convert to kobject_del_and_put() Date: Thu, 23 Mar 2023 00:59:04 +0800 Message-Id: <20230322165905.55389-8-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230322165905.55389-1-frank.li@vivo.com> References: <20230322165905.55389-1-frank.li@vivo.com> X-ClientProxiedBy: SI1PR02CA0012.apcprd02.prod.outlook.com (2603:1096:4:1f7::8) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4107:EE_ X-MS-Office365-Filtering-Correlation-Id: 56c449da-3268-44ce-77a6-08db2af6de5f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Lr9AMxUvbBDPMccCG0bVoOMpES/I7oJKB+xDQ7HkMjR2K4EV1/2Mn4sC+A5a4doRd6+XoKR0SITCHNGdAV511wkl6xJydPtrg0693cDNwFlIttQ8c5Zs7xPsQJvrkxxvgjgroP3En3eFDQH4X/kc7BSo7wHCSfDxjMsTrRBlf8z4py6ydR68Yt1ackStwnQ32aUZLd1gDlwiv0oLJLRbUrASGQUB+SU6d9ap4plszAFbotGuEzbaRklG4cXzW7fstulyrcEl9poLKBTnbk77WcS6WnEeTWKW2N4VsvOEhFPOOnV2LjaT3aG8agS5AOnhaXRExJRX3wbChR/AtpuDxqcEisXLBLc3VN2kw8CJ0NfiQzvXSXRUV+xCHVQ8VXxtChYRVx3D+nBSEJX53hibU9c1v4QR76kp6PJpS+1QfcW5u9s6NBDb1oanJu7vTJwC6jvDCb2K3HBtmTiW9mRBWj3+T6wGb6ugzXSfhkDU8eoIVcrFkbC/Wbxr3iMT0zauTyAFg0llaEDFBqjaMiHwwthZEO4P/S9vQwsKG4BCAEPYSxC8dwRVMxdJ4hZi8arT0Lh4EaRfpiuKZ+mFGqi6JxrHQR+PBsj1zSlkHyl6vhmotWJn144AOuR+p/7Ibk61DHPdFAkJUAFpOcfLAJ8Z/765OUwLGpGqa9ZUbsABpDf02E/9K9y2JXBLsYOXVtzUaACKJE+WLvz/pCwCXV5okA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(396003)(136003)(376002)(366004)(346002)(39860400002)(451199018)(6512007)(2616005)(6666004)(1076003)(52116002)(26005)(478600001)(5660300002)(186003)(6506007)(6486002)(83380400001)(316002)(110136005)(38350700002)(38100700002)(86362001)(8676002)(66946007)(4744005)(54906003)(41300700001)(36756003)(8936002)(66476007)(66556008)(2906002)(4326008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: d2U7VRH9/9mfqhIyFFmyhdFrU9Rt2yG3Fy23/Bf9P/ADxypSWWlCn3qLg5yrMKLNS+un+yfHE454AFFKk2PCz+j+s4/G01MZRwkLOwaz2RmTTY/fn0KnsiuKzXNwD0vAXczCe/5Dk2Um3zGM5NITZ677DHDvaybjTXIMU/dAe1XniditPJ7T2m6Jjz5h1TmY8K+3KZrq/rNxN4cWPAPmliRHpS8k+uWjYHpfD17VIALDe2QHJq0DMde0duyJPBMGSWb1YfBkXC+IuGMOpTW8h6jXiz5nDiH/OWNlKliCdo6DOXJZ8plRiflNiIIEgBpGbPYBTWBEMGAhormefFYXC80+dTVGRbjsrJTVGQhLvXDl9+exBPvKPKwH7XMCw50BOpm0WDYnv51S/IaHrxCvEu0qyefHgv+lXqV4EatUUsbluZVXDNsCsl65rRT3L+NJoYnWEuWtLlBknPLHrheV9SCVO0MT+MfHHZZLxzK3V06EzKMvXLRE5NmTraZxjirjJajhjCh3C+8qIQ0z5oCJYVJ48swweUJ6ahhuHr5ObegJaKNhon3gsoItI/PWBag8RtaeQxukcPZ3jZjm7Yvw+f0crK6lDxkLgozhvUfeMHD9C0G8lG9tt943Fq8o1NqoyfZba1Jv+4abNXhK+PgxHH+orJ53ibc7BGNz/LfouNGIbu/j2kY94jFnhAXkSnVTkELe6ksfAbjcyoApfDzexe88A+1pUvrT8E8Z3X/9l88FO67fKUIlqjVfsjkKLoMZPr66GGWpSAZmtPYDUL2OYDwciUz/Nl80dAudttzAMo2VokDu+gHVgQG62C3Us29DqO5VvCc7ilAD/XeMUX6PyLCxElvOaEw2im6CBjBrei5qwI1Bwmbq4m07S1mfwImAq/D/Lo8N6J4QyMEiHFHNQmq7EcDoNtTpY4ggDdDkGIPU3BEbVbuQ3SmkYWZRP+7qaMQAu3rRVl7Q9UDmTYkZitlnyoRR602kf55l7RSliyMTpS+X0Qy040Sczfcm8BNiMXxBTvKNnF+0ZcfYg9oQFKidfAJmMQZ+vHcUqgWQdDhzIhNUDa2uDoXQuUs9DmXjfSApAhECffRyBSriz+lBKC5SWTO5344WBJy0OdY3b/oX6xKbuhRmenwNWStTfOwZ13YRlrh4iiBejaBh6wDvr7GmZcpU+MfB4mHfTT+fCP6P+/zMiOs046Y5scML/67zQw16U0n5sIz7oelEhPddoRAvoHcVUGL2+xqSlGNrPUFohR8rc7TFKUfVUYgUGhKRPGuCSJ1Ny+iF+BNMzrTKzQ6qkRdHeBAom8E37UuziXd920e0Uzi5FGI6NByTakd3XCH9nfXvyrF87gGI62H87qh9C3GvdkUM71DfYXB2zWxn4i1hrvH5+kofObzW6yVc/8JiHK8xXlYEizSRITpm63PAsLcHZguvVil4hsjedVdldYApAw+lTo0yE17RrHguRQxyLiZPsfHFSTKM7VOUDFQFro5ivyDHtoJFGKDBiL1pL4gIXLA4A9MFtx6W2Vf8+2NNI7Xwl5KjpImnehW8ezIpn0LJeGd5qymF8TmyzdgyX8BddaMWMBvrB7xszBzw X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 56c449da-3268-44ce-77a6-08db2af6de5f X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2023 16:59:58.6520 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Q/Zgy33q/qwJM67f6Tk/GqgiTzENqfFkvqoinEcUwzaBZ3VqzgIYUC/0p8tvRiT2inAns1u/YBwu+T1Vn7ddgg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4107 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761089139258334554?= X-GMAIL-MSGID: =?utf-8?q?1761089139258334554?= Use kobject_del_and_put() to simplify code. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Damien Le Moal Signed-off-by: Yangtao Li Reviewed-by: Damien Le Moal --- fs/nfs/sysfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/nfs/sysfs.c b/fs/nfs/sysfs.c index 0cbcd2dfa732..a6072be5fa5a 100644 --- a/fs/nfs/sysfs.c +++ b/fs/nfs/sysfs.c @@ -185,8 +185,7 @@ void nfs_netns_sysfs_destroy(struct nfs_net *netns) if (clp) { kobject_uevent(&clp->kobject, KOBJ_REMOVE); - kobject_del(&clp->kobject); - kobject_put(&clp->kobject); + kobject_del_and_put(&clp->kobject); netns->nfs_client = NULL; } } From patchwork Wed Mar 22 16:59:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 73546 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2460814wrt; Wed, 22 Mar 2023 10:16:23 -0700 (PDT) X-Google-Smtp-Source: AK7set/eS9KoP3ntKITl/vgqu7hThfnBbpOWtwD1e/qk37ftdQy4Cz5B/moQRqfbJbFH5s6EnNs4 X-Received: by 2002:a05:6402:3450:b0:4fb:b09e:4c8b with SMTP id l16-20020a056402345000b004fbb09e4c8bmr8255164edc.37.1679505383416; Wed, 22 Mar 2023 10:16:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679505383; cv=pass; d=google.com; s=arc-20160816; b=Aj3a4SauI4sh4tpORvPsI2esNKlvaUKYG9Iv1RneD+6aYPD49IUDqO5mU+kn6bl3d7 dLTAiXdVQYzpuZxEujH8FBC5UKdfbm/BiVOyhkPEAG4RBnSIRwa2lcsnv2Tj0+SWoB8Z 68uaEfot/HO4fmK6i2mnvy53lOZvhgd6ja9Q6qXTkUoruApnAGvNZ6WyuuU9Xdz8JxlP r1IoMmXUSTU7vLyGffIskClQdQPSYCkku/p5VUXHZqbAsyeGbpLVle+nDSzxtfjoBB4Z WDbNOq7T8rs5CAZ1mSHyU7r6cxDrapTc7snMnhJZoTkmyal5VKDsm4JCsk1V7FTNpBpt 6t5g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YeSXbiSKn/Htu8RDFyUlihMaEwMnfwHjUTJcCENoL/A=; b=fBQD5sucEyG8SKaRUyPBPoi5rXkNbXC94LZNbYzOOBYR+svdevxBITUPV9ffKMzFOG dGM017nCvVpO9wpTZUNFbayfbjSgVRW39slzEMkFS9f0LIgT6D2f98yTcmzWgPdoG6fd 8oxR22q2eiZzuVyFuIUvT4lPMx7eis7F54Z5wUCBFBMpFDJlvr6zCOyRT+vJLeTZGxwv sMCfUKr85oJsN021SlUNX3xXaPchSKsiLSCgEIwUN43Lx0lPVipSVqVsFA11hf0x2Vh7 q4mIYzIgxpAfIlqUf+ngsKUm7XJ8fepVb3cbXw54hvtRZaqBlafkrhzKGojAcoM/7Goi eKmg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=NuhvGdye; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m18-20020aa7c2d2000000b004ad7c7c307bsi9723657edp.567.2023.03.22.10.16.00; Wed, 22 Mar 2023 10:16:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=NuhvGdye; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231379AbjCVRBC (ORCPT + 99 others); Wed, 22 Mar 2023 13:01:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229747AbjCVRAi (ORCPT ); Wed, 22 Mar 2023 13:00:38 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2121.outbound.protection.outlook.com [40.107.215.121]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD31A64AB3; Wed, 22 Mar 2023 10:00:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AijP9/6n0Sh4f71990eolgyE/Da8Ej4qTK27NEy3yu6070fVfSu6ZEyS6LUO6leDx2b87M9yjixiJWP13gdPlNala7OGazmzgQZa98Wyez2zouXvfe/RD+y1WPYNOX1CSqUQoUMZ7BQM3z6DWz9aCU5O6Qc3b0n1446YpfrsZOrR2HqGqpPSar6tf0+Tsh0f+zXPLu9t5XlzH4oqDZlHV6DSR7ZrPtATRjGIFfmCl5rTiAeJ/WTHuT2Ttg+9xi1MEA1q0iljwSKf99d7RbuNJUcjowSwHfliQ1UG4wcrkAKLIBAohUcPR2z/TON1iaRx5/wYSAVvkbcUK+1/9wCWlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YeSXbiSKn/Htu8RDFyUlihMaEwMnfwHjUTJcCENoL/A=; b=E1PmTaysZZN026cprB2n/gS5WhUNVRlVd8ftixWusp131km4RJonbsipxFyY0TQiG6j577H4sAmK+FhGST1EvI+68uU8VJHRNb6hNAIaYxZt206Es2TrKfM7E1oQ9g38UvlI5Z1HZw6AvZixj5VxU3pk9k4HQzLC5WjZ3mUBCoQXDSEYNV7emy9kLr7SM02+Kgu8Mcf3Z3ZspT1aX9Fpn5tIABKHEjtm27hH5VQtb94GswriQeQsYUBi3WaPJ7AekYQp2Qmq8EZDQRiAWIZ5GTvh6WX4m5wvpDHjOInfh4nR4/mOwWrEdSyx2RG3fOddLDvrhfO+JYaHLMdhpIt1ew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YeSXbiSKn/Htu8RDFyUlihMaEwMnfwHjUTJcCENoL/A=; b=NuhvGdyeKkkSMp+Z62JFUScTXvDMRB9XyKUOpkU91HY/zlVSteoNvV684AqzMiT6PQ4kdwT8Sz3zn8K7avLMed9jhxUaNILeI46p3TFWJQxswV3B/cMgTN6AnSDGrjnkWuuS9RJhGfHCEjJhZf3LNIjVOKnykbmLdX6buFdN+qAmLG9Gi9xCQGozHfInbbgJk+5lKDajr1rxHF5+cw3YuS+YgYGGNYlXqn/pmliFzetvZhDRjxPlKu0N5RHGIbCaeXU5XUC1qaMvngMVB6yaqLY7h+nYxGkg+8LTHAVL4fHPIgnoFrPXEIMJWpN9g5wqkVk8CL4+r1qmh1VFhsNzcA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SI2PR06MB4107.apcprd06.prod.outlook.com (2603:1096:4:f1::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Wed, 22 Mar 2023 17:00:01 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869%9]) with mapi id 15.20.6178.037; Wed, 22 Mar 2023 17:00:01 +0000 From: Yangtao Li To: Ryusuke Konishi Cc: Yangtao Li , Greg Kroah-Hartman , "Rafael J. Wysocki" , Damien Le Moal , linux-nilfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 10/10] nilfs2: convert to kobject_del_and_put() Date: Thu, 23 Mar 2023 00:59:05 +0800 Message-Id: <20230322165905.55389-9-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230322165905.55389-1-frank.li@vivo.com> References: <20230322165905.55389-1-frank.li@vivo.com> X-ClientProxiedBy: SI1PR02CA0012.apcprd02.prod.outlook.com (2603:1096:4:1f7::8) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4107:EE_ X-MS-Office365-Filtering-Correlation-Id: b9d1b65a-5fdf-4db2-c118-08db2af6dfce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2AtLPt6UJCvLwVPA4XrSajMoeBeHt7ieaqSPVD/F9jnQ+igEtxMAGY1Uvhzj0Z9tTJbURXoaGAgdXbU3h66Sbw82DwIJ/kPJSvhALeTI2N2TshzpDD1h+SX7wbd5NMxu7/36yZQmikFCDqbuKDn48B/fcz+CWNceeZTVX6MSINVigXGzMVeaSg2UOSrGwZ9ZMZ5OfhmQg9BZvQF4BllzzsIhW+g3x5aEutwDWuF/15Wbz0ZNiC+3093yv2+i8jsUGeiWydLZcm5Vw4pemXkAa5mzf4dPQLQeOvuKc0UsJ2BgfmXudNtjrWRBLG6JZS+LGE7jcgpejGFNxDIaVAItpZMBfHZRe7/8gU8kOGUtrq+qngy/NhAFikU5vyZVXDwzMIHYb83oXERms0kV68//pL8OFrZAymN01PgZOUKtWEmc/yvKnrdtjnd7/IgpbHRge37YrN92owZA3QGILa9V9W+raofOJALJRTwbK9NOkZzG/bgpujsZIWDXbETHWlBlDBtUnrdS7ACf+Pop91qgnfKpdhb6UH+0D83Upjz7uhKI7Aa6IBMmars0+6xSXqNXjF8RHhwWAvVqkiDOwpy4aZCVn1c+3Jm4O4d8oY7yBQIgsQtZ8hm1U4259c8urVBSCirbIxdlp/NPYKi/IJKdyrw1aEJjYPdtNa62B47BFwxF9AqoqBZk1665xk3/J+Z6OHt3E1VevBdJphqBrnep6Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(396003)(136003)(376002)(366004)(346002)(39860400002)(451199018)(6512007)(2616005)(1076003)(52116002)(26005)(478600001)(5660300002)(186003)(6506007)(6486002)(83380400001)(316002)(38350700002)(38100700002)(86362001)(8676002)(66946007)(4744005)(54906003)(41300700001)(36756003)(8936002)(66476007)(66556008)(2906002)(6916009)(4326008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NmUFVd3EVSrMCT62QQ+hjFuFvzqh9L4ERpJJnN2UcJBZYdamb/sgygGBFQOYpJFzZ+kzdDM90OuiejhcvZwBm+pydRvwlTHr2RIyuEjoATV56Gbp+B3TSRdwxhfbdMSOsuUzUzBrAfiK8eT4Uqdqvv3VHewvs3QbfAI3EYlNBMzR8HH9xPLMnhtf3iwn91lsiYPwPIV3mFDdFJgJJqKPZ0b6IpIjONFjC9xfZI5WLnamWw4PB+tW2VNuL0BbYlNhL0ybyM/bEc20SYydVrowLpSFMcGY/zSgb+seChKcptGFty3aOQpRh9W+60etwUQNPjwcHxNkOyIFKLMaIvtK1uQ5JCirWCSAYofiLq5JCt4PUVG3UpbiHyWHbVv+krpYOhc/DfnQRsJf+XfskXGxsovGeMzVe60tylp3G6UzZu2TWmI5FDJNgtEtpyCVVowmJARP1F6AgXDZaRmXVSV8fE4ScR1QnqUkVfcpudq68UVAxhOJ6KowPlhAwKx/fY61F9sakEXK5/riIpHxfjvfm2CKDgcawpqE/MMZ0SNpISvVgzJ0b741sKo8U4D6l9P4WEy7T705agwJRxGk6/Wex8N6VOa70Ij9V1UR1uNjM7JqW+5OmgtxAMzayHd2WzwmkY7xP4fH19I142F8Oy717ZQo2GhdFAk9d8xk7yIfUVLRquH6lsstTqBaiQKH6Kl2osAGZ6m7rjZCzVVwTXKaVm4VvRGXzx/QUXVRXX0TDDAHA3Yp8AvZBD8e0+87Tor/MXw0HZazTC0cHqrtAWuJ3sdBKTj1nVwhWBu6jjPTMiXtKe/VCTOUE94QBr8MFxvWvdpjC6ZK3/3bqUwCZU+E4kiN/3RtTacmNY7jhrb8NFxdqSYoKCw3DMKpu3LzAF+PJzKmS9P0kpg6sbXYDtSPIL3mnwC3dnv7RLd7JCR17vpmIAH1MuEBxrE09TkDM11lojoHTVJsZIl3W6ERVbnl2q0/iagrUrZsR/F5NWRAu2SUKakD2kmIJma3SrvbjcO8otu5h7GAGgLaTdt1/+dEPGME0NiOSJ7BTjQ7KbrO9tGVURjbc26Ph58dqx8roAuD6DWyp6N1UyxSLlyTer7ugfe81/cXa3BHdAPBzmMV9UpKs8s3Dog0yWqFjXH0WcV0398Tt6Y5drNTpVuN091y7+ZgnXCp8fdqRY2wFYhh2wEUq1476rm8UcWXOkkkvdHfDVSTeAe7gkqhf44QSZF3DjyypEVRdic+gh/E8CMZibPHB3T7fOzUATHjdke/zJiKoWH0/Uuf7fQ5RMg7O/YGHZX0W+Y1Fi20mWkLgNGY/i17lbHRK7ix0IuUbPsaZxsUFzK9i+PhkihHgkh/l3ZUhh9wRkoosr/5jj10qx5lm1zv0OXYDOplOGNytNRS9kdZIfcpNZfedbHA13xKYLJEsb9fR/eYACkuPRI4Hu0MEXh9v1zaO9lN0Z/YdLGU7Ff8zJhRvYtBMiz11Q1YlehX4Y6F33MYO2gyo3Q0D7L4yUs+x5n9WDr1A7TOO0cvrImQbr17OjGm26VgNLm5ZS5CuZMqjZmNh2onAS9hxuZznWFwA+F5ze1hQbc3Z2UU2VQS X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: b9d1b65a-5fdf-4db2-c118-08db2af6dfce X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2023 17:00:01.0903 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: nuzlIMocUqG80V+U/PIFblVG0Ra7ILsk/1FGRvzUjM/M8HSkBq/kdaO9DkD5G6CE7U4G/+ydixbQB0Ik1JUG9g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4107 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761089036822783471?= X-GMAIL-MSGID: =?utf-8?q?1761089036822783471?= Use kobject_del_and_put() to simplify code. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Damien Le Moal Signed-off-by: Yangtao Li Reviewed-by: Damien Le Moal --- fs/nilfs2/sysfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/nilfs2/sysfs.c b/fs/nilfs2/sysfs.c index 379d22e28ed6..150965d58ca5 100644 --- a/fs/nilfs2/sysfs.c +++ b/fs/nilfs2/sysfs.c @@ -1042,8 +1042,7 @@ void nilfs_sysfs_delete_device_group(struct the_nilfs *nilfs) nilfs_sysfs_delete_segments_group(nilfs); nilfs_sysfs_delete_superblock_group(nilfs); nilfs_sysfs_delete_segctor_group(nilfs); - kobject_del(&nilfs->ns_dev_kobj); - kobject_put(&nilfs->ns_dev_kobj); + kobject_del_and_put(&nilfs->ns_dev_kobj); kfree(nilfs->ns_dev_subgroups); }