From patchwork Mon Mar 20 18:46:56 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: 72408 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1392779wrt; Mon, 20 Mar 2023 12:21:56 -0700 (PDT) X-Google-Smtp-Source: AK7set85ZkJ0vx95N5VUUnHFzADic61AYvJ/RlMBl7mZjTkh/XNwq5u//jhn/igqiNZT8bB0288n X-Received: by 2002:a17:903:2345:b0:1a1:cc91:c43c with SMTP id c5-20020a170903234500b001a1cc91c43cmr6434033plh.45.1679340115812; Mon, 20 Mar 2023 12:21:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679340115; cv=pass; d=google.com; s=arc-20160816; b=CzIAlBAm5W/YawD598h3DAjZF5L5fThlxIawMkLekGKvbAtlKhqptHZUQE5nnoctyU Un4r3n7QZX2bfI5kZbZaduNR7Ytb8uKg6jgqdyUmcr7w8otlaks9ZOQgwcrtP7+cHy09 cDubC6TLXM1/k1ZTRnNq/6+6iSsPAVAz4+iIvIYi777VBikUfXuEEKWu21l5rPfZT/3c wdcXDq1BlS9RON8JZ/5gH7XowaylURtHVldl+Gy64HXh4e6RSZWRJs9CPYzQj6NQMmYF LKx30suGpJsUHMWR4YVBNC61EdYWBIZdhbWhhHyU2mYGBaljLxgJUnhRSt1jAd5tXpr5 CD2A== 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=2f6n1UCEAAcz+QTfKGhjodobaG8npGp7MDh8Bm+DuiM=; b=QWPDhm317UL7OtUBGdKWQvorVTQgv0K0eqiAuKk4r1O4v1hCPm9iAwJ1REGkFQOM70 Py3o4o5V103ihpsReXSRiyJKYcHeg8SDdToC0kroVqMoOE0NlTN/VOpncMH3xA+w8Kn8 2Qsw8vGPCfrBM1LvLrG7ZKsrJHJAwg/BQPsYafyGLrYFn/gXHcVoV9+QgdDIwUU80IBW G5oGk8JiX6LhvAF2R9B04QQDKOihDrwbTVfjbx2whGRFFZChB6XDbKeJCwQ9TXjcCYck 3O739lGQecCM/vrVuRkgnTStZzyJqPfjp6Ggl7+Yc2ypCHSAKLZXSqazKdU4g6N00UFs zgLA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=avahy9j6; 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 k14-20020a170902c40e00b001a1c1093714si7280981plk.420.2023.03.20.12.21.40; Mon, 20 Mar 2023 12:21:55 -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=avahy9j6; 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 S229975AbjCTSzN (ORCPT + 99 others); Mon, 20 Mar 2023 14:55:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229989AbjCTSyn (ORCPT ); Mon, 20 Mar 2023 14:54:43 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2104.outbound.protection.outlook.com [40.107.255.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C292230B20; Mon, 20 Mar 2023 11:47:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JnIyWvanrQatP8FP2pOuK0yuP2ja5EMihziwXvDIy9S4nfDvU3cKEihR4hyqxLVVKIvEllFdSfcuokAlNxrNyB43JJJ+PkeQFEhGcu4t84y7K5bQF+pfxyNi9uFuijH9BKy2tUl70z1YZFBsAatzPFpcIUwunSHFSQEhgJ2WHWmbWgoUQjsZpwACy4xh48cEe5w1sgIRAnHOqYvOTHxJUscAf9wviSQCQ7vzQCxjUpaxoEzlXMKbPGDYU6JPU+RvJS1nwSfum/G/FjY7+w7xMuJ3xRs9JDWtT0tNwAf6WNRceROdzlpfWSmBYaWdYRXDKuwJMmqpGCTxFNO2k/1Zlg== 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=2f6n1UCEAAcz+QTfKGhjodobaG8npGp7MDh8Bm+DuiM=; b=W6DB23H8SiFo9n9+BzMlgImvb1IB50vX5av7fRTIUn3R8GMhIXJc6E2zKQze9Rvb3JEDWuik3UgDs6gLPKvzZk9ZHuUrUUrAD+VScQ2mJkIgFki2IpWEX5We3yJOWYhBK5QlL7sdPF517rdv8ArN+SUVuWUD39A0rjgfxH152bCpoFcFRMCxb4xcWtvDKvA+lwvED3dWJdG+EuQU5FtvTifQzABIjtcBz3bXyD5bMHKrLyqmlFT97dFl7RdtJQRCgbdIWiRGQqKKhLpFxBiIqbmFByTYDXZdmfjKUyUPgi4DtKg34hmt69rfNCYO9Usy/kRVjEMYmzPyZPdUUgVs7w== 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=2f6n1UCEAAcz+QTfKGhjodobaG8npGp7MDh8Bm+DuiM=; b=avahy9j67MbUgEV5UHkvAGGIawSEz4La41fbV8o1DV1X8t1tKXHX+WCCRf1CyV/VRvVL8ZALS7+2R+5KWC8MzPVQfyoobHz9Znm8DOjKgbBv7pRzOVt35BycfRATHt43DUXPW3+802qVMMPweVVPpJzuC/pWKzMjSWCD9mrgpRL9Bu/wn8CDDB23RS13T2fH39QxZP+PE9sM+zzpAOMWnJr/GUs7PpOjG2OP+Kk6pJ2aAeZFPTmXaysjGvXv2oge77GXCWoMNGiwUKxPYkhRjCV4k/9hZDd6pKM/J+rjATqQ1HAYwmBHiTLWU/STr6IgEAYoRXp5Tnb38Y/Sg4eeuw== 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 SI2PR06MB4121.apcprd06.prod.outlook.com (2603:1096:4:fe::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 18:47:14 +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; Mon, 20 Mar 2023 18:47:13 +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: [RESEND,PATCH v2 01/10] kobject: introduce kobject_del_and_put() Date: Tue, 21 Mar 2023 02:46:56 +0800 Message-Id: <20230320184657.56198-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SG3P274CA0022.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:be::34) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4121:EE_ X-MS-Office365-Filtering-Correlation-Id: c1cfcdcb-d869-40d0-e140-08db29738503 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MsOGvRl+lIw0km+HsMBTnxn6HDWZGk6Y2he4hWo0ZnTlC+b1YAAdA+nnWFHH2LnuBwn2Rl/cu6KONHB0AoRCPYxLAz60pHhmhfcRwZOHOuBxoXPwUGYRe4rL4hmshNUnK4NAgPpCEynxCJyA12v7g5lfIgKZ+a1lwntOxojqDf44JvwiVxDWYE6LmtUsZUJEgyt/ncsa46J5Lh1zwu7v/nbpg0AD9f03rGdCQ4S6N5t8Hsex9r/tsHwKLYeKjjHeM1LN4XyUFUzmoN0Q7cNMsLbMOoBPCuHtGCTWLhGR048HTxZ5fmAmbd846Wau4O4ddTyMhcZLfQ9u5oJjXNZkzIhxvqsmWv9xiB6HmROZnCj9BW0r7G9SFTzt+BGU5a5ZcmYMGW8VWJl4recceWWKicH27ytdAPQtN1J0EBoVfmQyDqnLkRGLG27mcIUAK8HfbsJqLk3Me3GblTXoR/NOl+ItBZL/j/0Sci3cW2ra3sTmbzTNZ6O0lwWpGiYhFOGgJB1ZmDhOOldKr04KnqHbYLv7JzANWhwc08gaY6DrYffcEJRGAdEW/7Ea8NXvtIr3NeC/yTV6GHnnUGab6lfc9CcxF3Tc22l/ewdTAE5QhLStM8d9TXVFYbbR0jmSUXemfp/EXJtj4Z0tUNDf1LwVd+SW1NxcuWfznLuFEacXuWv3iTBhuv8beKlTt+VxDV27kObsdFCNw5+mb1hGSLTTv0Eii6sL7DxfFkziCog06u8= 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)(376002)(136003)(396003)(39860400002)(366004)(346002)(451199018)(86362001)(36756003)(52116002)(316002)(4326008)(83380400001)(66946007)(478600001)(66556008)(8676002)(186003)(66476007)(6486002)(26005)(6506007)(6512007)(2616005)(6666004)(107886003)(1076003)(38350700002)(38100700002)(921005)(7416002)(7406005)(5660300002)(8936002)(41300700001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: g/6eNiYY7YQN4AMo78BFCWQN5++6QU91SJ05dcW/32nE7acWycSlcT/2wh47LRH2AK96RBLc1kKNAdUL5Puip4rbQxbA52B1xkcCYSZLU/tCOujQEFFQqW9Sfrb4ee8pOXw2IJl0gDMNC/Al1nVP8ucbzvkLj2TXfBJHTG7IbGoRIuvs5ijl5FPxvvE2SVmvZCzjtRpjZSoVO694Dqx3X4Rc8fUq6pkD/0GXWTK4H5VIBMvs3TSJw0/Ymf6ztS3Q73oqhizBfpzFGLCZnDlRS7P5KWLZoDzZu3/lmWBs4QEAIeB+ISrFc2N0iRKmvP+DD6JsuwlrMfUIOH2sjF1/Ce1zo9KMncdVsBkm2Rtg+oZgEo8RjZDLGRkdf89A2R8WJeMQTZk/3v/eez8MQbiwAydkoGKiyIg4GErnWP2ncFYHKtl575hr7c5c15V74Wq7hHPlA3UWHf8Y64+R1epivy9+XhvIrDpzUyo1z77KE2VnHKTBmIvwsy8wfzmChNw//iqZu8+1ZczaDcBxmu64c//Ov+V/bc8jfVSZKtpv07H+gi0yPqd7x/IZhOJElnEV00brhi5wz9gM2HhhELigsl0H54sAFeNXDCphDQ670M4276JCc69pGSU7nzpfwBw0506QOtVYc3DMgXt04cXgTK/kkIu6WXqBVT1tL5wKSJVXuDxGn9ybnYJEUq4nu3Wt4dK3CsGPPKeQVl46A8bdCXQecD2YEgve0Q/tswKuuD35p7sXjS9T32PWV2YV+kvJUO3S/PrUz6Ss+eCA32oZEPHMtyc1pPc7qSveDpKyigSApExkU/kXTfs/QM7XCBPgHUksWDw4zpDRNeM+1ieyhk1ubFGXav8EPmLpsEQ0/uvXUW0SfJFlRV1UH4wxs2mpxya/ujJA1ckz9O928Tyv6hJkDIfTGvhCHLfwB4mDp/biOp/rBauLCPgSvLH5JRY6nztJN/qCkA/oalsJfBtWOMmdlLVukaPwd5npHcBSl/eJyFTC51gahcnYPfJAwAJIv8w+WgbE1RCOBEEDFuK2ia68IreTj1Us9fs4Iy8JZlgZo5m+19x6kTrFw7OeVszdSKFKkiocIcMqyusT4kZUwf/D7ql+JkMj7BdGwcxE503Cnhr+OCvTpQ/7VOE9ZDaAd3XH7GIfpffRrQXJZEFijEkwosuZIIdNvryadJ9PDzw+M9nAFNUiVYvM6htbdTmFV1ENaQkNLEy+Y+Q6w9W8lN8wKAA+3UWMhy0m9Heea7FwSDVynnRGP4ESrcVbSE14HPJ7MvjZBRH0zIXOjE58S+gi8eLxXRj+GPN3UqTfrV0GzqLgpf3hji7Wue7miWTFnFQ1tLDC4mTwN8Oc5JLehn9eT9Y4TcbAsQd+rsaSfa1wc5D9bZUerQr51zv26XJToiYjsd36ny6eS4PL1ceoQC2ud46R4mzV4WxaBmJteceCEatEp2bAAHPqLpXEIJ2CKLg2EJS4sF3A35bqaZPohzdmn/FFlqKszVaBUWXgeZED1H2rUZdY+/AeDSexWBSF4tzIqqlt6miQHQ2r3YpUgBUv/I2jB3B0HfAQNtVx89K32SQQWIe2r7af4xjHQcPv X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: c1cfcdcb-d869-40d0-e140-08db29738503 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2023 18:47:13.4689 (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: Iw6yhFRY3fWfQtJR37Yy4Na+2pS2YzTcSx5S8aPN2N/1coERwHo0/5nreieXryTa6Gq4S5UQkEgstX8i7GVXlw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4121 X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL,SPF_HELO_PASS,SPF_PASS autolearn=no 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?1760915740997132163?= X-GMAIL-MSGID: =?utf-8?q?1760915740997132163?= 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 --- v2: -add kobject_del_and_put() users resend patchset to gregkh, Rafael and Damien include/linux/kobject.h | 1 + lib/kobject.c | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/include/linux/kobject.h b/include/linux/kobject.h index bdab370a24f4..782d4bd119f8 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -111,6 +111,7 @@ extern struct kobject *kobject_get(struct kobject *kobj); extern struct kobject * __must_check kobject_get_unless_zero( struct kobject *kobj); extern void kobject_put(struct kobject *kobj); +extern void kobject_del_and_put(struct kobject *kobj); extern const void *kobject_namespace(const struct kobject *kobj); extern void kobject_get_ownership(const struct kobject *kobj, diff --git a/lib/kobject.c b/lib/kobject.c index 6e2f0bee3560..8c0293e37214 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -731,6 +731,20 @@ void kobject_put(struct kobject *kobj) } EXPORT_SYMBOL(kobject_put); +/** + * kobject_del_and_put() - Delete kobject. + * @kobj: object. + * + * Unlink kobject from hierarchy and decrement the refcount. + * If refcount is 0, call kobject_cleanup(). + */ +void kobject_del_and_put(struct kobject *kobj) +{ + kobject_del(kobj); + kobject_put(kobj); +} +EXPORT_SYMBOL_GPL(kobject_del_and_put); + static void dynamic_kobj_release(struct kobject *kobj) { pr_debug("kobject: (%p): %s\n", kobj, __func__); @@ -874,8 +888,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 Mon Mar 20 18:47:21 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: 72419 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1397706wrt; Mon, 20 Mar 2023 12:32:31 -0700 (PDT) X-Google-Smtp-Source: AK7set/6Bl5+p0zXTdGlAe2sKAFbJmVXXyXgWSFBhzO17F2tx/F8hyuYnR64wTY60KlursBoGGG+ X-Received: by 2002:a17:90b:685:b0:234:2485:6743 with SMTP id m5-20020a17090b068500b0023424856743mr373149pjz.3.1679340750769; Mon, 20 Mar 2023 12:32:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679340750; cv=pass; d=google.com; s=arc-20160816; b=bSQ0tDJ8rKq7HcwGKqfPF4pJtdx9ZqC0Byift2j3zIVrIVFS5Yie07vh3+ZzOjE8Uc aIfeO26K5Z88U4xQfJYNolH41FFpmTlSeIXXtf5zDwP06c/6E3+N25T7SYrV78YHng+Z Gdt+4tEalAZBablkA5n9P+YuuCARwlKhkz75yOnk3KeEU2Ne0N1DCArNBeHu45vM5R5H pUPLBS9CLClFv7UQiomS7vuBa9B2nHyLeUtfLfUOvL8WEr4z2zO+C73g7LjlBn7oVCE2 kHCGVKhMt3ivEVxG9EXCuG3XIUG9ITSRts1eYksPxcbxnkBYFYmszIY93h5o3rJjs6j6 0nLA== 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=UuCTbjIJESHUMnKkhxxqH/U/0Rnveh5N9xZ2ArE33s1lSZnLd8kIMa4aPK1QszFy4w 772DIsbtgqdSXPwVS8IFIM/mtPXLPA08r5RtS3CZF1Xl4jnQ57zIXuUdtpGN132slOmw yEcb9O2c6qUSHAN25DXRezOIQD9JdFrbJFM9uggZ71AU8LsPmgsk5Njd/VSn7xGHpzIA RmWoSUyPYVTIIOABb7QQU0z7V5g1FnHBPUUrHQEeKPyzmwqa9m31ha+WawUVgyCHAvwU QJWB60KGCJO1e56MbC5X8lqENvKdHpE1wqim+WNfW4TyCHEyrs3WVVqrBcbp8nomDGNn VFoA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=Htc4RuG5; 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 4-20020a630004000000b005030a59a80bsi11511974pga.178.2023.03.20.12.32.18; Mon, 20 Mar 2023 12:32:30 -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=Htc4RuG5; 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 S229842AbjCTSzl (ORCPT + 99 others); Mon, 20 Mar 2023 14:55:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229944AbjCTSzN (ORCPT ); Mon, 20 Mar 2023 14:55:13 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2104.outbound.protection.outlook.com [40.107.255.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B09C233C6 for ; Mon, 20 Mar 2023 11:47:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bw9RQJbCcrL8A2VIpLhdRjEaRg5qr2LePu7/l46bvJ7GaFxWto5Xb9aH6z75uawnwwpBnJ7568N9qn+DBorSPsz26vb5bFLc6Ucd3eaWddjpHC6R/UZ3arTzxfShSVRRDm49PyHoHVVmHUa3eFt2Kp6jusj+jpCxQi0uNaLdDf167I5Gnc5SwbjTQcqCpAbzXaqFDeqNDGGctfL8YI2rwzNOupNniNd4g1JicKa7g/My1k5cnem8+1v94QDZZ/6/8mjHIpQhiCJtnBUQDA7GgFm6WRHdOcydNQBFUFdW8o3IS8eGjax6pcnL3yvzjKNlqpMK2zJF2R+XoXBcGFO7iw== 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=nPLV0YsYO+vuB7QlG39hjqIzpihr/KrpMeM/S3cU5U16NRoDjNL/7Vf6MRWtcyb1zzNyQyzcOaBz5MPNXwT2vyffS0F0vIaZ22MN6DJ24pOGJsxsipC2zv+iTmUXu+3tkN+BXY/Ze2pqZK8+L1TrslIPqURX3pdZLrwb/IuWRWQ3et8hR034WcDladPEtSot6Y5HB8Ffjzq+I56i+f68dsgVMXts9foLTmbAdprIlomNWfS1MI0ufN11mtnYLCmYKWxqYZDAQuk93q55cPqgak0uNKFn19xZH1Cq0LxcfEDG/WrBCU+f2v+xitxiQkwjpPYcXyf8fWzpC1feCWEv4w== 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=Htc4RuG5f6btDTujdEYvIPBJrbBW/ySupVG3WJk3jkYoQNiWRbuSeCzGpfjals9gpcEUS//N7EnnzLh97XlZFuZ09dRljDpLRSiMp37ayZ1IjhzIJrxEbuZlQwHqR+nvPJTu7+TwTcW+oleTetdrExGtAUU+hVOTkUhb+4NK1w6AlEHPwuf0kLE5ZYbypwYXmMXsth6MHFHjxrF+bi2AeYN9KGNqCV0Ip/MM6ZepvLkmckrPL+C9LR6eAk/qAXL8RnvjOW5gyjB3Fk7Vh6qaCEwlsReaxKT02hgnlMjsy7g7LLAfjEWOf05+EJNsaBhY1+DOmLEORdRXjslZQkdhKA== 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 SI2PR06MB4121.apcprd06.prod.outlook.com (2603:1096:4:fe::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 18:47:46 +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; Mon, 20 Mar 2023 18:47:46 +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: [RESEND,PATCH v2 02/10] f2fs: convert to kobject_del_and_put() Date: Tue, 21 Mar 2023 02:47:21 +0800 Message-Id: <20230320184730.56475-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SG2PR06CA0215.apcprd06.prod.outlook.com (2603:1096:4:68::23) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4121:EE_ X-MS-Office365-Filtering-Correlation-Id: feda5d6a-c008-4f4c-0b8b-08db29739856 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IjsTnVmEtYu9pWz8JA0OgzjJw10X0FlLZsRogOTOfpO1NhsoG5ipgeciQIhrc5S/dom8l1G54hHLZMvRfv37/mSeSKd2QPW5IJpfnhX0UPk4yoqTUCTrIh+L+slGCIVVgu8G0QE5rzHVtZ5t6EVUciQ8sklImjMqvgmHn5I4sXjRaiVOATzIiMV+GAWEd66rAyCZHmJdeQ6Yn+XrLNW8tRs9E8LrJ3vbJSvrtSaMJ+7UJd9IFAb9z8TgM5zlv65s762wOfhsjeva05TrU6HXYFwwho3g94EfiZ1rb2SZ/0CUjKTNS0qHyEGO20wVltLzL7dJ4NIuR6RVrQPYxSEbvnwcAnpdGLSOpjOZMB7qPcdjWL4EH+zLyao/ixNq1+CDZyELaeTiGIJZ2VlK6YGx4+2hszx77eEgsFYrIvIiB4cAh2ebNvhqXKrDC9ofpvRl8UTYDV/bBxZuUIhx7g7JGK8eh9ja6zzRkJ09aCw1ISajZD7++7b6zmqj17PqPO4t6GU8+Mu16aAvM7JEESdEpcyh8FDiG6K+cAY6ymCKQXZfsc7SfQ4Mjuvm/xbEOlo3mtCynV+HQvLcL+bdfu4FRpAQpIrcfuhsrHUxSXwVKz8iAOBX+5bKrkqam9Usui5hPrIUPSZQn8KE4jVLAteOS6uqxMLnUKRjuWG3VI/H7wj3sWz4dmYoX7SFrOSkeQUbTpg4bcu6fYbi263ORhevpw== 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)(376002)(136003)(396003)(39860400002)(366004)(346002)(451199018)(86362001)(36756003)(52116002)(316002)(4326008)(83380400001)(66946007)(478600001)(66556008)(110136005)(54906003)(8676002)(186003)(66476007)(6486002)(26005)(6506007)(6512007)(2616005)(6666004)(1076003)(38350700002)(38100700002)(5660300002)(8936002)(41300700001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: e9jh+SgG9exosHxb7pcsbKogVUwx2hGcwMYXYGwQyF1ZfB1UPKywmixJdiE4UFWZxLJhkFv6+iAZEgxPwJ1gkqqz+HF47scmVv7UZK89m6CItbQP97wT3jEimZnavFHFjK2/bJb2ZKdoF9xVrx5XzuGRpYAQkNPzmNDMlNnGAy9AoBonzvOYuB6fc8QFXq9pACR2NF+BzXL5xbqcgv93WVHr8atJG7IZF6VT7Ihx1YbJyBMG+BkN6eTqoA2hMtdTcbVTZWmBwURyLXr85e1FHcAdke54bK4W7Xof1MVUINmvMlGlx9POmooXe98AHReClHkRBl7w3/MrW53SVH4ydMV1YvG/Tw7d6Gu3WvQfAmHs1GWnkzJJi1M/SwVTGEGedOhqrBckPtHhbIdcjFJixfguPZCRp+FYZn/OgxAUIiFQO8eFb4wJpFEFJmTQO/xLuNoEKv3x+07EDAvQcwaRwZDNSOWqzbvme9+oxogd4OJ7+VLjnPpDduRajgyAM84cF0i+4qm3oykBtBErE80PTkYpEKQPPZcR/FaIbrKZm8soMnuO7xav8TRpCbTRwa12dcTKazRkwXLcjKLVvCUhFeZEtYGHSBXwpyqha/1jf8rYTurkTYS9cUdAdn4S0l3x5fjNH9+yAGfmZbSlWA7hWsw7qEgXqF2fLxyAE6WaSm0cSD2YAQRfQnWPDVhTNomQqX50b8z4bhAOFPMCNETRsA9FATBlaoFhUwRSNsep90pOXD7IFNscZ60fhzwSs45d3kSMvyQo0NMHBjnZgGHb1C3aawzPha66XBakvPbIIkvtk7jZkv2iTyY0Xvux2y4LchfmbAgn9mpeqInCijn1akSxq1IhxDALOShfu5IJjg/8EgcuBThDiiwzTvSh0IpVkaEZ4lM9x3mhkMjzZPGbZRlsiYhakCEQ691stsTIdrvSfOXnS1CkmHOuqs4on1IndYQ5zN13uSPZF/jI51whzQxM5Eq4iT85aEn4w7eEHT1rreMwxscTNROTL7sWUIXX4IbWEk9XGoNW45RZvxlQ9qwM2AdhMcRIJZ43tZKimj0B6UqlKF3Bodd8SP4UpD/qd9CnsPWxAqougE2hPLH6/t0j0vJNrRW/aubuW+1NSKQtdqyw27LXv05qF1JihDDirLCK3deq4J21OHdNXV//2RoDjApWTJJ2kX9t/EP6Ho/40/ehIcQWwbBI0AEmMQG4NuLH+pNmb15RWaH451c724/eL9fnkEUc63kYdTOnY8X9ITUGl/+/VlhJ7CbRJ5sKEG0ki+81VJGZEddRIDcenc1t9h7EyoB9ar/TYfo0A95RWiWqba2PnPhqscB+ERi4qK+Pht25SdlEL6SGJ636qHu0t/9lU3EkmosCi0ffNdlfXI3EdcOZfPWs+K0wyiPuoSK4YvxRoQ4uh4RArX5ivNe4ErlgM6lsCHv0Y49Fhu7XPyTu7ECTFNMxLiJG6GQiMRZPxZ1BeBGz48wRiF5k8jgSGsvQmI2ZFfB/BFwqgwKvbVOxzk2qjMxqXpLPz+f1g4kf/2zwo8rCYAU/dZ2ktHz74PqeAR6xDVqHxEulKxGA+zIO941nYMLuDxGQTRBz X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: feda5d6a-c008-4f4c-0b8b-08db29739856 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2023 18:47:45.8842 (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: +FGC51j7KVLLFcNxOoe3ciV7Di2ri5lcCQqycldo3uXBpNOeD1akGplzyvJuPVUwBmY1cr3Hs8a/7dMVWbh4mg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4121 X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL,SPF_HELO_PASS,SPF_PASS autolearn=no 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?1760916406678036227?= X-GMAIL-MSGID: =?utf-8?q?1760916406678036227?= 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 --- 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 Mon Mar 20 18:47:22 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: 72397 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1384975wrt; Mon, 20 Mar 2023 12:05:26 -0700 (PDT) X-Google-Smtp-Source: AK7set8JyM0//RI2UzgdFAYVCEDx9T/tgQLhbY3+j5b0zinVJazCAEjfmt7jg4vcLN9aRwqaS+Gb X-Received: by 2002:a05:6a20:2494:b0:da:3903:f5e7 with SMTP id m20-20020a056a20249400b000da3903f5e7mr1528166pzd.0.1679339126258; Mon, 20 Mar 2023 12:05:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679339126; cv=pass; d=google.com; s=arc-20160816; b=hBbqcmDScbeL0NvjJk+IYNA5OAbMoXg1wcjcwASTw1hOK95h6BT8UTTpebe+WANZcN we1WCMjZW68zvsixGKU9H5/ZxT8h/9G5gTabSkkdKbopFjKFR67xiZV2vSP91132fMQf 8M0wzY/gdstCDUdfxgGWLBrrYCOwUIZ6AX5Gyb4+wyEpiA57nZHgAyqeOOg1/hrmFayY RRoE+/y6JDQ5zmhnlYnwk4FEQ+YlR08o8qkoVqUhJDtOqqgUnzpZddpkmpr+7JYIYq2z /WTSCTVUCquSitJmdCZEqUdtz1bV/AYWsJvbGXrspeRUwP9s3jjliY7mQB18qlpkUs+W N2hQ== 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=ZpwgknZUZfnjlFO6Lz+p+xDpS4cnKgt9GThAtrfq0G3HEPBV5gF9qHMoR0adxhKkNU sdH1g5Tgb4BP637kEz2Tdb+fekeIt0L+/3wjtDsOjHTgwmSqw29q9n0d5JivXQsyuLEL 7XpMpOQHrUO0VONVnaoqB4pykLIUGAv0oEFArt9Y0R3piAyN1rZlobZMUUlxdo5dmAd4 VMmaoO78jFIy/oQwxr5r8Tg0DcXMZeZtBMVc5bReHIxOKsDsPhZ8ZB2mfjGn++uJfLkd bpMWW77QyYCm4FSsNFoQoi/IT+qsYpX3I2J/GA/7Ax84lNrOoAMU+1dyXKOF+JIubEm7 d81A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=msUuHeyS; 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 x9-20020aa79a49000000b006261ac05ae4si11023597pfj.374.2023.03.20.12.04.54; Mon, 20 Mar 2023 12:05: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=msUuHeyS; 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 S229666AbjCTS4J (ORCPT + 99 others); Mon, 20 Mar 2023 14:56:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229867AbjCTSzm (ORCPT ); Mon, 20 Mar 2023 14:55:42 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2091.outbound.protection.outlook.com [40.107.255.91]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3911F47804 for ; Mon, 20 Mar 2023 11:48:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lKkpa05FHPVYLq03oEV2Ph2JQvO2JT76ZfdR1rSmToreMdspeH3mROFlVGmBGkulLtDBaly5dPGM39BLfROyFSuw4oOQEYrdoKFmqsBjmJ+B9h9NRmnjIP00vqi9DJrwihfb5kBlaa3ftAJRsEfOud+OLpiuUjuG9LdnnHo8BgovqnmUsYAd+vi9vG4rnbNhN41HAs1Y2cMU5r6Lu3MROoBfn7FCDmp4dQGMja+z11aegd9UlPHl9ke/hPiFgAlTXtmtoAuErTUnDujfFWMZfgY3TKkutL0e7/nEoWf7EYnrsLq++/pGt9l32cQWwP49g6FdYsSGilh4OFrJzwu5Ug== 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=nUkuacbYjmmnd5RAFjVdFkrpVxkDbsvjhUhkWRDeWIkGOc7DPCwHr957GwkGfR1u+lxIdiGDEDMIZlBwyrRsbA0d7tp0Z/9zrKfmth48K77TutbWcQ2RgvYpBF3w6aLfaIVWxmwuD8FhpfurOKX/FfnNHqEYhUUIkqWr7FNokHysBPURb9QPW8S/QLskoIMpwTON8j9uJ2PGqJMxybSKEygUDKivFVL/2FjlyWfRCdZrcLv7DjXhvmCevKBhslrdlBZO+hp6sDNTOAwa+232cVVdJyoQOzjVEVneeUP5619fMeT6TbZR7jkVoUQ9efLeS+RuJvi9V2nmHzvNo/BfyA== 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=msUuHeySd+HvNzZnlQ/VzyVlWmoGokAozMclfOqa5rDpcU6+mRw9enlZ+lciCBQHYvrSnJdyLqG+UIIg+R3h/ZcxSWw4rBsZiaBxZGcBdjcC8eEWMFE1TgSpXSJlV7gy2y4sUD7B03K2wZrgyg60FNmacCamsNjw6UZDILV761XLjuY3zjBzBEkL6lxEwiQ0PicTCwaXYifyreESq8p1vSXpEhUaMoya3oFLB9kj02soq6S4dEbNJl5r/rhHVFWEGBgM+yPnzzSh0Fe6QpZGddG6giV8ULdxPZn+uFtmY/5n+TwwlJGo6JGfjafWf3GjRje/rD/XskOIydPnxKthEQ== 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 SI2PR06MB4121.apcprd06.prod.outlook.com (2603:1096:4:fe::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 18:47:48 +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; Mon, 20 Mar 2023 18:47:48 +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: [RESEND,PATCH v2 03/10] erofs: convert to kobject_del_and_put() Date: Tue, 21 Mar 2023 02:47:22 +0800 Message-Id: <20230320184730.56475-2-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230320184730.56475-1-frank.li@vivo.com> References: <20230320184730.56475-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR06CA0215.apcprd06.prod.outlook.com (2603:1096:4:68::23) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4121:EE_ X-MS-Office365-Filtering-Correlation-Id: c1a50b14-7e0b-4c5b-3a25-08db297399fe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nkcOnaNbyM9UVaj53P5i2tQuVGTs4QcqmfYwRYtRxcYkjqyU3XtBH3xRDKnophgjhI2rE5dnhrlh7V844HIhRoQ0X4+THi0m931xLYkETYp5mVSq/sjWCoCiTonWE2JRxmNurvUP9Fz+hD5BKdQNdu1yhFiVLDSVVx4ucZiLiDJdR58xkpHR3ehC/eN5j5BQNRmEQvYt9zczhfEvf48VnWKtGO5kyCQhgQvnSvhge87YhkwxMB/vI45PpyTO5stkGQ/yb1+spMZIajvgjQuxcOy7kNMfpBH8bGX5l8bKEMVPNui+Fn68QvFPqhNjCQjHS/qPLBPvAxIS9ErE6+dYpGf9N0xeHYJF2l+B9pWkgYtbXESRrNZApWI4I6rBJByU0VgvmxYb9N8U2E4WColP2FElco+VA5H/3yktcmgcjp09rWfqBIh/6oZccb/uadF6VCysZUYMGmkamX9K8MbKw78yJHBGa6moOi3VS/Wjr4rhf12UJwPZnZGClZ54+byqIm1PLSKofjPb6HtdlJOmppk8TKT4FCCxeQBmuJ9vkY8t2XZyo5VlJW/Yiipt/N8kpurTKKxHpd84PTzgeCvhMlCdzjJfFtssmJMMBhjeqKcS6cGsDcSehP0BgHhn16vod/8wOktFakCf3FAqLfHcbzgaxDxE1K8uuJNIln+duEvoTb8/t4kfRa9scU2YyZpDKJEQeOb3rXNZL+BE8ZlaQg== 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)(376002)(136003)(396003)(39860400002)(366004)(346002)(451199018)(86362001)(36756003)(52116002)(316002)(4326008)(83380400001)(66946007)(478600001)(66556008)(110136005)(54906003)(8676002)(186003)(66476007)(6486002)(26005)(6506007)(6512007)(2616005)(6666004)(1076003)(38350700002)(38100700002)(5660300002)(4744005)(8936002)(41300700001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KFZdApr3gNn9tZHF30YaOMl6U65Pu/s3qIN4Xjk7L8cy5pMX6b8uA3WhY2bAeIJ10DRTyiCj9qJL+xeVcTwc3Ovx4KVbY4xA4kXJcq2Wcs989ccXlVFx1J8wPvdKVZA8kG+/qXtBJQ9jLOKZblFO8KX8XAPYweUjhWzuj7gP/mPvpuogpX9vrXWNolgjutlJgWuT7yP6Pb/C1sAWTeiWJf+ZMdpELwx6CXCJ98aTstZc/U1M0GnurqTXQvatsg/ezKprmkR+Ne6xLtP4rAC3iXjyrOxZnpID2xxFeqQWHeUSG7hVqWX2ga0Luq2bEQUqh/RaSxyCH/LNDFAX7AZ2EoKfFvAQ58CEsT02xHE79WMU9N9GDef+rchaaEAuravrd/gjBDiS7EHrls+eyYaYdIl22fqvm9++SlmRtmWvaMXyQ9uao8cfr4WLURx/3Dau1Oy1ImTRQ97FMte45idxSkqQFklzql2BH1ON9Ug/mmYY/dEAojtE7Y4PfsabcM8Ajp3INEYu7J2m13wmdAKFJzwbZuTcv6/e29GLtdEXDyUE1T/fHSIX5xWhSiaZDKEUOabtREUebZ/R60p1MprH3ncHYmSIamdyyL0JWgcZgCF8Aor90L56EvNutP5DTDysYYYU7Jbl64wXDZ6B6Nw/cJZj86JF8DE93BhdBvDa98H9pzpYXwhY41FCL1TLxdgqqO5vejnzLYfHR1tad7QmhKw5st4NCt/oqWbL0OZkV6JIONkcyKle2MV2SYj1vH0SEhC94aSHIELHuYV3Nau0MkCkDmJRkHgaAT+BjP5a3v39ZMb5aV7Prlr9BZDLX4QCQ/jLZcemrovgrAeiYqUBUbjUh+saxHbuNglH4BUXWkChOJDt9k4m1GDZPr7yIOnHQp2sUH1/AfHpYdTFMgx5yc3CWgEBIp5YmAGic19qhSSxhFEG2rB3hg8eMrquEM6hQJsmh8Zdr5hR3oJOFoeB1U59CsIPtcmXIxEE2s0WoqXPerZNP3diABMwqz2ePGC3c1Ub66wtQADUz+nocduxQCmNdnNP70/Sg11WD3k4Iiz1W2VU2n/V3FJFrHeS8+eELWHc4h26d/RvxGTnAHU1HNDsai2LxzLBBj5JJnX+GoqQC3zx7oJJRk2l5HUm0QUAb5LmJEhbyWUvT0iggrzm/Cp1lqELWAUkvlntXEvfWVOonJl+Uhl4rZcMm+R287kgCbRxcUtesxtD2PbugHTR+MYCuHBpL2nsYzAhYScDegcAljml/YZskcNLr8dT0Z6q2lvV0hHjxq9Ef27Ko5mIkUc2F2tjCy6LDT8ySXynMA1NsRQKgTx8Dht2tdJmzYiKQWZcNBaQXFgxQ6Aq+CwJNgVCR6IiXgrs1BSf0GoLEvajBDf6nLIaFVlHs4GqapgTwXeFLRjavCzHr+6d0/dmTfSpJFmhq6KLrCekQ6pvcfNTxscXssHqIZwvdkfzAoY8yeZqCHnCAmmpm6xedu21P6wdgRKNe2tVICIRduod6KUihTCer4ePdPsqQLsv0VsfNqFgbO5PEuRfS8/Uu9UTwRaddPTvW4waQnZNtsNzstsC8uZIFRy4jq/a6GFtOEVm X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: c1a50b14-7e0b-4c5b-3a25-08db297399fe X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2023 18:47:48.6484 (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: /kAtJf5ELGvkUzc0XWrBzUi1RM9WaVQDzQ5WYo2Tdut/K0q/gi40iRs2oEjXcgepxVBje33t/uiMcuDsS9PuOg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4121 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham 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?1760914703630342833?= X-GMAIL-MSGID: =?utf-8?q?1760914703630342833?= 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 --- 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 Mon Mar 20 18:47:23 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: 72402 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1390438wrt; Mon, 20 Mar 2023 12:17:19 -0700 (PDT) X-Google-Smtp-Source: AK7set/HJxnBKXGfmuwSxLoTHS7HvsqYTBdOR5AuMwbVAR24SYk/WR6k4N9shjCiDfpl1t3wgbSv X-Received: by 2002:a05:6a20:6690:b0:cc:92ee:b119 with SMTP id o16-20020a056a20669000b000cc92eeb119mr15701481pzh.45.1679339839351; Mon, 20 Mar 2023 12:17:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679339839; cv=pass; d=google.com; s=arc-20160816; b=b2RKHlgKfPJiydBEJ/Aqfsqi8f0bD0d+a/GVyeqqoZuIin3SEZFO3GuPfXpQQdCNQW h9k8TLyuQyjbPSltq7FHQxGTA6FU6aoS3GtgW0Vw2VUH59K+EjvQ0MnknOi0cpSOdxIB EAbkpooD6eSPd1TtxN4xwNaMR0siBZmWmlj0IW1nLTglzDxAGDs+RyuznuX5ZVNz52IZ QjGpyOEtFmjpFUSkHlYkX3X+aiN5ZLPjvquwFecz4ipu9w4QQKlYyQt871gAdN3ZmmCu Ueu7FsnjCoRVIbmKeYNm3b4G5qF46I/XlgCEmMm26P+mFgf7V6WAPiOSFCaqoK2zl4n8 3Izw== 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=kcZeydRbTQIc0Te6qKtbem8AiiIl7LYn+Qz4H4sfB2JghTykR6a3r4QneaSXXo1RAH x86UT/bWE8krZnp1O/Fze9294TfeGcRGFlQOfATZzJP7blVqCMNjaBMEi6qALDLGVCUc mpzWBXrO83RD/eja6Q4es3hkRzT406SQ9Cg4wtTK0cUOgVOsNj2r4t0tqsYo20RexDmY V/kTBEbNuA+9OUAX4j9Bydwr/WxRM4nQbYpI4qTORJ04h/DMU4wSsa/SciVuHvwCq0MI QBZFhyCA2WjsseqEHVFAEMF7xu9zAdW/+P4wguuoRdd/7yPUAHs3y573wR59xde5crSB F9lw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b="Vj/fLFJx"; 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 j4-20020a632304000000b0050301265ffcsi10918376pgj.471.2023.03.20.12.17.04; Mon, 20 Mar 2023 12:17: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="Vj/fLFJx"; 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 S229890AbjCTS4N (ORCPT + 99 others); Mon, 20 Mar 2023 14:56:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230451AbjCTSzq (ORCPT ); Mon, 20 Mar 2023 14:55:46 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2104.outbound.protection.outlook.com [40.107.255.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDF01497FB; Mon, 20 Mar 2023 11:48:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HJyBzpAjPO8smDQqmQnFsqbuDEMADjOP/bWFouWF8ijDBtHLk8tCzpUa1vE6hhRHH3e1N1bxABflyFm2CfIMVcF0dL5IyyWHMd1j7spsO9uFVENdiH7iT5hcYHVK5at+7UQzjAKuVAkspWcxSOoOtHsJQLv/uS42gcCnM5WfrjsJp0gAXfPLJ6kYpiQATi0eAq+Awm0qLRwOoo259xL926FfAnLsYqAidYWzVzsfnu9KyQGNqQspzqBmj3y6KEgZ96lSzhFvfCpnYQFLYloF+nmIovM/IYxoN/O4twMoijc02PrAU8JdW1rLbFUvljJEeyKuwJVZyTjhhBfuAV1v+w== 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=Hik1h9NVx+wXcJwiaR+TJ4/y+LqaK4f2fICMLMZonr5Af/7Splz9y4Doeb/ntOapBAc75fEKYA6v1vzfSh55PSpxEde52wO/pe6eAteDw3QFCoaKK0+ZoaDpzUMDZmkoqG8qKnkm6yH/GvRSlVs19Ye38NJkgat7Ge4EUYHd53wzM6hWxn4uIWWL216qGB18HxFbgJCgRZ0gaOrenyWpkPMnT5x+JpsLELqxa7IMxS5zx0ukt7TiB2Z37LkBsvMW+hQXsWfQrXXJfgVQH50M/Oa6OCbdVDGpK+NXLLovixmtFWAqXVzI4lPzwJrdrLaHpDb/83Cw/rzxNZWtV4mzxg== 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=Vj/fLFJxQO0zOHsaFV8gRCunLi68HW2s/4/ZdKTnLOIpt5zAFXr8NyanE9fMqHv+jlr+wx/kvBk2dyERVG5bsguItI57deVE3AP1w/RHtKcinEia4pB6htyTznJWprneqnKxO/m/ohdh/n5T6meu/oAlzpQkNlFW7WNdJgN1gjaGub+T61gngNE3ypsM2js6Wp1hPGWb8kfpejKH5BymZQJ4yId83JIvdpltFayfwnoGgg4ky9QJ87x4b/AWzBHWUoQ6jUVFse4EHviuSwYYOwXunXR9g2B5uIoSXqKAcDT/LnpmGrTvbpf3DSAiKfv+1AwPjJ8F/1posD2+NjjQRQ== 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 SI2PR06MB4121.apcprd06.prod.outlook.com (2603:1096:4:fe::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 18:47:51 +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; Mon, 20 Mar 2023 18:47:51 +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: [RESEND,PATCH v2 04/10] zonefs: convert to kobject_del_and_put() Date: Tue, 21 Mar 2023 02:47:23 +0800 Message-Id: <20230320184730.56475-3-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230320184730.56475-1-frank.li@vivo.com> References: <20230320184730.56475-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR06CA0215.apcprd06.prod.outlook.com (2603:1096:4:68::23) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4121:EE_ X-MS-Office365-Filtering-Correlation-Id: 0bb8c531-5cab-47cf-0a73-08db29739b77 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VftqllsnXCbrYT64d2k44dYr15JCHjExTvhZhcYIcXTjlQvJ2kChE0RFAkz9EacOclkTPIi908XFnEsgqR0CPEkpsl5AEuzKj+6gSiM5XNwnzzQ/wqHg4VvcmX6E2h4nb27IRr2Bd1dHNmeCLUAlcpEn/LSTcMzy0ztHbDq1V7KioThnO1cMMxEJb0bufks9d2mEivF7Fw+ZZZ11fWJ7g2TAmInog92kslGPrhAVYf4P/xdMJjqdQby+ymyCkeVGx6ojbB0FbutJxrQ+NHpmUJU+vp+ZmnQNx+DOugXtrCYs97xe5PtzHlsbevJXWIa5C+gVodQXdTuXtYA5UTqYTqCuBfyAKe+8SMA9ne3LrQbkhDbGXS6xdJYpfM3tja80kkZlNbG+2IE44/Ito4pf6j2AlxHd726zrkKADqd2nIO2ILdYsLJPCO+FFAa3UXmEQL2T6718JS6hHJ12Hk5v+7VwucEWrh9+2o3YnIVCcSRq4lWTjM7Xq74z9cCKA0iRDFBCE6izfJbKPKMjajYBjRjprezKtz8xq8PTMu2dQEKG/75iIpMGz4HClXDp/1xlUGiW17uoIGdbphFGZR1bHpYu7462Nrwf2GND/C2O74LFqltIBASOI01VUbIEKgNjrZnvf7c/9Ftld7PzcJ24ARAHPyyKUoAqqsNZzemTtT6alCxcSNtQH5N3jtn+x1PHNab8WAobWwsac6tOWtmSEw== 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)(376002)(136003)(396003)(39860400002)(366004)(346002)(451199018)(86362001)(36756003)(52116002)(316002)(4326008)(83380400001)(66946007)(478600001)(66556008)(110136005)(54906003)(8676002)(186003)(66476007)(6486002)(26005)(6506007)(6512007)(2616005)(6666004)(1076003)(38350700002)(38100700002)(5660300002)(4744005)(8936002)(41300700001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NEVbuQKjwPQR6g4cPBpwa010gyR9Hj9jdu4RrdSfPlMj1O8Co+kTOMB+aHIt3d+XcBBMDYSoHT+e5DoNf5eAFHC/gjFOdbEYyLfKer3baIZhu9hO32yR97r8D/VDZXQIabj5Q3WoGbFrPTSv1/PGWCxHEm6vyTNHMHDlfqzpdJMXVee9+h/FA4kFWkOErKCpZ6tfF7mcUDFmihfNMTDs0zNtB+ZwI3HnRvN8C0L1cKtIhL1rqTG4ClYpd9hZ398S3otAHyBlWXQdr+ygBxqh9G4kpJstdZ6IcX2lGYvfKAJhYpEugwdzJfuS8V+yJjzMl0aqUx3CkD62+S8JfAi7JkZnwvCBxQlWc0nBaP3dNb14s5/DpIkzm9VMlNNdLBNysb3ZhB63XbyaVg7XYk0vRyxlEJzNFxajmKfGamu1NHbo6ONVlxQzMz4rXka99M3dhiPofSPV17AnVAa/otfo1Abx7/kU1YUEPqqv7d19BNLcKonvPRCMoMLH3HRgtiJlvhe4BxoJsZjwaelRmHxNumHFnP5QCTlyRsq6XWVdaEg+mIz24/j+lNWSbqhwmXZTyvVtfD2+iFpK5bEEP0q6JC25YHLzLdYOATfDpD4xyLzCjQRsDsFw1g67klwGBK3Vwd58wXeEPrQ18ESgUpkfV8nqXWXenfXBWcW2wyc8gxcTxpGQ3NFznt7WJ0KC2AiZDWlJUyl+oX06plcBemwpjkqA3EAmAI3GRGpQm1b84W+D2VMTdca9Q+9NwUtIn9l8UIHjjGoYIOtywsC+l09D173PAGoQIQOmaeKl2qi1Cw49XFd382xp8sxJ6DjLmx2Vz90VV79o9GUzFw45+f2w5xdK3mCrI6JWcEJ8uktrDIglzOnxrE1yj8COcxMYwqG4RJZN7Vb6MV5udSckie6n+QsSMCWCcYlIrlOCsL3k5S+KXvAgestqR3WTLfs+TD57gyavHXTcKU+Ga0mJImr75YAyq8E+e33DQaS04RH+dVsU9fLv2tYq/e8WfUV7OIPmGKEzU3W9lrGOA/pmV3mak9u148cdbEF+j3JPHJaGCiZWY4s+YAcHDBDTOTNvv+s6sjSLxlwd/Jtt4u6EpSqTn3QwvJFOyzzQUw0nrPwZVsYcfv6qr/F9Z+rlRtrSGUy705IzU34iT6QNvWkSQljwzTU/Bf43fMmx9mNaSvp9wDGuSMG6Iti/5jbS2Njon38AzRW1bBfjXFdD/Vc8TDjyuxbhkiBWqCdSPnM1CRys0zirPyrXBQInJA2I7N3w9/7SIXRkDtySAmCJuIcufoiIxW9sC3TmfklAbZagt32DmXmRbefKn14XjqZvGj2TC32RWKWoT8Fm7+h+YxJPpDYo49/mx63TmHFQu5AZZZ5bAgzJcqFb90Rxatjo2dr3GpwOEffc38An9xQ74WWkF3BN8dTzScfxbItPGkLBkRLHy8oLudQLsQiCGUx6DRyNKsblIm4VlYnKUt58YlIpqZfXjlSMoL7YqNSQCdKCc9S5IBtPT12etfvZYRloHweRj/iohaudMUvcIdQ3EjcV6geYRGrxVkt0xlnZflLBc8onYUDzyil+OTFoRqr9fWFHnVRF X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0bb8c531-5cab-47cf-0a73-08db29739b77 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2023 18:47:51.1192 (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: a0aKkxEbWqIaJtMdOhlU601MK5JqyAGC2/KEa36hu82gAirMnMKmAefRdJdnBKko7AbXM+IQxJNXSszeQ0NVOQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4121 X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL,SPF_HELO_PASS,SPF_PASS autolearn=no 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?1760915451257629210?= X-GMAIL-MSGID: =?utf-8?q?1760915451257629210?= 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 --- 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 Mon Mar 20 18:47:24 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: 72404 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1391423wrt; Mon, 20 Mar 2023 12:19:09 -0700 (PDT) X-Google-Smtp-Source: AK7set/L7jopwj4Fj92hN3iAa93t4ZNVNJkd2QLiRIPhFojfxe3h8L1K5338tQ3pdg+2TLBE+mp6 X-Received: by 2002:a05:6a20:8b98:b0:da:501:55e with SMTP id m24-20020a056a208b9800b000da0501055emr3119841pzh.40.1679339949151; Mon, 20 Mar 2023 12:19:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679339949; cv=pass; d=google.com; s=arc-20160816; b=q1kmdDJ6N85+27YUuCUGmaSci5XeKx2zSHvQzw8V6ny13g04iSItTzRDZZ/pkmVw0N W7AjaWTwYzJyL4abtVXC8lD7/glITj4X7zRewzbht2D4ZQc8l98Z+U1hxT54F6aSmSz0 g6PebW4zILSlJITq8o38tuTHHf27vGrLj1Bi5zva1HxQtEcmXS+KrFllw2t/pthfZPm4 096dsd2eD+IXAmv2nwq9YSMfFEg3m2lIkBW0W169l1pAYZ1dLNjoxhRfVIUzyRSYZBfe yCdWlj8D6Mym/Uf5zb6brEwBGDlmgQtZI6LRu2yMoOpz7gTnIrrqycNooJmaYaqN0f+Y AGXw== 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=k9Kj+Q8yzHDnAlp9Y+vmU2OrCOzCqif+6KhLq/LBwUyTZOXbmW48tJi4pnYV6BFIx7 0Ch9xESzx2BM+v91atGB5y3c+9KMw6LuQLFK9sQEBD9BVlV9QuM61He3lNg7yi9/G7NE F23z6ivkD9M6ay1jj8omdv9L2EvVfgXV0imTOaZ4Svv8pB6ghWuoWBQMt6UWA9Xe8LUZ 6v6dOeGn50dJ9UqTgwF/Z0GWihfUbUNA1DYFE86w6x/nHtj8Ja3sR+rNb575CdhrkQ6k spSSbUqUd5OwOrPYlfKYuc4ZRSFWIAv7BHSfhrNjz78YspaGpGqn6ZUpQQa4ZqohQgpT 8nMg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=Wnb6UMn6; 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 bm18-20020a656e92000000b00508b8b16db3si11166815pgb.656.2023.03.20.12.18.53; Mon, 20 Mar 2023 12:19:09 -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=Wnb6UMn6; 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 S229788AbjCTS4q (ORCPT + 99 others); Mon, 20 Mar 2023 14:56:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230194AbjCTS4H (ORCPT ); Mon, 20 Mar 2023 14:56:07 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2091.outbound.protection.outlook.com [40.107.255.91]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7F6348E26 for ; Mon, 20 Mar 2023 11:48:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c6Z+AS580tduVU+s7Pz2zdIxCh0yLU9IKceeVEgQmj+OOqLGjQlLClQcYBYOzeTFDKVWbm9N8hWUbVruglJIMa+yDFgQkrn7IP2fb4PEgoa1tyjozsQSOXwS/lYRoKJZoLbQ3U6bN9toNtvH1EvDjh6nKcxuxCGvZoBhZUl2weDx677rYFbd81Kpom6c2VUOnhOzugJtwjKjV1fbUBYfbAl8iWdE4HxudnLuF+V5KI1sMxXuDaaRIxIGx8Oo23RmwnJ+oE95Uxm8fMJbnRm6x0m7l/7fjgU0PqKXPxRlCc4VFQ0Tzs2lPZjia3n/KTTrnp9OLF3S7Ree5eD08U8PNA== 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=EPACSjCOFOL5xBeIgFgngTiAwYmMLJm9tygg+0I1dOB1HfwcfasLPh/dAl6IZjXQOF6xJ728I+Hh1GHp+ArKRcte8MMsnQvMzWHu8X2BnNvZAnbTnklzoPB9nAD/MOpMT2pw6u7Bl2TEU+ydw8+U8uLUz5xlv+G0YR8Eh+xRKJ3IiPLsTCpTyfjgdO6gJOPHAPJ972e29QJbRz6rQmGnhqm+31xUwjKZDn2MPgAQ6dk7dyzvjkzj9Rdd/G9cCiYTlB+KpZKHRwUj0NhuisuYpc0Od6HlITNDF0JK8SvSrnnf2UO7n4io3103SZy+fNyPxKHBjTxnYFPMe/UqkGvxzQ== 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=Wnb6UMn6TCexnHhME+uI/lYxvyVmA/5fwacEpKBYDxSXO9J8qW068JcraRmfVVEbGS1MRIm7J/ZYQ1A4EvJZ4UwBYLvunbeoSxUxt4sdn9AUM3DJK57Hx7DcT6235DavZC+YNZBBMk03CHSDt/gHvARA0U3j5UR4+oFO/Zi7KEKdua7l1/nGx96FzP+DBeelptoJTnSryCE9PZSxlEY+OqbYGceto0ITNdnrFnW7irPjL71sOV4+stdH8+icuo3P0nRuF2roHGUxFZtKi9EGGg/eVjeI6UoEL5tpoNveIrlQL9PUmzwEKCoos156uMdLBZvX41fBGyXlCahNAsXDdw== 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 SI2PR06MB4121.apcprd06.prod.outlook.com (2603:1096:4:fe::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 18:47: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; Mon, 20 Mar 2023 18:47:53 +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: [RESEND,PATCH v2 05/10] ubifs: convert to kobject_del_and_put() Date: Tue, 21 Mar 2023 02:47:24 +0800 Message-Id: <20230320184730.56475-4-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230320184730.56475-1-frank.li@vivo.com> References: <20230320184730.56475-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR06CA0215.apcprd06.prod.outlook.com (2603:1096:4:68::23) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4121:EE_ X-MS-Office365-Filtering-Correlation-Id: f5395184-4d3a-4e82-7bc9-08db29739ce1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wEhAaMGAaAif0F97SU3O1y+2NzLM9BCf4iim6AjQ5jIIAkaxLJqfhfXywgDLzl4tWVCTP7iL5Cnq1jlNtyCVFxW2ONNqHh/lmzJ9wRxw+D/iqw++yvk3E3QQ1tY7oorx4E6h9QnORwoGPZbpSmxabvPAO1pyVx203hHR439tNmZw/cjLfcrbsZLBVeFy0eQmpXl/eUy8Ixtc2zDs8b2Fic6u3+Lpbqk2vTd6ua9OonNrVN4w2zzoJ61ncmOloei0LhF7lTJr4o73khbhbNw5A/PwJgo1lJXYYD4sQDHva2sAan1agj0Epa/XIOqhyEZusqrYGno6joCQhW128kh92kV5++ePG5gVNvUuxXcMB2vmD9EX23AgIzPyr5RUXPRc1VYh61GYzgj2pmwaYHFwTXD/07YFhsP+q+tqrctqJDFXQ48jRX5o880MYfJRWCZbkgmqDU5xBiek4nYTacYsR/5bN1F1EUzf9FxERZx1cJYXawgOI+vtjAdC91l+1Zi6PyC2shQvt6dRqvPoSfZjIj8hZyukmXRsjRdEEvKeVuh4D3YEgBelw1vKlk2JX5ifK+EkfM66nQkp1Ea+IUk3EFj7Z7XTsh/lFvpirzPbWwEJ0A9MJ7anj7QjDEukj0+78PTMNLfcZKptuErFWhZTLvU0LhQShOs7CQ6JB6i/Z2NlNj14OPr9ZTcaNlld04kFsrooCCNl3Dqlps9POVCfuw== 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)(376002)(136003)(396003)(39860400002)(366004)(346002)(451199018)(86362001)(36756003)(52116002)(316002)(4326008)(83380400001)(6916009)(66946007)(478600001)(66556008)(54906003)(8676002)(186003)(66476007)(6486002)(26005)(6506007)(6512007)(2616005)(6666004)(1076003)(38350700002)(38100700002)(5660300002)(4744005)(8936002)(41300700001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AC2xu3N/VOXcy8p+4XNxyF6Lqo+ZPk1DfwZB6OAHCcBYJWQ781ZB4EYnHGfkyUt2y62bNSC5vMR4uHkVUtzmymS81vHlufYPp3sUKkQvRQBudgWAemnFmrBIEVNzuG5tMtD3LwaqzCk5S/0xuWiIGLyQDD7DCqFACI6jnnCdF+23JjvbI8yqP1OUtc+MGpO2IRYXS+kPSDGXIcY70p3tOFcP5QreRL5Rx1vDHSceFVh827FjcS8128nuxo5I6J8FWlmrqiqIIIiHxJfxnHICniIw5XHfZAz38SwDmRYRQ9whQJsDIqlVA7QZF98MlykKdnrK93jb2J8n1jTi9ze8Txpp76ZOgytWRvzwR/em+PkpkKJ7OMUpp0qe+yXH1eoQb9dOduRtExR6rGfGCMxxExEigg1whMJ3tON68+LPWMH1lGmxwUMEiRYn/4BQxylzU/+K1TtD1lgHuToW3pUPf+FGaP6Rr/3eEpGu53poHklgR/rDWB2y7kPn2zqZ1Qd0sifVhWFwhD25JIcdPK1cDlKWlRe61oTG7kIDO8w9TZF3v8dYe7+ZIpGb2tkYkGN0oDuZuRUsOpzmQ9w/4hNCGCE4ocLM3YSUWjyJrZaSWvQate+g+zXsM0iD1rZnqj/MTqPJW2u2DhfNdR9hZ1iKiJfx7Ku1QZvR4K19hgJenarDeOaKIPWYg2MZeL3vcCeaeTyCoxVti8wG9gJN89Tc2A0tG3Bymn5Pba+3HC+LRaYDIbasmWfRB0qIkmw1LfI3R4cxaez8Vd1LTzosluMJQqDMSOPOk10wvODco6m70R9MJ5NvUcfPU2eGU9X5O0bol/U+pBlMlmeih31Tu7bsxKgZci7FBHsg8EqbF0q5mGLzaz6a7h/4+4yh3xW50s13+YrYsyvxRkX93CmLUX7t7CDrd16y9CNZJ6+MY45EJEX/o/FXfpwLdNpX7y4e/W24rUKI6hhqjP8O09tbtugaUAV5m7SVa9cYFtn7r4Fn7ojb5gqX3Fh6qlACTaUJTZG8CrFv+0max9uxgka2t3cf3FMyxY9ZJmnt3/Mm4KxlzN6eVafrstY6Xrpc1r7yr31Ga/4MED1yT8+uYbG2JoSd5ED65mMN+Va+qp9KuwebtzDyiBryZsNjWSSv+d72p0MiqyKuRB3+9OYoLlivrvfSmLnmFq91GaqYyUXnb15rjiF75MqzKfQRNEstVWsay3Ubk4Xa8yv7F/Ru7esWDrTBHDU74gpcoUTdmwJzhx1xfeXBlpbRK1MNWlx649Q2A40VkA+FzoyfU8lcj9AvU1n3n6p9GAfv8ZZGTehcQZbf/d9CPVAhbAhan3AOxF7FiSCJagC/Z7R0GdZHo1AUO93cDjeyQJAbdb/ChraNXB/A2Fgo949rvZF+o6qNzIXEwxohmY8rNOS5UvhYAR124W4y/Yo5Xn95wRj84E3zHBxkhR6yhtelFocvRKDTqY2Kn2A8NCT8kIeISb8fEVSU9RbPpKmiriaXp3KUnvZj7xB5cHQRtX16lxyr4H/l87fohGDZyjgXQRMBXiFCxHZ2QiQTyfNcaShrTEVUgg4UDH3DS9YVs/hIYunv80nYURkwC/XZ X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: f5395184-4d3a-4e82-7bc9-08db29739ce1 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2023 18:47:53.4931 (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: ZFErF+C6gPc+D8IqTKY+FjP8PxUra1jpkxHJLXXpiMvl9AUeoIlJ6nXqzldvsyg7P/T/Nva/VVe9d6G4Qkw8nw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4121 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham 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?1760915566847479596?= X-GMAIL-MSGID: =?utf-8?q?1760915566847479596?= 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 --- 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 Mon Mar 20 18:47:25 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: 72417 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1396569wrt; Mon, 20 Mar 2023 12:30:21 -0700 (PDT) X-Google-Smtp-Source: AK7set9jlMf9ksM1xd5xzdDLJoPKsXeHRtHxqOmKGUk4zPsjyYjnvrqOXuboxJGGeJpGaJiFusGC X-Received: by 2002:a05:6a20:1b05:b0:da:5e10:799b with SMTP id ch5-20020a056a201b0500b000da5e10799bmr743876pzb.10.1679340621349; Mon, 20 Mar 2023 12:30:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679340621; cv=pass; d=google.com; s=arc-20160816; b=S9dwJb5dFvgC44PdRKHQXE557LXwte1vsbJTiYioPRrf0nWpGh93B6d4smt0D/CI0J iYjyR9Y+aFeGG7ZQINF6JbDhGLCpb71sxYFWFPkO++Y4MnLzDKPz81qpkYqqYy8cCNT3 YwG1m1a0/6wD1znF3P7gJeBe+CJbwb1047FHlMGqisbLM4jNlSMDI6eIkc8bVFCvX1vv lXp3aMrFFlAzjkflX8PwOfawlBp/YJUJS9I9nWybcJKW7DAezuxAaXNPIF0REpZj1vqc jHKx4Xj98dxyOi2aQZMRbcYdFbBljT8nb5s+dm3676hO5Gp3SJOewcqDCkSd3ZTU7JUj uxqw== 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=ISg31ZwAevQPzJzDvF8ILFwDfLfMC1J+DOGIMmBEHabF/sInAakCvo7BL6Nr+ThSph PgD+SnhFKErD4h8pn5QqHNFLZEqO9kOOxqNg8c3nksyabJ/GS0GYi2pSooG7u3lB92cV /YDK9nHdFKTveJUfFxGcILSQGSez0Vq9Mgr/NGjPSD7ORbb/h3ZrffJLkAn4BvBaYcPS bzijIrm1FuDVHN8s4NnYr7AxF3qzYP7k3/fQ3t+rpiq4/iUgID7iEmMgMADvUT6F6yTa tlL/KEpIX5gkzRmgz1X+uyPyVbw3Okv60Q6WBsRqMLvre2Pur1fqXtqLc9MOQn7wI3KR rMLw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=FMVWDtIQ; 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 t191-20020a6381c8000000b004e63b6b399esi11314222pgd.570.2023.03.20.12.30.07; Mon, 20 Mar 2023 12:30:21 -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=FMVWDtIQ; 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 S229541AbjCTS4y (ORCPT + 99 others); Mon, 20 Mar 2023 14:56:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230050AbjCTS4G (ORCPT ); Mon, 20 Mar 2023 14:56:06 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2104.outbound.protection.outlook.com [40.107.255.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7BEB48E1D; Mon, 20 Mar 2023 11:48:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UyuvGvGpMw8B3C+yDDUb6VNukjGykIkRRZ1cdpEK/nzStnShIg87kfRKnhpSqXX4tTSsaNbOolucdXws3wcLW4/YpVZD9XM4GZ/RNg55QI0r4DVNcMj6XP694nSVs59I6wRBFTIm38azNTz6CAx8wx1qFLJ4rX/EtcqYgN+cuTgwIZ/1Ikj17ImqfnqT/3Z3I/hQoqxi6BkuOupMftfL+Dm+GTFmpq9aI6RvTljUgIs2JtlmVivLrLtPFW536X/W0hXKnMznhJMfNmOsyHp+C/vY+2s9K6lHGB+43Tx215gJ9DMNgFZwArbbvQaz5+63Mksq08wiQY0S0JJSRwJN8Q== 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=Gm7ZFO414yMaYR/675xTqYnKnxi1UPXCxAOHCdVuAH+N9c1hTAL12Gb2k+y9h7DK9tgm75xTTrkn2gMINGPkCb5Sdo366weKB/dvkaltR/XdnG7bgnZXeKTXSVDEIlkJkjU8Xolq4KpnrC96W1o81wxxKGQH88N5IHcQwrJilXHMYL/QBSCPJj3RD6al/QvmMYM9S1C0Tsq77gAxWph+ydN9M4sC2E46DuTNwbWKpiO7bOUQAuWksLAid9v4MWdqBWZDTsA4G3673DFPZZ4I1sxXb944FyOdp9WxErfuxY9f1cdM9kAhr2NXLdsMaqLeyXxIYEDVm9I/0dw1TodLfQ== 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=FMVWDtIQmQWZWlCnoJCZnGTAwiufyfqF8ZglFtL6DCwvbbw86VKCOQB73SoI1/MCCIxDMvQ3Hf1/DMmn9VtoVA71GpYxu8I7VhibX0jxPl4vLh/Sb6I9lQfywMhGqhhrNYjdIlcsrv1msNya1Ts11wUvRRi1SYv6jiZiL1dbybPwhVId6vTNflkKK+EtAGHskNeXfih2zheOtwda1d1zLKWF6p9EbOEtlTjNtGvEJuJWg4vWbln1HDlA/64sUZiIjpunsfMGjZAuZnRnDNE7p3ZoRBCeI90pOD6h/474ycF3J5v8ZE5+p2c2lMWiN7/fJ6Dma4irQ5exH/V9LYJQJg== 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 SI2PR06MB4121.apcprd06.prod.outlook.com (2603:1096:4:fe::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 18:47: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; Mon, 20 Mar 2023 18:47:55 +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: [RESEND,PATCH v2 06/10] btrfs: convert to kobject_del_and_put() Date: Tue, 21 Mar 2023 02:47:25 +0800 Message-Id: <20230320184730.56475-5-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230320184730.56475-1-frank.li@vivo.com> References: <20230320184730.56475-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR06CA0215.apcprd06.prod.outlook.com (2603:1096:4:68::23) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4121:EE_ X-MS-Office365-Filtering-Correlation-Id: f16e8fa7-0a1c-4bba-2fd3-08db29739e4c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 482W94rhSb0X7joIiJXbYqim+gfBWKgXdvmKin9iwFq9SQ1/Np/Ky8Uk3FUbDDEiDfHvsrztQYikZUMHkG/qUMvU5oOHn3IAkwLgn+hvE6JT6+kLe9vk72hNFPL8wP0q1YnEnvTHgDyZbW8ewzWARiYlSPwvLf+dirD5PDBs+lyd577hqNbB/hPUL/kyJ5auoOnG3qkEPPKJWsgRBLLnV2zxyq/AEhOgXq3yr9QXtPovnxPkRutOJZ5OfJl1M3LBYZ2HxDydIrCZTMamjQ+LNUs9PA+H/2FsbwivhkkE4yj1a7B19aC8EEzrC9HZvXcipUCXl8xyaI/UEQ3AACEkLSv2XCjwXCLVK+p9LeMRjGUcQTUz1YV8Hb4xQlph8gBZLL0PhJwazAKNv4VQ2D9HkCFb3lVVR9ZWz0/0WUPdnck3K7FcdcjtwOhUhvQ4SYuN+pamGhIzgXRlIaewWxu06PxA+rx00sJTadMbIE2P5H7aYt9084E/8fzo5t2JHUP/VL2x7IVl+d+A7GKhT6Fs7PyHxvOOucY6RGvThTKiiMyApQ6k5oMcR5XHPvnfKFP31bkDVy4wpnOLp93e2HIe0LkJLgoaPz4R9Fs6frHE6jkZ4sK4ldmCRPM56HC+zxRn++IquA0NUmUU0vtJsLX9jhMI+7zLEVx2J45OACL5VzLwl2vyVdSlF+1dxsS6BGsLUs1jn/Hso7+fwhwY1sHOAw== 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)(376002)(136003)(396003)(39860400002)(366004)(346002)(451199018)(86362001)(36756003)(52116002)(316002)(4326008)(83380400001)(66946007)(478600001)(66556008)(110136005)(54906003)(8676002)(186003)(66476007)(6486002)(26005)(6506007)(6512007)(2616005)(6666004)(1076003)(38350700002)(38100700002)(5660300002)(8936002)(41300700001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Zb5Dxul7p+45RAYzOWFmHF3Kr77PpK3tjoDiv80pjDXisrhZSEuhyOFekvMyG2ALG7XmkibeCZMFx1E9RWjS8AJj/up2WbLdK/N6cFAewvGyNlFO9WKWBXbqE5y5AHW1unhrZMIuVIS4l8zPqcUoKFJrrpgj/14Og1Qf/0n13qPqx25h47zZnZ2S4MHoiMpRLSfsMTi5xjJBLqMRL4tA0VxNDlQpuQA24+2UJ98wVrlWISaFUkbJt+9BZN44r1HSmWOMr9+V7ONoSbBqeZzN7O1tIOpQH1QBslXP6Cnfx0fJlc0tTlGxYGICccoMVwJ+kUxJ0T1hHmo5SzD8QFY23mDwpqI6Cp7FXqsA9+fGlUojkfA8NW2wDnSkU7qZibcmmezysyRG4uN3Y1UMdDf/7RzWhGHvFt1OvYeh4Y8835tTFBL2P/HNTByulAtT1CSP6HiXF9BJJDP50EjSs4ngpk/E9tmBuDC/oxcTQxBy3y2x38eumjmtKYVHdb7ylkXrvSoJ6NkP4T0eAcqADA6nHuTY8xDH9t5z3qmQjgZmRFojjOFXf8x9nw3XCDniJwpijta84iqKHe6NqouXPuypEyGDRs3GzAzUiOZsF2ceGoiDLty8BCuLJtHK6akHAc4IuSXrEg26p2MejSyQrKWVFKKc3FzCBEvjVMPEZ3kuvu7b5XbPR7zDc/I0LZLS2c6MrNk/wzBiriUu45Vx+EzcVOXFvfzGWl3jC4NOxw+ACRW295vZenS7sRCeipfz2Ob9ugkIFwu4TWFbFHN1stL2VKlE+OLRrjr45hLc2Fzgano+KM2oRGDYfv2WfzLzPt+c3r2p/KhKvuiU5BYV0yJBSFHlCJfPcL5JfJeAKhyGUvihx/JxrVd/5f72o0M96H28AO+lwfSfcaHn0i468MRNv0onNVN8t/pn1BDVk0eB6LoUlWnUrj9ZAofOtI3Bf5zWbk7ABRv/K8RidKha7Xd10d0ljvtfJnvY6EZC5Ig+T7B0hDqF0SCnS3u+lnDnRosQoWdXYCc7AIPoaq4rCAp76b08ZAWhSsBk2VNTjm2e++Q8/h7jlQRELDikgxaHg91lS+E7mITpZH0thDzKeT3yd05DRR3NTNz1Zab7FvjdXheis4oKAfxmaBoiFiV28vT680UCZZroOQnoevb2HLpoY8CJwsiAjVjvjiHmyQOcOUK+2aEFYT4ZTSGpIwShUmaLsIilWnxza4RAe3NS45Cn0wEpVIrY+107DR4/IE7vbWhV9YLV6u6mzVTKBtR+kiUCjhneZsrNmwCuIXF75gKyTnu2/3N5IBShhi+rXfZ0N/p3umYSgtnVeLX5HhhkvZ2gxo7GbNwQKBJGwczZUUXUIKFbNxXq/00Ru1Pn48qfOZN8KBdrDwMbp7W9surrCg4ipAZkCS8FAd8YKHUkCiDs2E93FauN/qLt2x4lS8KiNfP42sVUfixuOfx3t084nZLrbkbVsA5+QiSFQqLhCYfBaLsSNdQIsQF/vtggF9NdzZ6T3OaSWTioAEZMAXMZDACViyacmSAroTT7iSIgngybLue7A8rgWjljoWW+y0peK74JjrGN5hYVWujW5BWbfpme X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: f16e8fa7-0a1c-4bba-2fd3-08db29739e4c X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2023 18:47:55.8234 (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: /WZHAOW+dMoqYOmqtkVDJIfJ59lssRxff2cd8WwAqK2l8drSE3kQvAPh6meWdudc1W05Jx57BJ9epcCp9b53Bg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4121 X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL,SPF_HELO_PASS,SPF_PASS autolearn=no 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?1760916271563973727?= X-GMAIL-MSGID: =?utf-8?q?1760916271563973727?= 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 --- 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 Mon Mar 20 18:47:26 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: 72396 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1384904wrt; Mon, 20 Mar 2023 12:05:17 -0700 (PDT) X-Google-Smtp-Source: AK7set/zOD/1kcugHsTm6LPL9Fv7wX9DQ2+RQnOPMjXl46RB1WvUHsTSrkvt/udfGEjKWXqTlSlF X-Received: by 2002:a17:90b:3e88:b0:234:b964:5703 with SMTP id rj8-20020a17090b3e8800b00234b9645703mr222757pjb.18.1679339117192; Mon, 20 Mar 2023 12:05:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679339117; cv=pass; d=google.com; s=arc-20160816; b=UczzVpHpStAla+fVc0Y3EEo8Lu0pFS4ydXMBJQYdCjBUBtR2sDcrE7eWwqN4tCeyVw LdDwt3ixFkrggvoHLvjDjxo+gqrrBMmnZgrOV2KnQ/Qhs2hECxhSPU4/RYUgSeur9V8Y pihQNfgh/nHZ9djz8A5g50J4KXJd8RSxQYmFZEmkfYv1LRLT4saQ+kRmAAh84e9HnXF5 IQ6FuolEGmlBFghkqAUwSf6tMkIDfxzjg6JKTOuEinTN2HS/moDNedXp5wn9PR12QF/a EuqkWtfgMzuFsCUjmm/1BeMM3Hfxj8cXiQS/drN33NNfI8bSP7nLh8NqgoMqHHFZx6MX u74g== 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=BfXS88vYbHOrXgPwrG0qdxpDWeVFg4YOTD1JUNUm+ZdeRjx/5wv4H7RtdW0il4y02m q4kavVQ7IA1/ASSHnckGgxlsQw77O8kJ6bT4Eb5SGoj35yOzI63dUS9lVV8cH9ly6MEW uL4F6d6AJnpLliCne0drjV69yiLKK9lAn7bqNmdL1q6mftAS/32fTsritOHPnVwS56Oz 2c/2qviBq7s/eQ91ELGIn295UxFjFgJ9qOGOOjU49lxeVio/Xt+O16VUd3CgYTlqWBSk zBCkAaqiB0dEO8qdofELr9jUUfqj4xp3tCi1r3Fmm2S9B1pS1TISkWMRiDtdUXgvPDDk H3xA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=WOrVJArZ; 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 oc1-20020a17090b1c0100b0023f2497e6f1si15641185pjb.182.2023.03.20.12.04.57; Mon, 20 Mar 2023 12:05: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=WOrVJArZ; 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 S230183AbjCTS5T (ORCPT + 99 others); Mon, 20 Mar 2023 14:57:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229837AbjCTS4k (ORCPT ); Mon, 20 Mar 2023 14:56:40 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2091.outbound.protection.outlook.com [40.107.255.91]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E48443402B; Mon, 20 Mar 2023 11:49:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hG9EyKuYVXK2FEq5RZeydidXEWFSsxMjwVgkpWwVc1o35AsRX1LIXe19vJ9J3pQIZqj52RGqw46Og4IgQ6VVJQHT1o/uryQ1aMJ42ExT4obWWH0jjjW0UT0O4QqzvwR6LSFB3e8AvyZpk66qzc2uEQ+xpaLpN1fOkVaM2E3/nuOsRbLPUakbYk2hZAEfV3VFFGwjbA5J0M4mdA+eoSPdIWme9xxNNMyfc8uZ0Z1/8oTc/P/cexdikBvn34ImpamSv6JyB0/SV5kb2eM5o/FkB1HgxIUfSdoyWHpusKMtQ8KB97zRuKom1+IXSjhXcKiHFzerg46ipQmEQwrRR6Sw1w== 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=GQX1Ts4npaLJt5gqRsKm7gaKCbH/lxAkZWt2OlIV8e4srd0lz1s1dVDiAF3WB04DNEouS80va+uEvho85uDWyXX8VB/G/pL5jgSBSbBLo7K97Io5mULnmM2xLHPQ7AZUfjYlFWxGxMU6SbHDETct9f0V6PkD275gAaXKFJdE5TXgUH4wyHj3bHKAgbSjBBqO8P7Y0Ogp92/e8JE77dY4f+3kryxd4vFwwBQzU0mS9t1Ru1xxGnBX0tTLq0R9vKdYZ76JD4pjx3RSBGvtux4BhseTTPH4RWHo0k6F1i2tiAHti6I7KSE8lcq9FQBVArzN/bEzJ15BFY63AgM/sda0mw== 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=WOrVJArZDb8AJP2kssBj+BelX5HEigC3oWWGcHLHLBMlaXI79Ps40P1lVBP5b2e7Wz9h9n1nQOTrcruYZ06Gj/A7ODm2lqnlnSuMxxcgxVrH9TfMjtH6qZ8Ikb/ENQl3YwsmFCR19L3W2ocYCgSZ0Ss5nFeen026ou2opyH7focFS4kVIEufNSVV29cbabMxcHob0O4VavxoHLgMWpXpI7dTWXdiMxvEJF4vJova1ynFMdGeuTBnTaHHVcbEc8Rn2AiKoD6lEC2ZEoDCyGvkaoaJSgE03VafKUihgNoxTaQ19B4ZqYiNRhxCZQiKz4EVbVS2e+eukarQ5+zIYVuSCg== 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 SI2PR06MB4121.apcprd06.prod.outlook.com (2603:1096:4:fe::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 18:47: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; Mon, 20 Mar 2023 18:47:58 +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: [RESEND,PATCH v2 07/10] xfs: convert to kobject_del_and_put() Date: Tue, 21 Mar 2023 02:47:26 +0800 Message-Id: <20230320184730.56475-6-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230320184730.56475-1-frank.li@vivo.com> References: <20230320184730.56475-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR06CA0215.apcprd06.prod.outlook.com (2603:1096:4:68::23) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4121:EE_ X-MS-Office365-Filtering-Correlation-Id: a7977c57-0b4e-4d86-ddef-08db29739f8d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UnnyBwBRBrmtfPVb5KhtGQvPGc/t5LsUDmQjNcT3YK7UuJHeG+bVkAcHzE+qDt6lZQel9R95cAZInHf4qs/2x/11aKPxVJK9wqG0R+jBdQcm6APxqg1QIQ4yS3P8pGJEycaXJ7mxcqNSqebgPhBHJ0SSwMc0vlPJXjzCGj0LylcQDIvY8mMXbqeqP66fWDH1CYIvXTs+yEd5ZzmdGZ3ubI4eEilO6Yv4p4QzQd1tQDjbthzXkpsgot0G3rreannNeoCAOFmsfjRJR9/AoCG2i8jCT5Nr92ZvmhzhX3TorzAAS+k6T8zSe8dMVZBfX5H6ohpCOu531S1jVKHN/iQ7Q00vfZqzxPU73/kRqDx4yGlCd/U6jkv+XvALGpmnJHywYiN+e6XWnUHNPJ7OtMcZJLKIdmW9RqQO4YSWEE3Mh+WdjE2pUihEUq0Z8tA5duYs9W5pOiz0fyn5R0ON8Om2EbmSaFvDM2ObJ5DLZ7mMvrIGRH9K4rE8FcmYPRTUNgRSYeRF5tnd0bw6DzeTj3ECfgzQZWJzFqCx7Ujw/JXih7fUZcCwmzmDmIJaT7MIL6fJ9PdcawnHMT8HaoAEUjT90aagQifDtHQtJjeHeY+E11ylKofVc9OtG5o0h9hsaJp35ITp4x2hRs1fpe/ptcb59u7kYvAc3/kk0f5n0zbEC7Y+hzs78bnC2WUz+UA++UJSGnKutTLFUXXwKJ4Q7/UXCA== 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)(376002)(136003)(396003)(39860400002)(366004)(346002)(451199018)(86362001)(36756003)(52116002)(316002)(4326008)(83380400001)(6916009)(66946007)(478600001)(66556008)(54906003)(8676002)(186003)(66476007)(6486002)(26005)(6506007)(6512007)(2616005)(6666004)(1076003)(38350700002)(38100700002)(5660300002)(4744005)(8936002)(41300700001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: iVHrZ4jDDFrrQRlRGVQJFw0N1anWlP8+Lva3JBIgzMbMIWRP6EMYtVwh0JhCI6YHXAo5JjvnsYMrXzhMcg/hkMiittw9Zk31vFWV6/E+Xiv/gtrKo68BZ19xpRjxVle+yKRAQjsf6fA08NA1GEVJlLdt2X+HDBjtpdLo9um9OBYK52iV3cpedMFGyvL4KlFEwC2FGpf3bpLwQ1b4SvOQQXmpRD5Dz3s4X5KTCVL8khv4XeGxNfDSDoOmUKWtXQreKS3yYaN3sFvjGCmt3n0aC9NF10aUW/Td9R1SLqyhMmlaRFFFfjXASgBy9aVo78o8IkqXQUbuCL672b++43bzRXjlUM/F9KZiGmHRFl80h5zaTGsuopJvmFDBjoojd7y8FkjhOni8r314X4HgT4rbLWz+jfUPRorpMLIKOXnz4p1/D6kjucFRILtjy02OY3lI/7+o3kJP/RW3ypHt+6VqMfqcCAKEODFTUkS3A/RJV8SWb3nwn3o39QKS7XIlbr3gU66XOJ6VgfxV+7VLGNev7E9h1r8aCDQrW+LXNEDs029vLmwHsWgEj/0ktxKUFYUpR7dxkuWUyqk2HkMiK0QoETI5Of9yfdPtPuVro5U+jcbcZkC3Qh95mSFAoHyC6bTwyWEvE7xeUp+kTGyXVfqGmwyjOG9sR4MOzPsC3F7gRaEPb9v1bfoEaDucAmu3UJPkWWinvxnlLEAMG4+yRAuzSxEofF0euBDgCTE+bGwZ5F99frsPEo2dJUCQ3Up0GM6a0DiYateTduHjPBiNAD3tUYLzqCOP3hlHGaoqc4x4O4N4GYLsIr1duXcSZJhPeHkcXCnuEaCucsf5DjLQEudII+JkgESnBMGZZDSOFXm75to74ozLIUAC5IDhga9kEyl9veFgWmZfjy0acnz4mKcwbgh8K70eRhEKPycvlbX5Zg1pX6X0IQR0Hi5HdSIQz6ORwYLEqQBE8dWahlP8WVqMiPQdTRzZwzbdPPt7Iaq/NCtMLkBumyZDK9P/USqHyERVz+VBLvEMvoUceteaHqLPv4GHCrw1p8R6MYlIt3pI5TrE+RnTQKQphU3emMFl+tCUObEMxvGyB1PPaIoUpF/LerUWyUXn1N6bvqo9YkBXtngy8/Lb2LQ+cvFFgDqYmUT9Z9KxQcOlgLDyZjpm1AvxksFiGf1sC8DyZNaghfgEFayswU9Wo2EpcHK5gai/7rfHVODq8q0BPULDwsjrFJc1ByxSjCuetGnoluvUlQL9pcZQKYjFB3eIgnVm10e7D/gZu/LMShkrI5gD6AbB+NZ7t6g3QAmAEgoxEYiczQHGRpRP5MO8tfrmlXJ1gyLSo1rsInj+vUTmzE46wghoSDYBvM/KUyO76rk18YwnEm2bYr8halxDGMWgyMcFsh25YL9CgOqE3anTqzJyq5CaChvcOaldkUVyWWQmUCzszQlK62gRnA8lQpR1qMEG6RDqnaioQBec0Vn9jBV1tTcbMRPr5ILwVNEoXOAjjs1RIJLWjZ6rR9/0XRzvbJwl5+71/EoTJ2tu6FhVgVYNALvbNApi0e/Zxmz7JrWgAIxrGKgw+BK+IxI5YXXMv+3TmXA40MlI X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a7977c57-0b4e-4d86-ddef-08db29739f8d X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2023 18:47:57.9940 (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: wkvaLXGdjGQtLAUJ7Kctn/piOU5FWdyXcCl/rcwUon4Dn2gUIURsRPeDla6TlUuR6RhNYYD7xNtT+NPrP+woPg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4121 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham 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?1760914694408662809?= X-GMAIL-MSGID: =?utf-8?q?1760914694408662809?= 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 --- 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 Mon Mar 20 18:47:27 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: 72416 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1396120wrt; Mon, 20 Mar 2023 12:29:23 -0700 (PDT) X-Google-Smtp-Source: AK7set/rl/hWummdVO/UQHWHXj0rUlHdBGVMnGT70ASuS9WPcvpuROkiKGheN8WqQymLXqRyvoPy X-Received: by 2002:a17:902:d48e:b0:1a1:cc5a:b04 with SMTP id c14-20020a170902d48e00b001a1cc5a0b04mr6329432plg.3.1679340562811; Mon, 20 Mar 2023 12:29:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679340562; cv=pass; d=google.com; s=arc-20160816; b=DBN65cxo2+xEYt2MmLBapZ0waroiJNA8woTHhbiy3lCdhQQKpBRpmOAk6TwSSY2deX msMu9T+OkhlPPyTceWB94HruPX83zyov7e4iHM5Nv9vb2kwTLDyKWbKsKlV1+rR801YB T4APRxf7Ynb+Sr8rD1axWSV1MaTGolPmWtquKcIRHnWdO2t3gGBwQvR7zx0QCdnycucE Pxk4m9UzXW33U3YGbGhpduV/R2mRouoXQyBKD/PmIJSc0PGO71XVbDCO3eGD+xYWoMhE G2AU2CfrsWP0PqLB88xHISx0hOHOKNsOHipPxdl71fe6/G+g9CyHkZWTeMwDoNOKu+ub 4c0w== 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=oNbDK+DUqBKNzW0lFpPO9bzuvIx9ZbzDhXd0lxx1zv8v4lLx2EHyc7iL6Oynx4r/fj fHZH1pRqacTI1Hvik6Ze6YT5xHYjmgghf8iqZlEZxB8dmIcVYBjUz//cSImXCbKJG6Uz AzBplvN+qHc7gntAsIlT4UAmlJ4HUDNYbfiG5KRZjJhShNf8LSqq85xpaZKqmofv+jtA rnGHrpP9LVHLTxFPYSsSni+r9Fe1tTHPai9k2xl7XZgiFm/dGUrj1bNrEGG6Ot+3sUk3 N6JT7MAEEVFIM5SeE0hBeXVKgrpI2/jdXLdA8RVdIL/KRSmMOyPf8S6IDpP5syIw56LQ xaqA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=aBATDY5V; 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 x186-20020a6386c3000000b005002c1ba496si11659770pgd.305.2023.03.20.12.29.07; Mon, 20 Mar 2023 12:29:22 -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=aBATDY5V; 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 S230506AbjCTS5W (ORCPT + 99 others); Mon, 20 Mar 2023 14:57:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229959AbjCTS4r (ORCPT ); Mon, 20 Mar 2023 14:56:47 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2104.outbound.protection.outlook.com [40.107.255.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EA6D366B3 for ; Mon, 20 Mar 2023 11:49:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bw6NAuMazjgG+pnIUPhBJZaXKI53zbIc8coOpaeUSrUVhSa5GnWzAFUbiVNsv4dntS+PFR1JhefIqvEU6pYI0QGQ93dp3Rwga2jsdBJ7ukKaojMmxMs+oGbkJOeB4XUC8UIa+bOWKHizpGum/hGzWVD2Gh6vao2PmKs//VmE+DjdTctngIcQYciIn4GWZA2w7/2V+ORZYHhRKCrch4agbd/SlO8XzLWHswO0duN1P8fcifuw30olW8HkOxvxM8+vXe9Z4RvT4dMkIjX2NJHZitqpdkbwWZZpI/32F+mfZg4GhBoAhQ2U/ogSX0F3EQO8Bshfn+yRrMI1ufn0LcYp7A== 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=gstabiD1ePKHrMRSO17DM1ZuhX6Sl76pgepb/2RyZZqklYl4PP8/UlfjN9hrhub1w7jJE03M2fRlLeQ8UK/k+/yaBWUf2kHDPxZBIYgFxWYIqZ1HvwC6y0nfO77EphAgmgjHmuYhVZ6bqf2UeN3f+G8m4fhw8LLkbcmEjCTtFrJH/I+55rF/9XB3s+0z0tLTyUotcIZ+Wj+9IjTAx0YVffRj5RWuHgVsF4d3lNj5e88MLRyN8eCA3l/pxJWeZLaTXOYb7DP6HFsSCs6SQh25nQx7N9tBPyB9yc9H+Q5Kky5Wlb+vgQFNTXwg20RTGkSyNgm4lUoZoIfHO+iPtyv3ZA== 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=aBATDY5Vo3vpDuXkqimotq9ggiIvP1OGInZNLcfyPUBAsRdU0W+gMB8WCl51ZlLssRFDfOkAfkIoQIzYX0blXKcH+wJXG0lkx3HJJHRDcToOFO1UAKR5FudUNnFfpTy/vHodnh6aTSO5rICWrWQmk9rs+vJBi4MVSVuq2dK6ieGc3Gojfm4BQhPzw0iDJ0JldtkKHZGQ9zr8oUdRyrCgSJPYoOPCS60zyGAAnV+94w8Frhl2+oZD2CnGoznQ7LhHTwouhNDTWp54lPlrebDi/pBO2NrSyGJwN1Gn7nSB7TIkA6pzbicgwCCvTj1B03tQe0IORiX3bwCGvuyCQ9Pgmw== 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 SI2PR06MB4121.apcprd06.prod.outlook.com (2603:1096:4:fe::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 18:48:00 +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; Mon, 20 Mar 2023 18:48:00 +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: [RESEND,PATCH v2 08/10] ocfs2: convert to kobject_del_and_put() Date: Tue, 21 Mar 2023 02:47:27 +0800 Message-Id: <20230320184730.56475-7-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230320184730.56475-1-frank.li@vivo.com> References: <20230320184730.56475-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR06CA0215.apcprd06.prod.outlook.com (2603:1096:4:68::23) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4121:EE_ X-MS-Office365-Filtering-Correlation-Id: 63eceeff-0fc2-410b-745b-08db2973a0ec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Fybil4OFEqy3zdSH/6jQHXx9vBcTAX7fZTM3qTpdn+GiNnsJ3W6NRcyk+xFawmnFv4M3eiTAY9V/LyAa9lpmAaiDvvTvGBXAzvrg1BO5TZP5dw75ZpZKwI+CUDNsePVpkAXzimqHp2KqnRdLHem3vG5h4EWWU8ESN2AENA/t1vYTFq/pL0m9NWVSQ8lmkPO4c3kPt0Bq0XR1zf6Dc4hUsY86qFlq9ZDilCTtDaD9s4Jq/VovgT1P/dflc/bRr5ChztybqgmVqp+Gett2+tIQRaPbASsGERVjGQn58s0yLlPMUFA7gBi/WF51GBNiVFaB26sC7Ha6vjuYO7d0IUb89lDKGgzHjF8E7TX6jd2JOjI5ow9l/DjM7b3Hzj69KClrLXzWPkW3TRTNS8UQB6/cpKdmzisD1IlLE1Z0MHa9RWVlrGz3MsuzuaOAu7sR1PKIcmTwfU3kYKuaHrjKrS4azyKdPnEpjIO9QaYj4P/j9EQETm9MMCV1nUrJb5AJVkEtVBGrGR3XfnArcPQPElk8jxJbF//6cOB0SCjtQXxLOotU66hjELsK4HxtqzRPp4QN97QJfNYc5jLbEolP6rForyxxQMCLBJuQrtf/4dpIpdILgQlR4saJCS9GmlZCMGvUL203fdLQWEgVlsFNLLVd4raBYaHPIu1GQTESX8cU/afG5u7ksPzzxbVUYXJiJXccsayyz8eTSl/DQpNZK0KZbg== 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)(376002)(136003)(396003)(39860400002)(366004)(346002)(451199018)(86362001)(36756003)(52116002)(316002)(4326008)(83380400001)(66946007)(478600001)(66556008)(110136005)(54906003)(8676002)(186003)(66476007)(6486002)(26005)(6506007)(6512007)(2616005)(6666004)(1076003)(38350700002)(38100700002)(5660300002)(4744005)(8936002)(41300700001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ABatkFZpoQ8IdTUB4eOk5L1vYjpCBHQ5Fly6zDZX55+0KjR8exjk5LP+nnmHYIOw4RCu4kFOkB2LMsJXvcbHKyL1DwSSewp3sEieaQkSIoezgsecNN9MFXek/zvj99rzovFXF39O7QIgvR3EyLRE6sQZjUUZ6cwFtqbWI5eAJuJ37vq2mtTOjmNjVTBq7yTIC/SQ5LYStxnpubLAhees+HKPyO+svDaoL0PHqgJj5kKhZ9IcQstJJ/3jSeo3dXK0p1GxZJwkToCVd2tBDqGmS67tWYeGl46QqYTczKX7fUMeY9oYYyLzdglkYo6MliWfVWmKrQHLjPJzMUy/f3k+eSfCofxPoEUZh/FpMxMHl2kmPUWww5kvVRxveN5S89viJEBtn4Afg+y8VGKKDr+zILnnOXVvS6l8iyrknpHreH4C6PNTtYwWiti/gmUM0lMyeT6btAJiyL4V4XMxN9ZSYPCjMDMpa6hVuU1+TVSiqJTC5R97EH6ZcBrR8uE2FK05/F5Cj4ChQn797Ymv5FgpYGgjs4MHHm+GbqDwfwy37GZ+hDvmP911MCiuRkWOnjAZsplXih7CyRfh+ycm78ZziV5M3EhT8oNjPv4sINVhStmoN7BN5o/LyqLFUsa+/MfVKf1yRtCwfispXry0TVMPQvfYOpoFjoChKHv1FiDfyyNeLqaoVxmwMc8vSMF/CADl7W9qAQcQvI/Za4ZCAWsXrqp6lkdzD27yVct5bP6MwxmJ+Egp2uf7pT6D3LpMfvJYmf4gJnXUGlGxBqfEdV2pMYVS9i9N7B3ZEdZAywI7u32pDMCZf8Iyt3mAY1IZ/ZiiEG593C9WqtiI7IwwFunkR7tGxKnYBHFTN6ffPUavTl5JiVJswFDnLHuYNT94dErLfCzd7d+SdwTGda6L9uhj+SU4BUTKcV0/xUPeTdp1V1ez3pyor2TVU7+sDEcHwzKnKv/mpL+8g1iqbZd+yg5GeaZiU7G9VFuvHK3SisS3CNchSY1jAP8T7mCX+Qt4v9o/bvmId9aDBK8MYBpntcgxzSfowd6zc/uDa/aWR7259mojIUBJPEoHIJ/nkxLssDHUgc/tNin0cQAI4fn+5pQC7+van9XCdTxwao2dVd1PUQPWTRtHcHxO7SwH8crEFZPmiZeCksc85ontkZpSN+Qf3xX5wwIMKDqpdQo5gdl+r+LE28KT4loGfSxAKRzRpErsCxPA1kt3Ivjm+3SlTBd8+CaTlih+osKMgbfVI7ykSQpEbtt/cfKHUYTeR7fZfhMOF6rFdexDuJi5rxBT1Wf6X7JeN+Rn87rV4FJzSFgxAPXWKAVr9uIOcJb0owGaMRryFR5ZiIDGAOc4aP5x51o9pLJmK35MIMyGGmDVBTWcgnnX9g8urRMVUtsS7AshaYkQly2SOYBMEiqsIg9QaC1fvPkfmzEP5MMZwpNFAyf08jpksNimWYOx/fQg4jH/6V3N79wf4mY/R66jcSu01JgM16ckwKK1UmSm8E5RazleI/Mwdvu4LLXMV+RSyClvf8JgfpnQD5Ih8v708lQwN8ZKItWw2iHJgO1Oi9sUJ87bBsdeL/fc5Gq4dZaCoNEA8ajt X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 63eceeff-0fc2-410b-745b-08db2973a0ec X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2023 18:48:00.2917 (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: ahDJeqPPStJH+6UOapanRMUCIqPoirXWDkKmXi5kbzwvOgOzZtcw9ns34UE9qAq0umexX9XXuupALxfY3UncZQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4121 X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL,SPF_HELO_PASS,SPF_PASS autolearn=no 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?1760916209814639395?= X-GMAIL-MSGID: =?utf-8?q?1760916209814639395?= 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 --- 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 Mon Mar 20 18:47:28 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: 72398 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1385402wrt; Mon, 20 Mar 2023 12:06:19 -0700 (PDT) X-Google-Smtp-Source: AK7set//HusFWwUgZYg+54vcv6Awrx2cQhwlMwfRDqoqwwAY3L8DZD8BIAScK6z/1O7tP+LttcdL X-Received: by 2002:a17:90a:194:b0:23f:e165:3452 with SMTP id 20-20020a17090a019400b0023fe1653452mr338789pjc.0.1679339179147; Mon, 20 Mar 2023 12:06:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679339179; cv=pass; d=google.com; s=arc-20160816; b=qnGuLxVQ2KND+gE4ya1UJc3HJRwofV6lEn8duiNRxzASwcIdCaXfUWswAmEtxWjjUv 9iVmNY8TsVhuMEHdiOHaQBLH3/sEinlzm82tixa4xwTR+QdjXKq+ik7cWNz2aC1A256p v6XP2b7Vv+PMLZQ7v7wvtUJJeEQJs2zvZlIswMKzzpIhjAqp3FULXOljQE6/5OZ6UiQr b2Mezl5UVPWp7dBl5RWvFnNK2OTOTkya+cJ/yVsAi6cOHPNG8KfpgJ1l5NQII4MgVxK+ tOIbiCKZ1w3LuTmJFi0Xg36DJG9Qf6EP1qaD8iiRwBR+G+0+vqUQGOC+eYUKDeXOMOiQ +cTg== 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=VjiEBglnqqBFs6fUG1m1I5ux8kNeoH9PhZNszvhwuNt7ToAl7bxgg4PLN5mOCDteBw ZQcmfGsxMTiktIECUIZ2nPERpVuon8ck8kFuPE5ZzLk68KqYQRFuc7/ewQiGID0hskga bZN402/IjdtqNrQ2P1136SDpKjrgnoL0BTQ3w34hgusvDFaosCz/YUd0E2wMdzxcjdSv KLBOSyUKzkX2QwnLaHLXK5IvFPRLJJKOuo3A4Wf6ujzV6/NT6TyzXsXsRitr0isvtbPu ux+TjvnwKBDD8VY14kpWavFdDOx4gGYWo7zEmXu9oiDMp/8zbAFSSTfaSdk7iPdc/mV6 T4cg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=cQ6u8JoS; 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 qe9-20020a17090b4f8900b00229c28277c6si3870276pjb.41.2023.03.20.12.05.53; Mon, 20 Mar 2023 12:06: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=cQ6u8JoS; 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 S229717AbjCTS6F (ORCPT + 99 others); Mon, 20 Mar 2023 14:58:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230448AbjCTS5S (ORCPT ); Mon, 20 Mar 2023 14:57:18 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2091.outbound.protection.outlook.com [40.107.255.91]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15C393C797; Mon, 20 Mar 2023 11:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NGGjGnLhXpayYLBKXNeEkx428TvFLm/SwuVHbtKf57V6tDfYOrHYxn1Hd7XALcAwUdD0J7tB+OzIa/yyRNZbAZyvEvAjcxOWe7DJZgJOMNuQKmygUFXv9FlQovJvowXVM4AX8GaSm6ob4sxlzC/dCMBaRR0qi5uCTMcwvonwZ4ndhs5n6XoE2HDt0wzOC5IAAT6U5TAbj/JFWOHQMizBZJGX0W8YySyWpS8iujyr+Crwo2HFmlwYFcsYRnaKVJlWxsAWbZMjkl5zI4jD8050p3vYm22BBYxr7uTI53y2EIfsF5lyvzmXk82ecqTDSkcmv55oVlpRYptcO0PSoYce4A== 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=JoDNtz44sAJbm4FBYgZF60N+N0PTZuKZklnmNpTJq8rGYG5njLh2rciJZHrMBN93yVONHYGOH5NJOIw7F0NPKQo45h5s9BSvlniQos+9AVasBwCNxzPR6Ixsk+6xdz7fCrP0K6qyK8sQCoHDVyGz6ix4iEbE2h1Oo7LOebBkEY/4l2XYBnATbqQ7DOFbhdhTxW6TMBjP6UsHon8ztzXtXatMzUf+AwtPRxMj9Rf8T6rQw4A6oWUcdTPXRZG/jrKk0ca8SADoJSmdKzzvTvPJWwI4i5TROgTJ/6H4iBDnXwjwJW5dpF/62pmgRE1EDD5bOBtJSEI9G9XnbKwaFrfGzw== 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=cQ6u8JoSOHluLYhj1AXNogPCky2PG6o433Hu47t99moqNtrLmEi+Yss4ZCAdN/q/Zzlx8/5sw+sA1RcyBa11YAN4HjJty+Bf4spYVEGPoXqGtxd/5keZ6CEPZqlR3YSd6BKCCbDQ076n6aj5tVlbLm4iKPLU0W4vfpaPQ7IU0jIfFESS2bxcw6VgiRCaJ9U1IkBPwYm5EjlpBYoHXTIEXjFkwIDqxnP7BSO8xHGVnaogPpnFZKsXsOHaUXlHCy+iM85wmSKWZ3WYm4fq0YB0HaPtEAeARfDvmfp7j6S9tkIFJLd4n+cNaFRgtYZdGGPX+rr9HnBxVGpRSPhDgJgpFQ== 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 SI2PR06MB4121.apcprd06.prod.outlook.com (2603:1096:4:fe::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 18:48:03 +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; Mon, 20 Mar 2023 18:48:02 +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: [RESEND,PATCH v2 09/10] nfs: convert to kobject_del_and_put() Date: Tue, 21 Mar 2023 02:47:28 +0800 Message-Id: <20230320184730.56475-8-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230320184730.56475-1-frank.li@vivo.com> References: <20230320184730.56475-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR06CA0215.apcprd06.prod.outlook.com (2603:1096:4:68::23) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4121:EE_ X-MS-Office365-Filtering-Correlation-Id: c9ceb05e-30f2-4e95-2a66-08db2973a27a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VgpcpRbZ/p42qp5kOKRxMEYBCI/bIOzPDMY/azLBGznK+yp8ZcDOuIkfA1IbdCMgmhMKUQHQtqRKp1ar62MG0+acMu6TBzkXTiu57lu8JdFMbD2bri3GoJdttOojMElM3pRbcs2dsO+PWGCgbo545nWULPnVLHuI89r0w3B/kQDJewt61Cx2pWJ8jdoZ8qUJVFzcb5tvAfWaxAjD8SdaUEBS01+P5c6q4rtDb8/5JtnAsis+vbtdrBxdzFbV5iB5S56OIh3moCbtmGBqOw04vhAd4uZ32ouPI5Q1uj/3LfDzngXOnYTb6G18K7viwYsCHaLIg+t7A8tBZmaSDcIkcEMxvtM5TX3otX+kh60bRWQmzCoqvv1oDrhKMDAF0y+t0lYEq5MkqdNww6Ab4iOyORpJs7FHkGZxClsR3V7iHdJAcT88sYvCxKQsG4gVbDZ1cwJNT0JEceNAgZhNtag7KC6ufVVklRgDgacu8urodennntfocMqyM5DmIS35hq187NLxSKLXQbudv/jpxhrneqBpAg4eYbiO84R5fMDqwXD8GhJ0N1lovKkb2drpjEYYMG25h/SlM1riSNr0h6y6HMjvFdJmgz2/3SvslO69nx8FERmJNczJImGAKf6h9ZwbTjcrOFEM2QdVtlu1p9vJr1SOlfldZ8j9NYV5/nszz73Sdk5o4k8BxXRP9IMRcAuHX9h/viiLLIh+cQactZXH0Q== 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)(376002)(136003)(396003)(39860400002)(366004)(346002)(451199018)(86362001)(36756003)(52116002)(316002)(4326008)(83380400001)(66946007)(478600001)(66556008)(110136005)(54906003)(8676002)(186003)(66476007)(6486002)(26005)(6506007)(6512007)(2616005)(6666004)(1076003)(38350700002)(38100700002)(5660300002)(4744005)(8936002)(41300700001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MhbNPhxAebePxin7d/ktdJdxO1Uy2VZP0Rb3c01/grTnEJ1ZF7y+u2u4MFuy4VXsUr6ZPN+qTPkeTgcygVY/Jam8Ffg74IFlUYu+B+oPsPoigtk4VHAwWjr0GZUO/j8ayAw/Q1cR/77T/fLOj6kMnuUBHfPPcZXq7o+ZJsOKfmrbO1cIXxAUfyVesdTZ5ZzJec7mdTPV3Dd05inSmblWw4GjUoex1C0jaP6zKPtoRc4KFJx+XuZtoeBwekoZOzSf0bzaXSv8n3b0bwYbL2Lj/QXWrz97IgWT95gBoZy5WNfzsFIVyNCwxaSWZyLw4b9QpZID6EDweAC83/15DS8VzjrhAmI97S/x6K6vfkX4Z6ye/AMEMqNqc3Td2NKLrU49NcYnYUoaDcgzN4ZQxwT1rBouPLMHhH0sRd1NzJhwDgBwfpqa9bZl8qUnFoTyPBT6M3E7//qMtdLzLCTnCYPdFV4ZbsCvs1TzfJR4kaoZ1EFHRfMXVjdu7JNaIrSE2gLInH0+bcf34ljhyByDoxZeiS0NN680ie8N8ifEqj4NG8Qa3HbnLBUEVLkBQ6OOJmvtlH/SD3cwH1fnmwYgsc5ByLPgewsNg7svLEppB7EvJiNbciCH4CgzhPdNixB5UUPpO2yEmJrcJz7Hcvrwy6UI6AX+g0iL22GH7zuq61jHISYqNuSLM9GHUtr5lmqmQKi3EOmNtCc96XJ2raTfBvZGMZ9If0IyXDOSbKS+qFV0kctktXnH/vhTCSwVan6wpg9T//6ySLnFcWDrYyEwt2BuGDzMQK4djmtCWsoaXHZvnE2A7KDoQiQRWpSvzTq2ijlJXB0bjzLOv2QU22I5iDg94Cgwinw4rp+5CgWgkIMtzRB+KynHx9pi2J2ihKCsEEUCrH2Kcy6nJ5la6yGMGJSlwzxg+dl1NNpWwFdOJ9Q1dejhTGA0n/cWHTc+L61zF+rT4C779GtS/HI2k1+Z5W3+oYgYudwHXSyCBfa23RMsArWS8rXPD3OfY45kLP0xnrHdL8Y5CqOUNQG9NO/G45SM9AkEZxHv69iu7Zull1AHNA8GNL3XvJz1miCiIvd/fb3dVjIAswaFBSa8s03wnihUQa1DiYUv4cPwm6O9vo7SO3Jsgc9Orj579JEOwhK6dlHzP+lja7+IbAxQiaohyA/HVwf1H3WH2/tIOMfE+yFhw+P7XrHDwByygtiV+w52fvQ45Oq9Fa5NqnwWo9Z/hPo9vc6VuZTTLpDt//vV2eDkr9GrUP2EBc6lw7wlKbhWhdxBuzV9TXAf4h6O5J3c0vZpOQAa/D9LBreShUiWjeARRc+NmxE6+I1igFoSwTJtkK2VBIMXGrsBRHny46Ayj5zPIw9TGMPyv20GJz8oryHRxuvK6/6sxHzL6vLUfe2izRRSmsNDr6dZ8oYwH4fcT08HfMkdgmSFjwRaZ/KCYx93NNUH6HKuwwGdeNKsqlsshN19CXreCAXcBZN4Dn0Dyn3Me1LHk9dDpGZG7kUPfAn4LlVIXEFKDx0IXr7Bo1yXQ+JmoWxHhPvHhN7C4+MLU17pr+ULsrbS2uMMk3pdlDqmyxWvwRTUS+uia42snAdBpln0 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9ceb05e-30f2-4e95-2a66-08db2973a27a X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2023 18:48:02.8804 (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: KeKEvS2xSX97EDz4w1OL9EGXa40rz2zwOErIFu7bWgon08JLGDok5SUt5bksKA4K7SW/Q3yYQmKURixcN5Wyng== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4121 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham 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?1760914759070315506?= X-GMAIL-MSGID: =?utf-8?q?1760914759070315506?= 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 --- 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 Mon Mar 20 18:47:29 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: 72414 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1396079wrt; Mon, 20 Mar 2023 12:29:19 -0700 (PDT) X-Google-Smtp-Source: AK7set9yYO8lOJ4TZ3mB7cArIXFjFi4XzU+34oq72krFU/4ZF/7I3tgnYJB7YfivjInqkvD4YFWu X-Received: by 2002:a62:7bce:0:b0:625:1487:f06c with SMTP id w197-20020a627bce000000b006251487f06cmr15828129pfc.29.1679340558946; Mon, 20 Mar 2023 12:29:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679340558; cv=pass; d=google.com; s=arc-20160816; b=ZNjFwBvOzXZs4j8GBbFBVTZN6fHK3mURP1CV1jb8S/w/hh4EGqwYLp6Iry8KqTjSLZ EX+pZAcD+g+WpTcNDY0FelrUWnzivO+9HcbEOnpa1hedaejiqfrNGqV/slCx42Us4BXd V6KCam9gBP/UE0iQV1zP6YBKI0XjZPg0zHT+1IWDxVuR+NFmdp55juK2IYYhVZB06BJn 9hLV2SMmtAfR32ux/Xs7bmS7HTFlFiLqet05HT56TxZ/libzX0739hB1EWF0/rFxXeRN 4QMTo0NgFPQI5neSx9dz/fl6MOCWj9uduz/saG4PFerZkazTRkKhc5sgkt+5F8vCQJMt /Gog== 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=oSrsGN0v+zqcjwB66XuzRdnbSMQC0WEFHGURuNv8XbIHqIPW5Xy1vTg0uHH3l2pJVa u9+p4V/GthMeB7960X3Jlmohb3g7q0qzN4Q0Q7pJwgvx98dPo81VLYLhM5GiL2vvOWQR 92fCPOpzU1EQPZFROgVrY0hjIXHfzZaKVucXNaR4CKh8M0+EGSEIDSCpV5DAep5Ve0NW H91BPuR0Obq2K1lwSXjxlnl+FwKA1d+UpMqDt0oA0npgZWGV8AsBfRVzyuX277Bg/leP O9gMZiwZkgqtnLYTMzTEsUSIs6S8o0W3cbJGlaJE0U1uxaPdQ0lQVMZjNQOmgxRxyo4P PBRw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=kDeD+jMj; 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 j190-20020a6380c7000000b004fbffa7d04dsi11270563pgd.863.2023.03.20.12.29.06; Mon, 20 Mar 2023 12:29: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=kDeD+jMj; 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 S229989AbjCTS6A (ORCPT + 99 others); Mon, 20 Mar 2023 14:58:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230510AbjCTS5R (ORCPT ); Mon, 20 Mar 2023 14:57:17 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2104.outbound.protection.outlook.com [40.107.255.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CA5910EE; Mon, 20 Mar 2023 11:49:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hnH8nEQd66FZ1cLIA/M8X997vGuWCnKLaOPFnhlx09SZPH/12x2TVlrxBg7G+pg2JrkVLHMeOU7KbKTQG/n2Kt+0FGOZ0QNpzVnbKFoTxWurqiY6HDbCusot9H4bSv9QCVMZIFerOiBG/mNdY89YxxDjJhMFRGeZn5J0P30gBI7KMmAC1plxjxPbtKuzO2byifOBzcM3eBOeL5J7BpUj5ysN6Xwzbe6QuonFXl7+rx3uL1yrRERXWlCMqcwi+aauYu50TaiPVeSBgTBAqsIfubTkR8Hm/JPbXHKpRjaoI8Rv7N6bDNGhVDDDXIQTwx19KePKVD8H6TWqCGSjELXQeQ== 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=kjrQyqDuysUYhcUhUKReIMy1ofxS6OawhH1kwfCSmdLR/b0/3apCn9FAMi61yF5CRj3RBg1RH7xQa2WpuYiskE2rVo3cKpNSXnZgycdA50ZZFBFbvNkXzFG1b+C1Go2y7aIZgro5tLUgXycF7y/Uux/AbqGEOAuxRTGoxmSFdZUURoy/hzpXBezXLECFtD5/VDN/GQRl9AVlOXzThXoRwv+t6ETiMscKK99XJE+A1U45fnQAZsv3k4xejvtyU8jcJDRywIqp2x8qAje/7FqQF74voOCYny+Qoi+RvuuJ1bHkgC/j29qZE14EPNcL04RwEX2tZBl1mw7NFeLOlaMXPQ== 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=kDeD+jMjL4Hor89FZpdLKWL+Byaf/dxFZiUqOh9KskRW/VXim1KRKpb7PIL97Hl/91BlIJ0hevA3Rp3Daz9T/T4/WalOsFMDWDAz9C6nMFn6PjBgmBtDg2/03BbnevqxKkqJEoPJgM27cASndEoJNt2sLLkbfe+vyXpxQw9gWeLxoCO3UZ8ItHhmTCg4V21a4XUhyPnZf1mIrm8vNoBYw3frBT3XuYF6RcS/RjfyhjRG0H2o7nehv1Xdtd01bMYKXlQt0qCeJqO5LJalD1GR8ImKyfQFF5V/LDeltsdLN97FAQrD88Ksq9npfnKwSwLpG7K7IIcidGUwbL94nJ9fBg== 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 SI2PR06MB4121.apcprd06.prod.outlook.com (2603:1096:4:fe::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 18:48:05 +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; Mon, 20 Mar 2023 18:48:05 +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: [RESEND,PATCH v2 10/10] nilfs2: convert to kobject_del_and_put() Date: Tue, 21 Mar 2023 02:47:29 +0800 Message-Id: <20230320184730.56475-9-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230320184730.56475-1-frank.li@vivo.com> References: <20230320184730.56475-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR06CA0215.apcprd06.prod.outlook.com (2603:1096:4:68::23) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4121:EE_ X-MS-Office365-Filtering-Correlation-Id: a62617e0-6848-45fb-3804-08db2973a3cf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j3NzJHHgVLk3DxsLLEmVqY5hPuPFKBZUanSvs1BxgTWor083j9N5YCr3Z6lkzjj3ojz/2Hz8bAD0xLTsV3B69vDBbHyEHFyucl6zOXyyGQjgjzjAYUqK0QdjOTyqrnMuz2+ehSL41bSON+VhRpH7CTvGSxOShTK/Kq+NvmD13KGAZi/oycYQx4gRpO3+ViBbbRV8MnhgHbWp6Izi/WtoBxCdCeOQcmAzFsv270Gw/2IAaOhnPcnnMEn3iLfF10XmIC9m1dV9C56/v1g3dqzWD+3w0zyCeVCXNaw0NoVWUncS9gqoOpOYHQOULdniv1EchQoHO02+UCb4runWW4k59zTDDQHmKwenhULk/RaMKeZjObVpsC5/Gs+NGEeIy6LX6iHLVhlpMaByIOHorj9wtOT8zjQQTx1+Qb9ZGKBSRbcLDOlEwe63nxBgGIR2u6HWJRVXXPp2RKSsKCgkTZcXLqRBBH6aX7tQ0/PO2l8gRQUXKp5yR6nfEIDF1XscOVsGMkjzp8D+syNUbHigeNgtmilZVj9J1/hNT6mhAjy29tPiD+YoVjZT4VG500tmDtJFXnNGoSWtn08T0vljn7Tii79y2DsL/NsK82WNVmRbWSpH6QyFF+VXsr7gIDO+1p11rVVhwvDDZLhOGXAzncaLUSQdDlWJ1iaGArEsrJuPJgfTqpW6z6o3dpgR2N7dPO7LSbu7XjBXAHDfxtmNYbf8Aw== 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)(376002)(136003)(396003)(39860400002)(366004)(346002)(451199018)(86362001)(36756003)(52116002)(316002)(4326008)(83380400001)(6916009)(66946007)(478600001)(66556008)(54906003)(8676002)(186003)(66476007)(6486002)(26005)(6506007)(6512007)(2616005)(6666004)(1076003)(38350700002)(38100700002)(5660300002)(4744005)(8936002)(41300700001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: p+RkXLexjEDj2OJdqOF9HqdDYJrzXeABMXGl3dTi+yFAMHYlSzS57jFYldU9SaGvKR+5JTW/4ZRF+mgs1qwrIr8OHHfgExL9MWQ7GTPwBPlbVPZTURR9thu7S+BHMV5QotFSEoQQbgoEIhVL6n2KQhCib7ya48EphykeIv7fQmmXv1Td9VDSfrnoYCP9O/jEV834B89huaotmJKrzJmNcpXFwT+fXnl3C37eGPO61SkypkK9ChDeZaNNBIt/cshZ2rTrDk2aTxvSwBzQFy8v3HzZhhD8WRHeiCk/SZ44NkY7gXznB+l0uL7vb5jpacYHoDMwIgPQp8fJ8uLvz1sRcDJBt4acKLWEmm4ddmlhiqRibz/8nrjKRLNyLpa+w6CuqdrgFlGlWlpoiGa8thrboQSMqFvyu/bGSw+t/AMhgBOj7Z5/5u3o1HQj1u1eKBjiWCL+5MbD+IRSrcMOo+Q0yEbiBXwnbdkGNMlnUhfJgvTkHbCQrAI52o+WvMqWEB3I3/Nw8oKQWF+bKQnj5or77IhJxn84IZ0kiE1m6/9VlGLSlzNDkb0IQMOqNuNQP39CchlXRquRbDNRjguoGYNu9VogvUPMH6FL2TxwQIHBtM7QQ18jLd7NqysWOAtBRu7pOeCfuvnjtKF2AvZqMLVsgixixu4Rd1VMpuH8SN8EbCfVWxgBNrDQ+XHL8OEPcWFaOWKmX8ulmUPd76I/p0iWRovlEVACP/HkyT8+JylEqCKIDpFps66WugO05aucH/v1SRXCQ2jlaGl65C1hh3sp6Ixrz9ok/ys54hLnScqa1A3vfuIdIbQ2AhU0/kchUIf1Q0i68ul6KVQ/yzeDFyKht/Vmoq84CsyB67+LZV9bia0krTgBDqnCPH2tabR++tozstlNz4DMGi025F5amqUwRhZP9q6lt9GjKoazgsAyqWAwYzqHb7gxWT2LSWiArGlmdv8OlBTAWY1T5aecbK6+pH4uW8qpoUqbVMG+huHKtk1cUaK/jxCrOSvmaGnrKnXXVHmnpUcpABcC7HpnuqjC9BFh17Yhchq9DjasHr6DwlLYuWL0XfAARn8AAplIqpcK+Sp6oH/E2FVKbrDNBt8tB8qZMSs42szdFGja7Ye2OFB/u/33Py1lruIR+0KABvpxP6saHnVPP18RoXVfuDUlL2/Lg7s76CBzZEuCwmBK4eqCAJVB1jLi4nPpG88RN6vWki59HYlQpkvfHDRP7wjxFSKnqdxWy91vEawkTfn0ywUIdpQGqSZet/lGZdaMyi164pSYZ+kiASLo66b1Db1zCkTPrEhnwp6YQZCJDWCqItjvaTIpJuZckgyMn8u/4xcopWpWePBj4abmIW7FLuwdVYjrVf0SWf6cdPLKTB47U2lbVBRGp3ZD0gvsLrx4oZz5u69iAZszHxpywBKNhBxzAIwHN0wBVhGpJpCOuIm0bOVX27ftHa+PGm/MChQhrNEkmtmJb6wIvPlHV79ZPUAUxHSOxO6F/iPLXYyD6P+6csnWjIG4oZrIb422WGaZJszS71vCevPrTmbhcrjYlbxxUSVYOElDOMax0J/CLoAAirmIqfNBnxx9jD7SzpyvBKIy X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a62617e0-6848-45fb-3804-08db2973a3cf X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2023 18:48:05.1332 (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: inzKkml9qGYVrucX3Vclfka/7biRsrxTiytsYxHaHLJGuLXH1L+DSzzUdOM0S5tqmtoJOmJFHdiS3656xWvxEA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4121 X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL,SPF_HELO_PASS,SPF_PASS autolearn=no 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?1760916206293344913?= X-GMAIL-MSGID: =?utf-8?q?1760916206293344913?= 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 --- 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); }