From patchwork Sun Mar 19 09:26:32 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: 71741 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp654074wrt; Sun, 19 Mar 2023 02:43:05 -0700 (PDT) X-Google-Smtp-Source: AK7set9QtoLUcNXyjZ7WcIHaDtCuLo3ApT39E3W+bAGLTvkGx6iGdTDfI4rg2eGAjtHj1+QxezqE X-Received: by 2002:a62:7bc7:0:b0:5ce:ef1b:a86 with SMTP id w190-20020a627bc7000000b005ceef1b0a86mr11340969pfc.2.1679218984705; Sun, 19 Mar 2023 02:43:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679218984; cv=pass; d=google.com; s=arc-20160816; b=UcTDaqTRC3kjyBr8NKkdFaOg3cLF2GpHTROQw1cLQCN5l9DS/ilewkLWWHHR/C+l8g CXmmC8eOCq9LK14i2mHRdd7gts5Rp7ODqZKZyco13HtEEj6DFt6mFPOErQt5HJxNhI1V C/Y3XkGSgc4CNL/by9E75bmS0iFgQaQEhEvfKLFSSHpiyFM+3VD8zncOOB5TViaAD1xl 06run3V0/qyR2GRTt1w5F50IVFnrbVZXSsYzokLa6ligebmNt/9VJ3hCTGcRQ1Q0nGZJ mGViUNGfP3J3ySPrR4SkwLDaE/TDHWnDRQNG0XywGuzYJ3O0JG7OTThThlKJQSYqWk+f t6Kw== 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=f/Ly6n6zozyf6Q7d27WyhzYVqOabq1IPEThi+wvRY2o=; b=pi99D0DebzVqRFDZU0p9y4rcdW8xTjwhz9gGnYApD/PBb13Te5yF6lkKvU1IPvRy6S +fH7nzqWqr0nwhsH2J/CPK5CPvZMj/pEaP7LrJy30q2BHJBFkLE3sz1l+J72Onu22LcX H92AwaJZ3SGQDgTOIO8qD3rokAt4pYpMqkAQaxEuxd5uzrF/ziWEhMEsbbk1zwoMKhL7 WKZNwzjDbNH/0wz30W1eJOzETmYl3E2NDpkvaPxwBGZDO/VfA0Wl2XtaRN2o1QPHHFZT XEViP7Vuce5DjaCnNYwEUhiGkwK45w6zz55s7OYBF2zLl19MB4uGwkfM3wIm5CDKBa51 umIA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b="gzwR/TQM"; 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 m36-20020a635824000000b0050beec91e30si7080949pgb.768.2023.03.19.02.42.43; Sun, 19 Mar 2023 02:43:04 -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="gzwR/TQM"; 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 S229967AbjCSJ1l (ORCPT + 99 others); Sun, 19 Mar 2023 05:27:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbjCSJ1e (ORCPT ); Sun, 19 Mar 2023 05:27:34 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2123.outbound.protection.outlook.com [40.107.117.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82B4E19F37 for ; Sun, 19 Mar 2023 02:27:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DW5WaaAXFBfqRsLtWMFuA8TZxZLbeckBGdlf1q2vTEiC+WyQMJ0SMEi/UhrYGEqZnHWh0WJuLd75Uhe4tz76IxQryYEzd8xZfb6cS/h8ZmHuLRsjzcMdfobzWc6+A/zgOegyH5f6kNPIdWEkUXHtiseREYZgyWgUs/Qi+YccwqwxLs2e8sqOVEwbs4sRTycmG1A951dzYB2MN2sEOX6oUWpa/Q9e97613z8smK/DIuxzS64m2ybsKl4+0UIn83Z9iLqNbXvBN00SrQky+RbpSRxIaT7LRUIvj0/VTSPHMfWB2sCt81QkOmI8dq9/PAmzGE6Id0fJNbkg6zH/ouVHlw== 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=f/Ly6n6zozyf6Q7d27WyhzYVqOabq1IPEThi+wvRY2o=; b=lghzOV8zRDfRQxtR76jse2BgaDPtBqdQYxySm8BK9x4dRXBFDkIy8mzLLWaGlPuWtUwF+CleKHnFTjJ00o9ORIMrW8JLegUyVG0x7fxF2a2eTorKGHfp0urkZFIm5PXlDIITNluAFPPj3lLK9pFZGUQhmX5CmQqlMWN+hWJxbFwlduR+yxDvlqfeTVuegyqGi2CBUKXARubYiSRMS6sM7gOLOVdUujezNabDyt95gG1NCEAjIbHL4qSddNLPpVssxT+pPUljA54kCm9pbZMW00j4L9fw2l+DIh0uOvw9qMYDofj/FuU8hh6KwB/WFAbaf1gKYI4mAiGo9ptz8JEAEw== 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=f/Ly6n6zozyf6Q7d27WyhzYVqOabq1IPEThi+wvRY2o=; b=gzwR/TQMQd58w1aRTywAJ0krwb5HsY3G9q0oGEk/lktczWED6eoLybJrVImGhmlmdXgAGbpbR5BeN2Zp0D5mLy5wQQpPrSgSSH4M0Wh8+5ZXbU6agbIR0RqO8XlhiUmmlD2nLidc8QrKchGeLW9Vcp4eONHOPI+OGe10F+X/M4ra4CPNUEy0sgytwNsGoonZDjlucFw8YHxDiPgQHugqVWEoB5NU3PGeX8tMRCsNXn4xnK7AsyVzn0kZCcvurumnZMLHynjrob1ZV3TD1hpmzvuDGu1LbmXBJ0qksMFLIu+62V6kPw/ExjPP62xtpu4cgBPEIpsKlM627PBjbu1Irw== 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 SI2PR06MB4012.apcprd06.prod.outlook.com (2603:1096:4:f9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Sun, 19 Mar 2023 09:27: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; Sun, 19 Mar 2023 09:27:05 +0000 From: Yangtao Li To: Greg Kroah-Hartman , "Rafael J. Wysocki" Cc: Yangtao Li , linux-kernel@vger.kernel.org Subject: [PATCH v2, RESEND 01/10] kobject: introduce kobject_del_and_put() Date: Sun, 19 Mar 2023 17:26:32 +0800 Message-Id: <20230319092641.41917-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SG2PR01CA0137.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::17) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4012:EE_ X-MS-Office365-Filtering-Correlation-Id: b7655930-280f-42ba-8f6f-08db285c1ac2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T4A+JE7DBnIk8qGoYUz06DM2s7V0aIct6iWwL6ox3Tt0JhBMfBuSmQJ875/Eec3Wg2TmlR7jnGlKy86tAsmTu8zC30xI70OXRrNj/58rVwquYzRUl0kE2EJSaFLlFuzakVnjNjxWYX9ZPV4X8L+LLrp2rgat8ZkQZ484KcGMCVapn3xxGyiUdsvQZW3q80BIq9ccD04fuc5f+LSsz5kCSeJ5bEUWcJ7QVXcxgUHzq66un4HpJyk3UQ1i+cN6Te08clxQfX6qFZ+agrCdowPYZoR3EiA4b7KZssm//9ILGcfBFcZNXDG7+VOPpNPId5qzq+3/fOlLqjN/ZzV8O4oIz4n8iASaplPFh+a68ZfkPjzIlxaEfO/f20Q6kmg5FsYYjZz0Md8BR+gXi+Mk0DZ1VCLXKi2v1BEHOLjNg67+2p+c8y4rrZ0ONhx3L+miPyU43LJ9htN0pYr03ZpsN9I+9NlhCCRECtNErKVNLVvWhtsfqHDc3sIm41cpOKNUx2p69Amz60db5xEByh0Lgw9zlPdlG8slk0qDxXXfsOtE3tl/EuuIPkvRGeX0kYkeNtGCrGb6PVlGkvw/M9D7/cksBGQ8v2yWGYlgYZ0j/vXo++X8jCQrChEblqKgbl/QhkpCaaHJAp97+7+haO6GPxxnpT7k/Nm7lABmF7pr0dG0t2k00k7up4lv7Ksat0/Q9T2iqXR0V+J2Eskd7BvFK0wPQw== 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)(346002)(136003)(366004)(396003)(39850400004)(451199018)(52116002)(2616005)(478600001)(6486002)(83380400001)(6666004)(316002)(8676002)(66476007)(66556008)(66946007)(186003)(26005)(6506007)(6512007)(110136005)(1076003)(4326008)(5660300002)(41300700001)(8936002)(38350700002)(38100700002)(2906002)(36756003)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: o4m0N1LlGV7da3PMiuSqsRY6JDc4BuG/MtkZzw1vnKHZdjveDFyP1QeByJm8XcFSP1b7CXpGHK/M11zkZaMndNAYSCbnOfC5E7QXhKy80mogvcK21Xdn40NCPJGwCdA+vHMr+tA/cXtsVL7hz2Em2jo0rWfH67QKMRzBS3nVwJewUbJz4mm+86g8L45HlMBWQ69atd24z/UDKSK69KW/YYidjtSaNAILlWB2SLPVqLduz1VdRmBmTzT6ukBngQSlxxhzJUYR7Y92AsX/Z5GiKq46EMAXmqBHSNBwp7y7J2GVNyEyI+JysXwWj7sc4L8U/BCIhJ2Go/2HHhhRv2n267qKp9eYcykune5kwuLf+YGw7R3Qg/HVCrekA6QuZ+T/XeKJnxvqfRoJer53HI1IJzOByANhKdS7H3tS7UzQ0Dd5kyQmkiytno6ELR+NFcX1BjmE3QeU53m+ZdqigdTRvXom1gxfYn4l5OJMd9byRmpPz3o8lEZsQqr2sTtDzHvwWvE4BGasCXFc56/H0CwFfkOIR4/vpv4yNefejgdkivAPDT1NnDdmTSP2CIiEQD8Ry9v0lfBD2jTbViugLLqe0FesxWzrcrlWM11zOQRFxOy6NWxs98mh8j8o+CrqQqQzj6NLaV2sSeswRiD0W6QCLC3q+AMwuZ9A82mCOC3lhrdX6WkiaZSykgP/2N+9xPjGSwR8ZgP+DMdS88gIgRhvz1XTo9prSfhzF4ZY6nHLofzd6nNYzCESrz8ibRh6N+ZQWDVcOVPcEWyMLhm2tqa1/wHqYLOE80F7q9ToxnBkwPV+5CV9S3N7i6You/bI9V2+12QRKATisz+boE34F+XnvNucSxj75Sw5E0HxdT73yjWnB8hT/088wQPImNSYP7pbqeIn9z2TJwpA/+RSq9/03MWUF/2FPBopIDRi9jCQx5RC7WQ1fbCPGk26fNZPlajN0cOvUz2fwja2X6WEGW/U+HbtPir8xEkOFC9QZia0FNwYxpyvISKhJyp7cakzZye6CanaGJN2rPvXb7g5giW/kw28eOxWd/Ofk83qi31CNkSTPqF6bSnPDcgIR/62uUas+QyKHnY1n2ZRQq6VWhL/62q7By1IQ+hNdU4yfSWJytYnrjdyBeWdiOpY12hG52AF59Fh68fQTQ4BciMpDNnkhmam+EynJlMfGuPec8aNY68oqSngq2yEXuzkg5rGdhMqSXDBJtR5t7ecF1+oiqHVvSkbAjeNW9LQZACzqMb9ThqONQ/hytwL4TjrBacA1VOrj/0HUMlRKOK/8wG3z9iny12iyH1lAdOnvx8emaVIDTpww7/BBzX3XYZlvWTodQ4R02MF1w/5JgvrODjGjPneP650u9d7tumooUtd1ywv+Kgm3wZWz70vjT+Rz+/U0uwiy7G+GtrEZEujW7EdDG3mer64+N19vQghd+jQW3Buf9e4tQuMMWXfZoGYfFJ3lzI7mfUiRzzBhaYcYMEoNhysp1hMRk27StZJkMT8ofw4YM+qlwtmMZwKEzH5oCt98kNr0dCCS4jYqGseAljj8yT3JzQ+mgyusFTefhaLv2mmKRAEsfCl7OQ/kBOf/bJsRnAq X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: b7655930-280f-42ba-8f6f-08db285c1ac2 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2023 09:27:05.5367 (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: JjnrRdtaUQvX3jPVse/tT2/yjMKQHR0eOfAbuNNhdiIQVanJyhpGnirTgdSZi2id6nj9Hv9cn5ov78ciShW5wQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4012 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?1760788725847988802?= X-GMAIL-MSGID: =?utf-8?q?1760788725847988802?= 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 and Rafael 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 Sun Mar 19 09:26:33 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: 71734 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp650739wrt; Sun, 19 Mar 2023 02:28:20 -0700 (PDT) X-Google-Smtp-Source: AK7set80mO6A6hWIdqD31FBgqagUCvXS5UarK7v/ifhbkGYRhRWVHMVR96UJRydS8otRVw7Lkqeh X-Received: by 2002:a17:903:182:b0:1a1:bede:5e54 with SMTP id z2-20020a170903018200b001a1bede5e54mr4128419plg.59.1679218100380; Sun, 19 Mar 2023 02:28:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679218100; cv=pass; d=google.com; s=arc-20160816; b=OqVmZY8V5KN4/LyP3bPOuqBv2CN7y4z4WhHLR4Ofvqbdnk4O8w9jW2rYu8/JJMzXQR 1XX46y18OsOj61JyGZwQdsPL6hgRbHNN0pjRcjCBQQewewoLBjCkTtZPeUOMrFwjbzJh he3dP6tVEiYiCG8ezoS7/40ZSDFz5K+P1k4kOFnu46Fg+YIihwmUuyS3VzPdU0Cj5TcG Tt1MVUc19JNskO9GPtiW5hhPINGONbTUROEFLhb6lOHKcy31ZY93U3dy+mOOFmg95tZ/ IwxPQ2t3OOXa7tgYL18xPzpZpLg2jYCwFfRsth6RjobXa/bsKy5Z1kg6UIsHGVZC4p5Q oV+A== 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=hlI6qokwpgOkaE5Zh3c3JyOWZOSK5DXV2jjrjRhAFQI=; b=FHerGPwS6W7sUkjAQXwmMYSQvb7O7ZBu6uahB76o1viB/cbKD834ILgYmDjlwf3Y66 Jwdfazav9AOoDlwxseCG+dVoA4LNapbkVPgDCARy+v3TdeWAXzptp9oW37WauCWr5Ok0 BQwwXKZulkra+SaWdviwKheY5BbVzmgzkVK4ObwjZxf2F8c07/RoVBWTfBR0byGVtAci Go3HiA4qA1PJ4ocuQm84dpQX92extHuXycaxvIMYhZBAzqO/MGiEScA4vw8pz2xywrBg tx00yBf+gXSKfJjAZQKmQ5BtWxs+tHl06/N8RvwEogpChbx9SnKKf1z8dtvlwT1DgU72 EZOA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=pcGMD+J7; 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 t18-20020a170902e85200b0019e87f429d7si7896920plg.376.2023.03.19.02.28.05; Sun, 19 Mar 2023 02:28:20 -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=pcGMD+J7; 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 S229869AbjCSJ1i (ORCPT + 99 others); Sun, 19 Mar 2023 05:27:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229531AbjCSJ1e (ORCPT ); Sun, 19 Mar 2023 05:27:34 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2105.outbound.protection.outlook.com [40.107.117.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 153031A486 for ; Sun, 19 Mar 2023 02:27:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I9/jvvHWV+ZFhCYXu4hi987raatLtO14FMHjoxCUw4/8CuJXTjrRx0JBNCRLBXu99OpCr6Rg4BfOUFIdp/P/qnw8JPWsroD2MW04SacPSyk8DJ3hmxPhV3R0AqbDlT13ngpDo1BG1gBVh/hyf6JX0kp+W5QD0KWDKeo92l0NY8ad30Cdt9Ho5kEw6drIS6uzp0z6aqYlGaC+q3gX1ievW2UuQR8uU2nS4yJ2kM4nj2LTZIWmcknj6q83dRKnOnFQl0i+QeHFwdJHQGpqwbZUcuVi2wgdY5aORhuPWVZtoVBjonuYThCwJuE5Gz6RnI7fY6sbelLR7QMXUbcE9/OAGw== 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=hlI6qokwpgOkaE5Zh3c3JyOWZOSK5DXV2jjrjRhAFQI=; b=a2AILjJot1WFeOtchq8AxGOz5zvwuS4hhnbGNu09NrCn1ti/A75+IpbSy8jH5oLW+K02bBcaWy/5lBZnuwhJxfMnW3CIkGxmjmqqFvaUSXkWDjRw02i7W/RdoUOU9um7C47I7zAxg7B7/z/qMLoAakNjOrN8vrRr1aEHeGlFs0gXaSu6I4XqAnjvF5jFi5sdovaHoztb3jTUiUNeQUDJQ6QoqCl+xuMDlTYml6J8BCI/sUiTqDplzXOKhQtd99U9gPHdP2+hye9SQHKCtJiPGXVEjnPtdEWaOR8gJkHLZVTjY1nqrBBhWlpsgjivMrxMTmPbKvO3ThAeSwE8SOWSqg== 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=hlI6qokwpgOkaE5Zh3c3JyOWZOSK5DXV2jjrjRhAFQI=; b=pcGMD+J7+EnLqKvjpLCe9VBriPYDCxRrVU/AG7yoXrvX4yVvwYB0nGewTrLn9RoPTgYtsrVQ8hAxokEYHPh8dQ0RbbPqWuBw9X6oLeuIGoJ2aJ8Ms+zXgPRmyXXfry+BGs74qY0U3hG+abASwqpQ+Yh/XpS3ccZY0gjyLcgpklSuuBzLx81tGU+ikkaqSnTy0Fc/jC8IobTjul5YJvh6Y3wSP4IFcP8vFIJngpdVyCtoRqQ65Lsd/oVggi1uKe49kijTCNFklFVq2lbT0KIqsXiCNPBH+vHxcduLSd9Kw/z3t0Fq1t98czDBsmfBQvC1HbM71uPXYRBh/rC3L1kYzQ== 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 SI2PR06MB4012.apcprd06.prod.outlook.com (2603:1096:4:f9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Sun, 19 Mar 2023 09:27:08 +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; Sun, 19 Mar 2023 09:27:08 +0000 From: Yangtao Li To: Jaegeuk Kim , Chao Yu Cc: Yangtao Li , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH v2, RESEND 02/10] f2fs: convert to kobject_del_and_put() Date: Sun, 19 Mar 2023 17:26:33 +0800 Message-Id: <20230319092641.41917-2-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230319092641.41917-1-frank.li@vivo.com> References: <20230319092641.41917-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR01CA0137.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::17) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4012:EE_ X-MS-Office365-Filtering-Correlation-Id: f14da4cc-c289-41a1-5026-08db285c1c28 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uB9fRmvYsqRj9oaKK3NcnAORt6KWq3GZ3bgnT9Fg2/OtxS3UMEiJexXH98QqP7lum+Nndvr5w9txlZQze0wMWepTcSdKTwnxynUrjplNS7EZYW2t8BlaHta0B4XWipQS5HjSf9xNgfP23Wn6Y3YkOarhluZKxNiuJj/O5KuqP9707E3JVPEoIXXGoR2V/cknZbVxmlhAdJ4BktA3x7NKbkrijRMcE5w3tox6CJgd6X5rKu7dkT7vT0SGAST4uM6NHq6lX9ZtjLlaemVJ2O7SAdD3HRWkUei5yh8vUEj/s5LW7G3p/xmstHYH0jmSeqlTP5UbHskioksm44GdXbB2REq00ZlQwaf5boVEaInruGIVQNhrE2FCn/5QKCEhyc4meumf4Pg3CflDTlmK9/VkON40tnjbWzrGvDcKSvrxsq6CMlKzuPdErs7p84RyiXehovWED3xI3Euiu3PT+y7jpV+kXwAAC+YPmK65OtVcxNLLblU6SJpRBYYH5/mKJFeFeXnpJHZZYGna24DRQteN+5A/AG8gRe0rNPzUWPxp98/r9+fVUqng0bsCiidg6KkLScvXtmRq2Yn6m7JobSAQDFmgRHqPcKllSH3Q1GA4rqux8jOAHiBjCOxBDbFQFmxwEpoVB8++x0awq2d7YGt7daDxVX2sVGC+4V7JriWHDh0zXYFWGTgOGIyEZcaK/zR/szscc2x8os1x7K6IXPr3Mg== 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)(346002)(136003)(366004)(396003)(39850400004)(451199018)(52116002)(2616005)(478600001)(6486002)(83380400001)(6666004)(316002)(54906003)(8676002)(66476007)(66556008)(66946007)(186003)(26005)(6506007)(6512007)(110136005)(1076003)(4326008)(5660300002)(41300700001)(8936002)(38350700002)(38100700002)(2906002)(36756003)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: t208Qz5qXeGEwt0y/AFa5PBChgRl1NVKGgO6ncuetiwV8pcfYbGni0rBtAFD1ADC14lED1MkMa1uIhzz5RAVZ7TCAh2aEnKEd1c7ZpQqquWntUyJv8CpNg1LMkZ8fLRvHF19NBpeVG8EWzupdk+XISin0AXo5Kfv+ndiHNu3LlmPevzWEKRyqiQXlNXrHZ75XoAFXDrLIRoOfJZ0RfzfK9U+noOZrhZjDD627uDhOFqXMXNmNUDFaYmwYjf36hHuw6ZfFNE/l2O87EgB2OdDrNl5Dw8TkZj4XaPfGDC+z4boygQfAqwCBHVXDSnSodHwvfapa4rG+bbIPAzmqGmEUB7O32CgEZZcK5NC2/n4vpk845MpWkEZGoTl0iSJhPt2cdy+PFuUOP+Dh1Fua7rIlK2nFbe+lLZUJVdCQk4jTF2NTNnrq9M6ZHEfo4Uj2+BUABpLij+ZgGQtLJJtaLoj6y+0S3cK726M+C2PTcFQp9gZ9z9rIkMNtFt+nnc3sPVl1kE/zAVKacZANWsUGa5MIispBKfc2UJBBGYUSoM/BEbKZDUJxAK3NTvBzUE5f8FgZ9AcGy9IM1g6ngrLC7cqutAUqYwpi7URjb2+/zUmf+tSUTOC4kyR2ayBqRxNmg+IbNZjXqSduajzvT1S3Y0ST91CKlyEfQYVHbP4dva6NYZSPd6KOrV9fn/29PkFYmtye9DlWSrk6/8i7zEehdsmBGfc2M2MviyIEaroFpxElJRlv9SvD+Iwh7HepDP55ecf9nFngE/WTgJPqoaxvNFv+m5MGBrTV3ljoaaK8SNP6whDOnGGrRbw0eMjEn009hQk1+poKuJoaDmUG+IkAFhAy/76uLusaSbGyUnBYQI/7Tmoxd0hwv9Z0e1ZwPHxPkyftf8dnbvF4Ohl0NrNLiBPW0jy7Q8+sQhk3cOiFW55WYHvLkjItYSXZc8vUcPjvIpXlBzoCPgFhmt1gX0njeq7ZG8CZImTcZuTFSW+ia7HwGPrAxqhj+AdwJbsfpdQ9xnxApvAvqGhq9QcOjCt4OH74lcFAlFzoQK2tupnJaB0r6e2sKoDEQ6ACiaHr+MNfqEDOP8gTZh5NhtRKVbvBaB0at5imSyKvZzO0agkeWIbmSKLuU+ITfc4iMox7XKMzjF7ZGaR/pKuiuzzcxumOHO3bZK75Yedy+M1qYTaKxtKI15KSqaVd8s4jWSJidfHH86q2AZpQmvLDbbTFFmXOZQAwfFBA8nFOIpldokeSCYzZkfnK0uRjKHtW+4R8hnSchN/zXPu6+BpQdhZozAszdjFHH6AS7iGVdGNgOG4nuI0nJkH7PKlPi4MUQgb9kxv4ttPNMvjT4gAMiQjVuuuGWSBg5Jl2mWRHEMYIkCbpXgNG1Lc279x8EliBRmwYUOIddE2VQ8MLfsLl4LmLf+6aQ8QQwxP2ovAFeFW3CbBUwT5wHy952Oev2v6yAt+t79yIp722mCklXgxNHKUpwQHFSs1SJrp7g6/HcOcg6UpmyDyiXIykTahAYGOyM/mXUZvOLlf8eDkMCqYj6pdo5xtrLXg2SDf2UrqdIYFMmOSS1iovXU+LDEJb2grrdagRqPQ/Ud0 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: f14da4cc-c289-41a1-5026-08db285c1c28 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2023 09:27:07.9438 (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: seFoHrwQjfDxix9aLWz4bOWsPChtzbaLsGxan9tdYNFQtsKJdZzZdgurhEoXvijPgLxnOvBfgHh9Rl5x1im8vQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4012 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?1760787799120426806?= X-GMAIL-MSGID: =?utf-8?q?1760787799120426806?= Use kobject_del_and_put() to simplify code. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" 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 Sun Mar 19 09:26:34 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: 71742 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp654702wrt; Sun, 19 Mar 2023 02:45:54 -0700 (PDT) X-Google-Smtp-Source: AK7set86kXBpAnoCOHoTF7CsUnhSjPc9LoJaanivxGLOyrdF5u38X5gZG1b6ySFkxheos2MNbVXm X-Received: by 2002:a05:6a20:4a23:b0:d7:7a71:ad5 with SMTP id fr35-20020a056a204a2300b000d77a710ad5mr9525325pzb.7.1679219154106; Sun, 19 Mar 2023 02:45:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679219154; cv=pass; d=google.com; s=arc-20160816; b=iXwcyjDeTV5N2cNK2DBekjws8TQosY//fj7Rg/znRxsoUmnu3FxfkbzcXWfIjuLvqT 8mvOAhCWaWdMc/+Wr++00tCfIKRPDmbltWy59X32TFcg/rDr7qGnJ7pAKEctK1H/6jXu 0CnQSOyovbYloEh4gDxW6RudXmRyXj+6lADbXdHTZ3tfqVGpM//JT/DcdYBQhgnZsLJF IGdGsyXgxNteHgavQ8f4flihal9LwZ3ezjiEw9fJ+KS+jBt5c/dTDtR5fmEl8hIc7CLy gOSr2QevtFT8P+a1lW63kAhxk5qGgyefPKqpB9t4nH7Qpsc8rhBOvLlB6nAjV35iTcyR IF+g== 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=9dAsbB8HLSyPKnYY6MgLGkjsu4SEDUT5dyHTJRxvePE=; b=vXWZ+JAnASYHfUEf1S9PPT70mflDushXMoLXrWtVFJ03QplsoutjKm7vdrOaaa4H1Q fsqZyCU0jBkszQttHG3MMArDSdDQ8DJkoKbedgUdW1OzPC03G2tWMpTK06e7PNfuBk9m IBsdy5jZidV4zhq+75BALtn+DA3pcADi8V8AngljklDCCtkOui/N5gVnZMZWLeEOVNOX q3i54xTV2yMAlgdm9GzWzikXlMAY+kyWNIKvYl1RuR0Jh0rIAPysSxBwMgg4iWtezTWl CFajEqAEck/80MuKIVyTiEEnA1EPUXRPtWeYSxCRd9Y/XrT3eVm2rgSv06swDX/oVYOr j0Ng== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=ndoem+tg; 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 m36-20020a635824000000b0050beec91e30si7080949pgb.768.2023.03.19.02.45.38; Sun, 19 Mar 2023 02:45:54 -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=ndoem+tg; 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 S230000AbjCSJ1p (ORCPT + 99 others); Sun, 19 Mar 2023 05:27:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbjCSJ1g (ORCPT ); Sun, 19 Mar 2023 05:27:36 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2105.outbound.protection.outlook.com [40.107.117.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B63401A4B8 for ; Sun, 19 Mar 2023 02:27:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iqb29GcTJUCysI3rcc56fROhsQqwffcvKMdIDBe/zgKr8ZeyJtNaNq/H1ckyaIRF0pwuHI1JlJAYrxfxvu16/lCh+rX8o/iPweTtLld5eXquLsenWUZBfasxgSlnUPHxGtfPCU0WIT7W9+hMar1+r540HprcSisUQK2DK+02qQFNwnQjE4IXfM5Z3O/RVD9TrkS/HYeTlczzPcJawJSnigMa2HjK6KmnWKeSyZQwRm/P8wZMin/UN/L4aJPFUejU95BWvUUrrpYWzBuFwL+rmIo9wAZPdZjklscnUvVsvhQGAkpnBPXpgNIe+C8019ZlCS5PY1lgYKmK37U8s7wLzg== 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=9dAsbB8HLSyPKnYY6MgLGkjsu4SEDUT5dyHTJRxvePE=; b=cf8JflYD6uGzPLfwQyJW5FjKkdnd3GKy7/Vu7dABJ6ioBjeirFpOosYPnoh3EaM7EhT58eGsPjIRJpSsYomDo1yiHrSZZkjWS6tujndHNfQ9Htu1PgiYjWJ5pRpFKF8R+RiFwthBVcFD6oRnF70IjfsYKpIy/li/IkwDBJLvnLKaSr+9Uftpuge3GXV/qYxFMNI4NLIIf9FsxU0CKVM3lYU0vMNZJpt2ZfjYXa+kLIZwwgwNBxPZbcM4PLjT5V1XZ0cpz4f9uUf+i2XauxqKdKs8xAjEvLqUopNN6kiWRDnEEVoTs/zUj5e5f+oLJqNGHc7DBLs7G/4ReJifGZNRlQ== 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=9dAsbB8HLSyPKnYY6MgLGkjsu4SEDUT5dyHTJRxvePE=; b=ndoem+tg/oWKncsuhUBUc3B5gQwH4GXTS5vZKsFkwA3c1scUzkE8f1SSGGRbrRDv4lN4iBlQbgT6/j949spT4ALD7EmQn6o3VLUCMXAaCLQVoY8bAfSEykdarwRb4WX88o8WFlalhntbMGfPCmFh2ypdF+2j8b5B7qFhZdeVE8Wku/CJcR9cdxDrYA0IFN3IS3/F7n59fpPB3/+rtBB7OcK8A8W+nrICvP91ilYysxKsRGnQimUP1DRFnxaiX8OjvuRX7kZP3DeU5yDy3K3cs3T4bL6oz4Me9z+RCJlrhXwy7hQ2lnZ5247ip0k1O0pDVEHfvtPod9WW1OS2cAvlMg== 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 SI2PR06MB4012.apcprd06.prod.outlook.com (2603:1096:4:f9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Sun, 19 Mar 2023 09:27:12 +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; Sun, 19 Mar 2023 09:27:12 +0000 From: Yangtao Li To: Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu Cc: Yangtao Li , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v2, RESEND 03/10] erofs: convert to kobject_del_and_put() Date: Sun, 19 Mar 2023 17:26:34 +0800 Message-Id: <20230319092641.41917-3-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230319092641.41917-1-frank.li@vivo.com> References: <20230319092641.41917-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR01CA0137.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::17) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4012:EE_ X-MS-Office365-Filtering-Correlation-Id: b88627e4-a901-41de-49e6-08db285c1ec0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NEdw4AT/k2AEYFpvs5hWUA1/YseXLkRHC23/iahN1X3hdFxVyXlSKzxEP9gW/dsLGRwJwRSP1YPbiV7JDVroTBOgaKQG6qbclRUcUEIBSITBEYH86/pMm17P1r9FwgwBMnGHvd+n9eQ0QsRwhkrZ5sa7BDqphpWCaVqbirApjPov/JQtM0gGOyp0CaRUjiFztkBNaT5IERFprttZ+iYdGSSiDlt7Z5i3Afj+DmsGmeufmrWADiDVrUMNSxeZiLW8dfWJ42E9pzBzZPA+Y9JFUBk2aZkIqAOhmtfhgTUwBcHYnEhox/c6cj6wb9lc787G9x1I0l2YXBfvJkKaPDR3Gc+YrORnt9XWyBkquTikd5r3twfDX9wa2ceBoYKbriJN3Q0KYvwy3Eg2N6bZaaRp+OqgcOMD7KQoHlsa6JMS7Ad1JxnE6O0UCtzLKxtiSs6NReSAe0DlbrZ7IynMgGeMJIt0MMwUuiV85kW7R2Z/z8vHWV02Th73LbQ2u/Pb86F+COEJnYSQCGue89e+jCPk45K6cMuVR/dA9N5w+xcjo+wBKlzL1P1pdi3gQasCMqY4d/WwRCWDq4rtIF/8fCUSibwAYsXeQr9uyDbpxqwr0wpdJU/z/xi2AGECJDnD4V/bZF/crxAaDfgYnehqDVajuqMK0SEvMlb0fddlc6fpPgFPm+R/BuOWHdM9rOpnVLJ9+FjAS0ownm52mdKKS3XjSA== 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)(346002)(136003)(366004)(396003)(39850400004)(451199018)(52116002)(2616005)(478600001)(6486002)(83380400001)(6666004)(316002)(54906003)(8676002)(66476007)(66556008)(66946007)(186003)(26005)(6506007)(6512007)(110136005)(1076003)(4326008)(5660300002)(41300700001)(4744005)(8936002)(38350700002)(38100700002)(2906002)(36756003)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: amW+U2SyqghkRmvcE1MTAi7HQX5Ao4c05kkoAcZJOP/nq/jr5edwEFt/sIAyuWCkwoSe6yn63gb3VXVumCZ4pvD0EAFk//yrSJn1D5hNqyQLn+fYEo1hLW0asgTPVDWKw+Jbo6CXk5bcDRrhYcs1gymth7ZtaCkMWSLpZ8cVPkT0W/l/G5GgWbJ6DKB3wr9iSF7VW8vzOAldPnZyiTCc9/TsUCX1znMWtOvuu+aQ4sHPgA7LgCLcCQFMcmXOOPmmf74XiT3saKE5mDK0dlnMXALHJbIBPvFvD5iajueRKIRkURoRV+OZk8ZidUBkrMM7L+pxyAYhPZRluqk9C3eSvl3ecevLxBAxqquLzhtMBUGKkcaSOw4L/fQ1v8wjuSg3+K80DMigeRIv33ztDjxK/g268gd5x8PEmFdhRP/3F7Y4levILou9UPQQ6gy0lPrrETD6/pbUgPCY4m/nfZ7T+SMuo1S+IUm9YdQBFq4aiYOZ8kBn6vbbjf2NcLe34uK2+tSE6gaueDz6KugqoqT1HrZYTNCDYzkUO1fPUHkOHyzPfGkq+zEwgNJyP78r8CYudQ0qcL0FPcL/ngqgVFQr9DFnoTrWag3ZHhIejp34kOqyqnScjgc3SYRWsu14lBhdetYy306DyrMlGeLLi1dfa8erXL5r54y5MMkNW37i8vO0ixev7AT6B17tXXBVw7sLp4BWItBg8GGbdHpxbucukj8fresPtV8CjbJ/S21y5MQIaUP0SOK8Aurlmrw/cSRQADeQgLA3+SkpQqufH2CPuafRj4zkFOEoIXwb/aCiyqnfoVphcxnUr52JEL1D3DYrhu6DIiE3bJVvoe0ZCoLwSgVDSiijxQkCJ/VT9ZNrDl3jWc9ox8cI2yek7qKuJARbiBAa8WG2FRTwy8COyvm4O9fd58L894g33qkma19kmBwfuoI+HwhmjH3c3+G/cXool3fSjBmEWEEwdldM5BGO6d/iRQl1CnVA6ShQETF4EsACmcxxQkpnn78stCbGID4K8J6ZBDAS4bKa8RCI+eyOIo/Gf1KTLtYNbWBTzVGpcAmtz9peyvKUj7E1BCVzE+2xlS7LVRi6alpoltD/NJ98mqBeOGKItVDh3eNPEtNnRNL77V5sng/NAtKuBr8GjKSHBj8chV1Sjaa5bX8kRrc5O+gKZ+UFmxtHjI+oGt5/uC4xaObXsDymegD1rtgXpuwpIBaSVNfjlhxDH4wFlYIlFXg/dRxvaxbpIl568ao1fHSsSWso+RA2NfmyCpuKqmR97yN8yAAtjjem8EauN4vqrMab+ZTNb7AwdhQ+mpMON8HYG5pG+5U75CMNChFE80yEx05p5SbOu/z/6halwGmu9vur5vKhTBaOBTexYCMJB4J2J5OCnc7txWuSUJ5FhKH79pLM10/29vgekSzVMY7PaJKiwrNRJe6SkBUJzLjWYTkUOH8Wj8puiUOupCgYedDkG+AUzP420Y9dTu4pHLLS2U6Df/paPsaOKPr2n0hc1cFoadqdQkZp+BYALO9jaGFyxgH/Wb7C0cedzfMfDdbyObc5VGmG5dM5rSeeoJCGwX9jUCbPLlRpbw3r+xxITk61 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: b88627e4-a901-41de-49e6-08db285c1ec0 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2023 09:27:12.2639 (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: YY4SLmt5Nn1EF6M2J2KmGbdU2eL8QGPabrAGWupoO+ITX7pempAPu+bAN81NB/wD5Ht3mUELYv1rDCPka/87lg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4012 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?1760788903866833824?= X-GMAIL-MSGID: =?utf-8?q?1760788903866833824?= Use kobject_del_and_put() to simplify code. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" 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 Sun Mar 19 09:26:35 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: 71743 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp654727wrt; Sun, 19 Mar 2023 02:46:03 -0700 (PDT) X-Google-Smtp-Source: AK7set/W/v0m27sgWlyszbcxKEdoru6ZJEJcCKgtdWjbknNsyQomRfWozgdu0TOqHkYVrouSn9+X X-Received: by 2002:a17:902:c94f:b0:19c:f80c:df90 with SMTP id i15-20020a170902c94f00b0019cf80cdf90mr16052317pla.45.1679219163043; Sun, 19 Mar 2023 02:46:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679219163; cv=pass; d=google.com; s=arc-20160816; b=uDqnhJvsdXvGZRjHnScGjwow9V8YWlEphXKA4ksyz4QssMVuXrEmtak8GJ66Zp+H3w 9KOI1/wIaZd2UEuSXw7ubh1Xu3tDeHw1/RWL2WPinu/RbeWQlLZ5Q13s32du63pRBiYb K4bL5mkDFn2SeQPdjH/wi6+8qK8EZ0hGWx/06UzXuqASNcBJD93tfBkqqRV2ru7g47YT A9YXj+BIE7IoYQADy3MskjPAQojc4OxgVHAKa0hOCII5MdMSRJjDJlA8AiXpWEbztc2a 7/k6/pWOQMu5DeHHlQZ6zuFnjB/1OGCiIj1ofGzEsz2xY0ZesHTMlskT+sPVMplgF5wB kJ5Q== 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=YJUPw73zxfQpSGOnXiazsT/DPiflp8oO5ktoRrHDsKQ=; b=Kah9VwrdW32jsj0mZg7ylsGZ+SH7oUxzRK7jNQpTOJWAasE+rEClJ+J2ZJ6CbsKbgM oRqBTcT0l7XdjOnTUcPoOSA9DD99lLjVnS3TD64kZINsLLGC84+6mHw02IZuiQnhc++s c1/m0gAS2WHSR/cH9+mBPub3W2AnPgGSyqchoIEDVuUC2d1fK6slcYcFCujoZk2iF9eM ymx051U+szYN5964s2AJDwKUj2NUJBvk78TxbdJuyRFED25MtyVlJiGC7byXhpGIgJqa lWAqf/Gaoz68UPPasgAA+oGpf+rOJDX6b+R5NR19lVgWM2zk9Y7+q8j2/efqkFdSJ8Rg 5yvA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=jRVWHduV; 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-20020a170902c40e00b001a1c1093714si2737272plk.420.2023.03.19.02.45.48; Sun, 19 Mar 2023 02:46:03 -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=jRVWHduV; 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 S230041AbjCSJ1r (ORCPT + 99 others); Sun, 19 Mar 2023 05:27:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229713AbjCSJ1g (ORCPT ); Sun, 19 Mar 2023 05:27:36 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2123.outbound.protection.outlook.com [40.107.117.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C298E1A64F; Sun, 19 Mar 2023 02:27:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gSzAVY5DoVd9KrEbuxF1SE8YSagEZ4o47V2bNM5KoNDGUJD1OD6VmFbESijAcjIYwJG48yeHeV+p4wUIEmnpO2ZCLViV8gBo3AXjHqZ4o6uQAj/JdTARLpJhF89lI0StvVXS7ir/aYanDihjvJK2xuq5oIFZ75LNSc+YxN78QIgBiEZZqEBmTcDvlPS6XPdBoqqCxVU1ux8Vsf/ux5PRkuGrfq4r7pvXsQnpCuA4dv4GTckly5wVGVQo4jGxxCrG27kpmtURJnpu6Y7k+QJkGOYEg5RLiMe6ILL55vLqCPbreWnFD3rwXLEW/iQwN+E51L++W4vWBl1ECgRsRXXpGA== 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=YJUPw73zxfQpSGOnXiazsT/DPiflp8oO5ktoRrHDsKQ=; b=O6ywMYjq1NBVB1KgrtKcHd1vTz380m2LU3/V2wNv5/gFqImtps+bxxXfYinXqKvTifWk4QzOO10yrnTPIwt8jcACQ5SuKEnglh4h/R5D3bDZao+yWXxEG1rk1+VQ8gULb14FYugmSffyuiQ5wH8FwwGAr1LBF7LKueQwazx550skXPdbi0KwRgW2JljHZaq/83i3G/99FcyhNnk5afm12XrJvvjBmRIJTf469m6upGi63k9alte7s1DatvnAnoNTT3D4FTjcbjJveBz9pVhlZ+tm2xOvk5WJDlkXx8qZNXUuNxUARY0F4sHkIB1iyE7IwDwaVj76IEjIuILTr8yEvQ== 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=YJUPw73zxfQpSGOnXiazsT/DPiflp8oO5ktoRrHDsKQ=; b=jRVWHduVh+MT63g9jeWLtuzPcVHPn1vn+vza38wzHt53u2myJ7tCc9/zChlYriHdYOyiBvA5U8EqVbw6KLkAB6mTh6wsOX/nEBZWP8sGBRfJZSVH6MzAAruzxnC9JniBH0yo7evFCbHSFeTuhli/vzJtpek8xrkeTA3m1TkpuMRod5cqShrpLhaqAo8c1EqmKSzDkWnSHtMjkUvnoKuJok0g04McMfOWam9Ix1Wi9JXz1TvOzLFPS3f8ihOxpq9wyBcsr2Vb4R65tVbAaXLsF7g2+CYguvmVMlBkAuVO7KdHT39/N89F/qIgPU5027ihiqKsdxkw/ypNM5hMfSoKdA== 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 SI2PR06MB4012.apcprd06.prod.outlook.com (2603:1096:4:f9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Sun, 19 Mar 2023 09:27: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; Sun, 19 Mar 2023 09:27:14 +0000 From: Yangtao Li To: Damien Le Moal , Naohiro Aota , Johannes Thumshirn Cc: Yangtao Li , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2, RESEND 04/10] zonefs: convert to kobject_del_and_put() Date: Sun, 19 Mar 2023 17:26:35 +0800 Message-Id: <20230319092641.41917-4-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230319092641.41917-1-frank.li@vivo.com> References: <20230319092641.41917-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR01CA0137.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::17) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4012:EE_ X-MS-Office365-Filtering-Correlation-Id: 9134e7b3-b2ec-407c-0b95-08db285c2032 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: f/KY+Vc4dcJ4/kjdgjCnbb8yXsvg7VkzR3VP/DI8Cg/CczEUTBG98ZL4p/oEzk9y05h6COL4Pl2qYGe0HC6rwko7R/LZH32B8owaZ1NcKpEmk4HWsQEhzd22yOoc4d8oc7Bp182Ybw/tbUoDdOQPU0DnJA1VQwTFIi0byDyyoHZ7836inhlWw2W93lXY6Ra8EQynlT88CgYmdlF8OtSNwpx+THlD3WT6GSJdEtRfeSSXFxK3ECgNFDPguEvZLMh9q6i8ffGjy84xiGLfUlhFO6RdynZqxHyz9xsJOqPVMjr0ZsvSN9RHfp9c8XLT3KauB8TpdOAXeTQDEipy9orlNQhoLHPxROKpCwiXKlzhtWpbUGR38y9zgTrkmDuOWzd6c6/sUAfaPBm1Wu/7JqiJRhuR4wVq9toPiRbVKBq0lowI7S6gFo28SPGovm+tRTtyn3f7zhy0DdB9yANTp1ndrA32ppRhN58Kuyxpkdq6HFUIfp8DW3kueGjqJkHXeEGHYK7OMZpBHAkF65+xzefo2HXPXCk81NR6FwkmUJAwlqj3ArOLrFxh8xgUKRS20LQZJd4vNtiDFfyQpQJ6Ot8TVaqQ4KwxVroFoUIzNmgz/up6FqI+Vjhv0v6eMZpnPi+QSrvdOFSIhryYxVSGLYCpMG0mO31FhGouUQw2HRt/fx/9Z+SGyFbyggWKNstwZDIvrtwjKZ8c4ZQqxpu4IAFRbA== 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)(346002)(136003)(366004)(396003)(39850400004)(451199018)(52116002)(2616005)(478600001)(6486002)(83380400001)(6666004)(316002)(54906003)(8676002)(66476007)(66556008)(66946007)(186003)(26005)(6506007)(6512007)(110136005)(1076003)(4326008)(5660300002)(41300700001)(4744005)(8936002)(38350700002)(38100700002)(2906002)(36756003)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vZhD2LjgrMUf2eAJE1YEU3tO4Ar855XHcM2rc7PLZbV49KewkbOVrwFoBKWJrkOQR4zSg3Y5w9YbIQ6B77w5w3QmR7b6aNwEkC6yYWZq0R/X/ptwNK9z7p9hREnuixTiwMmyTgN2u9oNyjPbsBX/VuE8kwk8ZCUqS7L+pMBToZx7cQxls4jDJDofrvooO6pDH4V8R08nkGphxogs6bVgfWZbjnm53vy3Z/IGUCzxgOPi7k19WAoisBYxKCunDOQ/9TZDlVj+QnRtbjTJkxmFr896h4W/Iw0DEYx9jl81kMLJUFyrp8jIIoIukpZ9qLbim6fCFnHmP8vUkxQ5L8pE3FkMFjltnGnpAUz1WUKHgmwHDSFzB5TKao7GCXmjDfRdcO8wc52vKX92FFlpw0wkgqOuKLZBgaq+r3mSXiZ7owXhO5LZIAHg2nisl/mBtB9SyN08/a3QaGlKM2mb/4sQKt6C3w/TtviPpVtuDuz2tJ7C6qO/ug/it5i+cbf6WdSBK9G+umiSM1xX2aqU2TZ0eSXZPogLu6eLFBs9FR2CZOnF7NP/a0sw+7yiU2cTnWR3c4u2LWGODU4uDsxUdmCGb77ZM8Mt4jHuqEfyj1gThZWVDjsTY8/rPnGkyJbLEeKEbif7dUwbvo7bg46LpRHvZJWHP5sC/0jkG5tJNEYl2FMoKWhuQ5fT75/NQi9/xhIFlaPNvwqJQwJjsCVckOO7Hqjukw+A34FGtvEBDFROx/1bOZr6L2bQk7TIs8J7R0TjouZmeI1Osg44li9uzQi8o4SMSb74MR2tiE7SzkuP9gXxXPEPsfffPK4/sPAso5NfIikpAyAlcDjSCeDCbVdVRANrFUZyrFlM309ds9Fcs4svf+rQlrB0FgI41jlGSd4Ocif/uEcSD1dqmuRmseRz2E0cG6TJ+33w+UGFQrR+1GWfrYN4jcJU+Yw3Xi0mkUbJByPWcubu8JFPpDWQwm5ub7NFYFTnnP+hWf7PxNP1+Oqzmg3VYA7WhiDfsv3vrxpD3qYVATBsK1hAJgWigehF4hxGrCUouAIn6YRK0Ft6Ovm7ka7jsKroBRvB/EGqG8X3vsZDG0rezkaAV95/xDf9SaInA6Qx9lndu7XSPDmLzWHesRy4AAFqydrrVUt4fWTsQZpv22gZaHdEowIUumns3yxi49ZdBcq01rbgQ3DHmVPSOhEIUS0u8taB+Lx/PYF3GnijO8nWZ2t4hKwfAaY/4Mz2M2SKLLKdZQ7HgtOi6yOb+EA7OK6PUligQBz0yg6/dNYN4O1mWrQ8QgAN49b312BhwEJZLWlA7mZx2BFTxyEBho0Z0zyomOIpuDmSF/XzmrgIYts0PR8TQFk+V0cXiblJeAPZ7ImwnMuTWr6Cyfi5kRBxuxH1drwIYZJU4KxqU6w3/8tTMtrkeQOe7ETF4Od8s+19FO8jKCCsdnmrvzkcq/PArfK4TDyVQBep4z0WQSpAoZyAag7zO5HET3FFqZdnqsOpeeNNAerGWEjoThwz2kh0G7lYeVXPNMhPOkeqvo1DU0DBgGVw59edmEZHfLe4T8QYdMkAKTKCM9BvDuo9w/fgQoFz4leWEuW/H/+E X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9134e7b3-b2ec-407c-0b95-08db285c2032 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2023 09:27:14.7028 (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: hkSQVESBuFZkHEWAQycIVUzUPxDkt7mkVyGceRTp6sRqaoduoLfiAfPKXrKwnZvgRtrQ487jdwJs3fkf7ZF4Dg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4012 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?1760788913081675005?= X-GMAIL-MSGID: =?utf-8?q?1760788913081675005?= Use kobject_del_and_put() to simplify code. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" 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 Sun Mar 19 09:26:36 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: 71735 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp650834wrt; Sun, 19 Mar 2023 02:28:55 -0700 (PDT) X-Google-Smtp-Source: AK7set9UMTYeTkOwwqMmc12xBMevvt2ATjE+BLTJr9TG4TmZ6CMqJfU/p+dlQpSAcW3O7C5PQSIz X-Received: by 2002:a17:90b:164f:b0:23f:1210:cea4 with SMTP id il15-20020a17090b164f00b0023f1210cea4mr14548957pjb.18.1679218134903; Sun, 19 Mar 2023 02:28:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679218134; cv=pass; d=google.com; s=arc-20160816; b=gO22GDUcwFXmCWJmVvPs+ld106FF7giwtTzZWlYrSeGHyybdyNiiB8M/HH3rzOkxJo b7greBO+sGbUeMiyaR/yLXpsSv3VovwsSiENtN6T/uMFyR7p0W1Elm1YU0ZtyZXHkbn2 KI0m+LWO5wMFbJsWGxg3X2F6Pc3GFZ9HNELxtZEyprheiMXDROYe1ByAgIYBeE2OplMj M0OQzuQJLr1FrVUJx0kz3zsfrHcV3IVsJVplYI+NgPSACbN5lG8e7XSoszgl6hwa2fEd xSwBdyS9ubAYYS8ZAQxNsklkfBw69QStLJX1lx8HCRGUF6ggmlm68oyPXk9MxriTmeeX LptA== 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=g+WVe+eW2z/9yfg/TRa2E/M143S7vAL7nIgcL6N9o8M=; b=pyO4mep1jpdMYRdndVvD6I+v4Hp7J3RdI7tO2SQs0oSy8QEFZTWHpo4+XyXH61PLsR RaOwMo9m7njb0G+5XuEseovJ1FG2iGMPyhLrNe3IUydclnCEdR41UHASjWzhnl4GHNsA KIiAysqV0cVhxnFaVJyq0wvz0UG6nGbjSc29wkizbcSSub6Dxl1nQ9luhBNrlfjGrQAU h14kPhyjjqSSNIQ3ZVkko9Tz/ag7GHkY+iQ4cMQlrjPEqeF8L6IPs5y+FzIoBHeUTyCQ 62cEOaK8BQMjS3as4W4qtSRZZWbL87iD4Ymsdz5cnNJG7i7riCcp1TpBC2N5eo9sHrd1 IRrg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=oJAdBLlS; 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 t75-20020a63784e000000b00502d7941026si6991991pgc.442.2023.03.19.02.28.40; Sun, 19 Mar 2023 02:28:54 -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=oJAdBLlS; 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 S230085AbjCSJ1v (ORCPT + 99 others); Sun, 19 Mar 2023 05:27:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbjCSJ1i (ORCPT ); Sun, 19 Mar 2023 05:27:38 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2123.outbound.protection.outlook.com [40.107.117.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCA6919F37 for ; Sun, 19 Mar 2023 02:27:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mgmiyNNm7fsAw5PKiLynNsH8FsVBnzoqwzQROdSn/c2/39xVoDHP/lD1/c11vcx7pQoBaU+BGkyQNho7U7FWa76dB1En88o9CyzfsiwuI2n7NkknQ/H6SAc8jseii9XTaA99iPHWQT7xdTIXDZvVibgjGfuDzselGhM2FU6vS+YDClFGt5Iv/B99qaoiPya6dnIRG3Y13cboNnbhc7qoYEkwPsFqf/c1EaW6cu5AWWmoZIDhiQEi3naJJloB3+PXjq7winaFd6imWe0teYGi/PGeBdkg4N/pwcA87nAtAl3SlgYhAFokaGXxchGGoielHz53LaYyoDmbAUGmRGbJig== 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=g+WVe+eW2z/9yfg/TRa2E/M143S7vAL7nIgcL6N9o8M=; b=HMJC5o1gqZzPqhC6zW3CYFIaeYIPuSAK6gqRmQqEI3Ubt6e8wGxAkSoHzhcmX4LCkNBsMM1aAOco01Z60cdtF0/4ofVi0JfrN3ez6E0tR88VCPKkqq8A1OrfM1lxS+ZPQJ0L38b+mAU71RjayBVik9WSeUOdKf4oa3FxaIXDuKa1JTsR9D6pQ+Z67qOHl6mF7BXz2OMafUAe1AOIlvBal3fsbaWaT+6dFkYpelrNfs59C7/F/8+GE65+Rnn/QTpbvQ2TN/sp4Ki9R/TD15u3PffA8Rlrj8LSamd04rjaYbILuSnS/WTA/BEjdU0HGS8QXF85M0inzS04yIBUvwRH+w== 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=g+WVe+eW2z/9yfg/TRa2E/M143S7vAL7nIgcL6N9o8M=; b=oJAdBLlS3aJyNK1qi9YIj4jBKNQIgTpOIc+A02nPRV6oFs7nbhzz/Dc7L25coX2Yeg0vt+CPqsQIP0nSOocFdfk7D11UkawxGQLLro7aG907Zv+A6MrrapVXmFZS6hR2a7owpJS3+h5CbkKHal2h++jjSjZlHpx2evXHKkB8adA6jnFmt+Y8pR3BVZ44/0q3XBxyME8mMWyLcKAu14MpAH7O9J/nTTaHi1Nq/WBYkjJoE2Obwbnn8I16ZNVN+RioAxQYyVSw7UpjXs/jN/jZRkVaCJ+pjZBtuPDmnIhkC2ifqGYIXuAxuMpGwkqFCkQYnE3VDAvWwiCcNpj2HfmFGQ== 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 SI2PR06MB4012.apcprd06.prod.outlook.com (2603:1096:4:f9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Sun, 19 Mar 2023 09:27:17 +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; Sun, 19 Mar 2023 09:27:16 +0000 From: Yangtao Li To: Richard Weinberger Cc: Yangtao Li , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2, RESEND 05/10] ubifs: convert to kobject_del_and_put() Date: Sun, 19 Mar 2023 17:26:36 +0800 Message-Id: <20230319092641.41917-5-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230319092641.41917-1-frank.li@vivo.com> References: <20230319092641.41917-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR01CA0137.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::17) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4012:EE_ X-MS-Office365-Filtering-Correlation-Id: f9432d6c-79d8-4513-333b-08db285c217b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KT4kwKOho5154ydxVdXa6k13Xh+4YvFX9/sASIwidM8JjT8CYYxglV79DCk3b2cgO1mwORGhB342ZIeG9AS+znZYfOBxwWiz6tuP4q5gVeHMQKF/3hYbyQXW9ZSWAgfpdDcKwUirfM3jF+34BAO9UOOdOJ7jMUsixHBa/QobAx4adBoWp7xSA+SNWXzZ1OYNJAZwEVhj3JHe3jGASybwHpcZTkTNIIcgQGfiLxdtpJ1jKbeps3FlDzIEJxLZWZJqjvhTy+uN1hADIudBjci/Ey4dVHId/ztfZwjF06bpKa6nxPOzrTU3L1NhiO/qvZecVgFC0vKmOW3AIs3c5rvhVOmO83pUBWtLAtwqg0VcQcxOn5x3W8PfjNtvNxqT9CjPYdIh3cDiEFlxUQWcdp0tYep1LpGknfHJdppIxKWFtfWwWj/73nqhkLSvISSa8Nx22RHr9Ou7+PWRjRVN7VBVKrjiAbryfWq0tLARrbcUYMUJ6DuKiESIb3mqjAScUy4s+Py9UDKGKHCSbT2RxSazsPgrmEXn9tVFBYzqi5x1n53KXN3C7YJ69iB2HyJ6RInL9OoPYMLYIjtkYA+mnvvVR9kqvVntrwhbcU0dwBlNrg7+KrjlEc5zLMnyhSGlKVzkHA/BCgnLz/1x9tl6PYtc7knR2fU3KyWiBIFxh0YiUWotzHCR9VWoGCFDfRagSOr5GjknssWZh/0ruMglPFo6ag== 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)(346002)(136003)(366004)(396003)(39850400004)(451199018)(52116002)(2616005)(478600001)(6486002)(83380400001)(6666004)(316002)(54906003)(8676002)(66476007)(66556008)(66946007)(186003)(26005)(6506007)(6512007)(1076003)(4326008)(6916009)(5660300002)(41300700001)(4744005)(8936002)(38350700002)(38100700002)(2906002)(36756003)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JQtibGmkmXbQCspkRsW9cV0Q96IytN1Thit9mI0LcBzRPfIYpAZ/r+Wiv1cE1pRfUR2ECU/2rN9qcbLR6vs3i+Z2QHM2HhXBnVpJKuEZpJANiTaOsj1lXB7sLRF54u51NFjdb0gUcw8DDGEsbqgXKnjg38zePp/nzE1VfPxm+kwpT2bw1uQJaJxBBCn0WIU8EHDnpoDdsIxnZliIvRdqVAiNL2j0Xk81oieZI7pOcS/WyGbJBOdsRcHgCdbnrCMz8A2dGteVqkHiNlOLGq1dac5JzLMAHTBBl+M9oZaSVdJiz/HKLphLIY9ZBbfKqhszmEHmUhaS2gDhH1uhNFdVHDFoumyfHWnpprVSLD0+fTi4X6ChyTI06E8iih0GC5PxBt+tuvhsD6qVJ3HBiPNOi4FEYy79boSfGUc/fLhkpaDyvBHpxv2WH8cx9VzvCCJkVAb8mlBaId8qE9QiAv/QC9VXp0LcQwIbMbvL9QetgRaw1OMdTiPZcHCkbSawT+Rsiaeis37Fe9T2QpF+cyeLACDnU72d2zZpDWsNb9PEo4ukZaqTAFb+rcfluXPiP/wnpIL6NW9Wh9hjvtJlrHtUJQF+ZItM3bm2/MjCGyIfb4Sbi23G8Up0leK6a05DDb157fQR4WSQDtURNJFGfVnwgoihDT+mxXxh47rHsx/Nx7dC7fjAOA5D58FtU8jI75BcDbPfW3rNGNlJtBcel3s9mFRsGMTAwRrZr440pQOO0G8gQTpli0miwRgHJJvG4lH+Kx6qnpNMMoV9Q3vE7n9dGoIAqm5lmIjjGPQVuwhvCUVcps6pHy+umh/7fum82/AKqx3Ra5WAy40Iiv1qyBJSqKl3uEYbWl/0Cof3ssWGnISOLUICouHNGTdhIN63AXd3nU0K3qITRNRrBj214/y/dVZQdhPQmC5JRkHxIZ1Or55thC18vecQ2H2UnTCjKRNsaUxCsUl5P5jAA8FVRCUifjoIHvVi+i7tUie1VffGj+p9HXTQDGj1Tg0ziBuWz+p13BK4ThwdXkuexnrq7/b5rXbCejjyYx0EWo6q0rck7AEFpLA/t5nnU6XpcnJN9aUtUJSW+b9YIDOUkfEOyaSAUFLTMKD8Oa7lGRBKeG1+c+4mZyfkGXUrllJ0b09eNMzqyod+DJAGmY4i9XnG6rDiMyL8YFY6Gr8zg+1glAeSRNUNRN39MttTnVXo8F+LSLmToezKlsBaHYSyf/1Yu4paAHU4x2IYgQDvk818RFmBstYhrRc8DzW8noWRPsJiYG0WzfOvuO9DkUM8raA2BozO+tt16MeCvAbBrZz579lJDlMVVeu5MLOwdCng2NXQc+AiHVBrtfkwtT2lh/TakwTTuQ/J/fuV7q2L0Q386ScaA4rD4cYUwC1HhtkbKr5txho7yxIf3jZELTVhm7GZWta2IAo3zHkJArl5JqYlrl0MBKfy9KrN/np0+1DZILRlNH2MdZPUS4nhFF3/0Lh5KQLgQ5BUrCzhzxVBJ1MLhJJWsVUyoDrQ5dqbsZmhPC8kV/Zpo5XhCvZ1/+GngPXYHXQFQeOTcS8j/5XjEcwGntLvF1HIDjG7gguAfOGd2ENGgtzQ X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: f9432d6c-79d8-4513-333b-08db285c217b X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2023 09:27:16.8600 (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: uE/RNphEW4t6fm5DlEAThO5s5R+nZ/ssWiLQrrXYn+yvcqdjDMIrE1A+6ZxUEpxnVtG4K2DgRygXH7Fh1rw/ug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4012 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?1760787834991837863?= X-GMAIL-MSGID: =?utf-8?q?1760787834991837863?= Use kobject_del_and_put() to simplify code. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" 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 Sun Mar 19 09:26:37 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: 71736 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp650907wrt; Sun, 19 Mar 2023 02:29:16 -0700 (PDT) X-Google-Smtp-Source: AK7set/WrunYk+pIEdAOUBDBEEpC7K17ENSPUpdTF2PTb4kqZshuieE2uhrstY2ZBAhMSFe032iJ X-Received: by 2002:a62:198e:0:b0:5e2:434d:116b with SMTP id 136-20020a62198e000000b005e2434d116bmr10476276pfz.23.1679218156283; Sun, 19 Mar 2023 02:29:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679218156; cv=pass; d=google.com; s=arc-20160816; b=vLDLyOSVR40rzq4dI+pzGZLIME1iwFWL8qyxr/WGin3Nhyfbl+xxyXhpd7fqUTxXry FK+HTEUOps5iAH/ABAohSkQQeZ7Tuu/3be/9OiW2tPhhkfhR1yXF2xKLfDMywDBr/zkQ odgpbXWIRQnJVHVLamaMZ8jnozILSYiUvu4Kq2HB3ZdeHBJOFyPajWNYfwP4Jwqr6aWQ 65RM+Nfa6vyztnmf/I8kB4WXC3OF4+DOa44WHjMjWclxocQJVyG2IXzBBpn98WavN/AG Mj+DuZNk0qKI596k8KbNSa9lPN+JpUpIAJI7ttTJzeGch7kZ8MpXLJs3U9fFGt0SJ+Hj wlUQ== 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=3nOnmDtRPbiMQMNfSWmIFt/QJNRbD0naJYTvPN+8Lcw=; b=UgS83v5GWkqbbvUXPCKl1GeDtcnRnT4QIxddtwOJ36qg9mbz4WHQfETvk3zfU/7HRS F1Q1PUrcoHL9Qucx4JKsmzwZBcM60hRCGBqY6hQi8b66eV1c1MYxV4WcoXrgsIoKatXY dFkfEkIjTjHjo94GqPyHvQ8Vj8lDcBxjzvdQx5xCIc1s0uodnEBkbvo2Ddfj3Y8nWi6w 3N+3UUb7swhRiQXsuTojmdjQTxWBXXhPhsOoY1HZ47s4N2hN21PyEJyISEDA/xjNKQAK D3yP4850O2j+Ev2FWomGU+fEhmkdQGaivJsanIr8jnbwIdiu2CV7aO24pHYpRFHi9bKV eZaQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=Ci+0PerY; 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 z11-20020a63e54b000000b00508aefbec7asi1980628pgj.300.2023.03.19.02.29.02; Sun, 19 Mar 2023 02:29:16 -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=Ci+0PerY; 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 S230094AbjCSJ15 (ORCPT + 99 others); Sun, 19 Mar 2023 05:27:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229828AbjCSJ1i (ORCPT ); Sun, 19 Mar 2023 05:27:38 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2105.outbound.protection.outlook.com [40.107.117.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDCE71A486; Sun, 19 Mar 2023 02:27:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DFU6/YDk8f64KR5bRNEgQLBNzB0Be6KzFy0pPMfVuKHuYG7Yr4PQI4XNbZmt9HKxacqDISh5cenUYxKdvd48gaB/h/wgNMcUe/RG595R0aSJG6/xDkI769x54PMOBIhHeR5SdR3ffc2fmiKPmaCRNpzPeWu7rHZfyVAH/u/351iJeJKjGF6li/Jnxo7kCWhDatiIUdhcUMdkVJR5FxmKC1Xd2LgOGG6N5IxF+NO6Us0o1i+7IiEBXXo84Lxc0rHHZr9O5oXjhnTwG0Lv1O+85RPws6pU1fdhGkCu6EAyqSL/Inj6o0XGq7nM2PczQ4X3886W8kYCW64IIEHwLMG/Dw== 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=3nOnmDtRPbiMQMNfSWmIFt/QJNRbD0naJYTvPN+8Lcw=; b=c3NM4u3iRoSKvROI94Qivjn+VJ++KljXybIGsqxo65qLXTv58kHJ6N+Q8EsraaBlWUr+4nfmatFL8k7hP+5FwM3cO5I3CMvzC8B7NIIL0hmOZluADbc3jJpsmfVlqyy0k2WtTi28D9AGBr/6PNVn0aPEViWlriiLTzikBviOOV6ugpj1fcuHQOv0yrZGPSyhHP7I7mYfbvKRF/7qL5kbRtLbq+GltkEEd0g0Mn5XoaJrZMFdOYALqStRpCy1pLZgi3BNSq1phNeHQxkiD0Mi5OG5qkOdpvO0eRLT83EEvAe5W/ULs/KnqToGIe1v4Nwu64CjG8z42ie2NzG6sGV8+g== 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=3nOnmDtRPbiMQMNfSWmIFt/QJNRbD0naJYTvPN+8Lcw=; b=Ci+0PerYXZMAlDwYJY+V601aS9l/tJet32AwYkjYdaTRxHvAG/pVOsv4UDuKexpUmaE2Qhu4HjzU1p+xCBQs6BzLLjOez4lqJWLZ/H1dP6M44q/3xheTDigpUBWilMOpa979lLEOqJMK9EYrsi+Bng7P12qkdRmn4xdBRFcMOo33KFRNZ7kg19nKswVW0kz8jmX5iCJzRzGtqVuH7IBPm6jqjbwp4BZJG5B7jB6BgaNRv4t3I2z7aflUSPQw2Sh2l6JXwruShaZm+nCGnKFmDz0CnwB3nqln0dAjPhezWo2sys5ggXt8dnQRS6o3a7g+/1cIUu7cyd+uXomKNjIWtA== 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 SI2PR06MB4012.apcprd06.prod.outlook.com (2603:1096:4:f9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Sun, 19 Mar 2023 09:27:19 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869%9]) with mapi id 15.20.6178.037; Sun, 19 Mar 2023 09:27:19 +0000 From: Yangtao Li To: Chris Mason , Josef Bacik , David Sterba Cc: Yangtao Li , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2, RESEND 06/10] btrfs: convert to kobject_del_and_put() Date: Sun, 19 Mar 2023 17:26:37 +0800 Message-Id: <20230319092641.41917-6-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230319092641.41917-1-frank.li@vivo.com> References: <20230319092641.41917-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR01CA0137.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::17) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4012:EE_ X-MS-Office365-Filtering-Correlation-Id: c19e86a1-f45f-4962-193a-08db285c2315 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s4jyeVmflkFx7M8hKo7FfALrpoqTyKdmUF+zzHYObr3bKbEcdX9U27e6xvlpqkvFFOiuU7dxRkXddXqiweKSK68W2MEtr+7YxmtJq1S5blzPq4H0lpxclFq1SSsC7hmjFllyWhCqKihALpRhykDAGMBwLh3+iRRM7Fhs+OyuwOnLA9NPR56ink8hqlScXG5QZ6I1o9LojL6FOTJv8yYlHhijRQjeccIj3cpKScSWunJOsNjoRptEBRCjcX2OPPq3FDSZwyg4xcLQZLqRCeaMGskSXdRr9ccy4gTfNReTfyidoArSkbsLFeLjQcFBRqTcpV5dwTAB8HPoG6sXHgdIlER+I06DaQeZNQw57AgXZpxVZLpRsPmphfqP77V5rkLLkSc8O3VoZrnZHzkZkjUjzmpDPf+4nK10jdJDogf6h3dj9gHTQCp7r4H8MPtCfWS7IvKomwfQ/Efc7+bhRSjyBJZD4BlxhvB9ocialVLXRMQV6BtRiqxp9fiZUpnA7uccxyHAUrj6MYqv4OKccdlaQ/YyQclyGKJ6t+Vt/t/Y+LIllHZuwPnPouo/f+V0BPCQHfxKU3V45BVp1JHZvQYB5XKHfvrKQQWm7CoaBdqnMU1SLSvXD3TkbUYzUsOkzMAOQQtPuteW/3Az1p+hBsdoAk6TLp8sdujSoEXdkqIs6cfEHhDKBpnYaetGl/BnsR7jk2GJcP3cXY0DZYgm5xZi4w== 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)(346002)(136003)(366004)(396003)(39850400004)(451199018)(52116002)(2616005)(478600001)(6486002)(83380400001)(6666004)(316002)(54906003)(8676002)(66476007)(66556008)(66946007)(186003)(26005)(6506007)(6512007)(110136005)(1076003)(4326008)(5660300002)(41300700001)(8936002)(38350700002)(38100700002)(2906002)(36756003)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dkulLSGUsHzzQIuVf4W8yMCzWyjdcGQqjOP5kN7jiE6JZwpEgZSgXLlT6HswWOTA1PSPyYmFZn4haovr6K9Roo2/oWTVAVzx8P226UmkVHd75Xo7xtLCv1c4urFL7r1ihIRRyNo6zE84Mos/eJr87u7QalVD/YmyPesU98IIb3vKUctgPUaRsffXlHpTKmJT/uSwCagE+NGzymn3pTGLrzpbB4qd4/DMjFQEldEfqQ0eYDL5an9hrDVV7ZxosuOhDpVE/Ywf/2lY8mSykKOSrxRi1SIKrhHL1jpAJiwJuVXeBWjgqtmj7tuod/5/H01Se7J+PzrGfGdbvdtnIcvF3n/ISABetXye1/E/P3C/SaVaBgG3kZtBB2gmLv/Qb8MjK7TUW4uge3IgTBp1T4pk4j9/eM188Mro/uP+R8FCx/KP5Z7qCk9vwVdw2b31BoeD0+wPSYS/HO/xGQmc16lxkmb4IIomGZE+wdY1y9xu3+Kb/gjyXR3k0SP1m1vkvqx2/EYEDn/YktCxUIPDYvMELN2H+w6A+i33/8OoT7biGhwzZaE72qR/MFtUodT3sis/e/+T+8n0fhWQPFupX2s6tpa/YFrhwJkm9hWpgstPtxC9z3yQZXbYdAuv+dmC/jGDSiOqrOhPX+S7InBurDee4DgBwUfCTaH87Jdx6NTS+pRNhRyIhysc6DvpNJ5AEjJ9hDaUjtBLrz1kQxjS0I8X91lGZxAcOHr1bqFmwWWDAdl/pfU2eptNKQXr+GcS8HLvVVT9R9bn27pZzcUaafZwuk8mYgcQrHSRcqZc4+57tFw1h0YzpGB91XNRUzcfVUs8UruVoUkESlIvD6dZMT3ODxhqOmqkPmHqEMq1XpwLrNpMWlu5rC7DCruu49dyhKJtKrSrMBsMg8ekwZ8yfx716b7ehFOYDaM5SslmSjARQtocKXWJOE/GEipxH1BLQtwfzHKJGmlhAysGOpxc/0+eVXvpj1rEt4C+1gDx6FokgBm0VU5ihx79I6uiyJddbXu2Ne5x4F9qVkDFDKsjcfspHln3e7WF7dNteNinA9gIluFIFtf+T3zAQpDIMEh/nw80lAfswgn4/kSSPcloDVpX++4WfSUbXj5IVeGXrxk3WuSyplpuQIO97vMl+nmIMvbDxfKizXJXDJacdAzdUvSp+2jXdT45CkEf35cnm7TDKdMomjHVZiLt3GcFxYxt7XIz3FZiyextO9JnFXpFM2XUcuaqUVGOmqVoEFCXMeIMGHpxJpaHk/mbT0gJcxcNyvZZ/pdJCjFkxH7MHuD4mu7KDDNnqo6nsJi5vyywewpkYGeRCpnRkJGwpLuZJh45VecITkEwq5aDyAe4VDGHAY24gav/s9UoG6A+ujbtjcB6qoFWs8LE1eBD3eETUUIYBkiuD50dYPAtzvbj3SIfNaRupGUhK5JoAonFAWkS7dKb91yG6444JnTw9ndfde2/j2EmL/DyUHGWQ3AX8DlMqBHD4cCasHPj1260Bg4lUc/IsIuq5Y9VWaL0TOqsmg7UfGXRnFc/dgUG/rM/fm87JA3uH68LwWn75wMTGfCadHpeup9jpCy6r2X9CMNsRTGlsWnD X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: c19e86a1-f45f-4962-193a-08db285c2315 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2023 09:27:19.4681 (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: FCZw1KQAiisQUKPQ/RqhshdyvfPklBqACU1TKHx178cQm7v0SmVFFBGaIYoUsQVtWP5NBZEUt+eQ88efQ3P2zw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4012 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?1760787857229568827?= X-GMAIL-MSGID: =?utf-8?q?1760787857229568827?= Use kobject_del_and_put() to simplify code. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" 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 Sun Mar 19 09:26:38 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: 71740 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp653399wrt; Sun, 19 Mar 2023 02:39:41 -0700 (PDT) X-Google-Smtp-Source: AK7set/pF7PDSXr1+hqlQC0NEp+EVeRltOdq+MK7zqU7cmgj0Le60yyAoJpjQ22r/hClsPNJuC3Z X-Received: by 2002:a05:6a20:8417:b0:cc:cc27:9185 with SMTP id c23-20020a056a20841700b000cccc279185mr17780806pzd.50.1679218781652; Sun, 19 Mar 2023 02:39:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679218781; cv=pass; d=google.com; s=arc-20160816; b=KuW8BzXCL2YNKC1jqWMVrh7E0ni3eRVDJe8VylBdCWG++RX64DiK7TU131PXyYoXzk LUctz/u0k16yc1eizFacZ+0q7Ks3XqXyK68Rujd7+YndvqFvk2OHy6oj5lgAzB1HQUBB ETMAc3LW01BiXGUf6nVKnndEin/qQGOhCW2z6SiN0PTrt3I6mlT8JuANlk3u7S9+nDYn lSnsz8UXCVQn032h0SgfRbPXE8fn43Fnl8zzLyGtQ0e+VuzTAY90v+ThanGuoQ37kcbo xocDQjIRWAGuY5pFV4sgcfi5vlfrhtK6zoDgsrsgYm/V5cR7r3LzCGC/bw2bDLHNaXw/ reOg== 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=uOSp+BJif7DZNfqGwNo0uxz7Rp6qR7QtsZhgyfaKHS0=; b=BDTtPRrSX363f3/KSwEih1FOAETshiPvDifWDkTZ7tM68g7wxflKRGSVDD08vj+9Ur IGUVX0IeNbAv0RsGQJpyZ8COb7go0v4TgFjvN00NPD1nUdonPBAkuSK52mUwzcNMNi+h 8xnrydtpoK/l8ruwmbFzzrCspwpwNMhiXAey1WvA5BHgskIKmPyCC2gjqFtEtWdFNPBK SDf9MG2Mu5qTm5V/UNyLOyPIwKnkDuIadu+V2316xwBDU351mqnw9IugA8lDOIR7k/tR rVpfgsHjH555GS0CUVPih/QOgQGmiv0bm2/QExtZ7aHylXvKmI6R7s0eA1g6N9EWhLgL PF4Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=N+VfLWI1; 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 c25-20020a6566d9000000b00502fd84427fsi6987711pgw.482.2023.03.19.02.39.24; Sun, 19 Mar 2023 02:39:41 -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=N+VfLWI1; 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 S230160AbjCSJ2F (ORCPT + 99 others); Sun, 19 Mar 2023 05:28:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229778AbjCSJ1j (ORCPT ); Sun, 19 Mar 2023 05:27:39 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2123.outbound.protection.outlook.com [40.107.117.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1441F1A4A9; Sun, 19 Mar 2023 02:27:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mjRG3VCnZepMrIWi0ZnIB1zlCRea8h9vRc4HLxcGXNEu2Oup/IJbs84KMJaz3hi3qAmhazsGO9spkA1RXTNKZZhs5hxlMFMuVNWqxQstR/8n+gRnn/v4AcX9sxIoZQCkBeRjFf4wwkQjBkrG45yQ021DrIFAjkdiWbqcNg2UX3iJ+jyBRXx1BwocETgefl3tWV33RccF0QahHNwGEXMclF0A875ApKo4bNDthHxZQlFrX+PnsIwqxReXpBDS323lA+9lZE9m0WSTcX8pCskqbv4NcyL5noQULts2EtV7NgMxTcCIMRZ7tSU3RywAjskPLb9pui6r8KYoxOyUJ/Of6Q== 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=uOSp+BJif7DZNfqGwNo0uxz7Rp6qR7QtsZhgyfaKHS0=; b=S6g0PrnkJC2lVko1s40Sm5mZXIzUKy3CUs1gG9m+PkmSwULau+EuwKzyiYkeex+lxON8K9z3nQ/q9P8sn39sm6xWVxQsmFxK9QrdzbvwwwHbZXpJdiVTpNE39xP5ff1ufWv762J/UGbgEbydplBikrgI0T1hjt0LeW8bJau5O6Z+trWJdgJM/gnmzA1Dpm3NH6KsXLfU8jnirrz9wRCUfe5xisiXgS+xbRSh7PLibDGoMqhFiHZkSS3i93NzkiT7FhAaLAM32YuG2CbYDNDx7zalu+/XMGX02Vdf4SDJZx7B/KL9w2akDxn7i2w0aNXH4b+31HXvN/Ui5TspDahrxA== 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=uOSp+BJif7DZNfqGwNo0uxz7Rp6qR7QtsZhgyfaKHS0=; b=N+VfLWI1bbYoDQ18JOFHz4mC+EJzApUaVU9Km0qem3ZyP1NG0aQdEaxTXLTg5hlhhy+KmxoNyxozzxwUdCjLXUUpTvsfy5pIfhUKMJ+JTqzEsB5VdB3Tl4ZxLof7V11KfEQqUFItpbjWJz5D+p10gq9KAP9Td07fu3qhfyFv+q1+LnB/f/Rl/MzGiM3l9xuxgqWkRFIuBpq8FvlQW47bl5PhY2yyEoFqft+4lRgH9N84ddtznJkUteGS0VzfXQFmK1HfNOFl2wzNpbdifOxh0j95aP4/wIi5/oIO5ICNRvmCFXhDlfXKMIBx65qzwle+5aXZSj7poDHyfXNW+UFpKw== 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 SI2PR06MB4012.apcprd06.prod.outlook.com (2603:1096:4:f9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Sun, 19 Mar 2023 09:27:22 +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; Sun, 19 Mar 2023 09:27:21 +0000 From: Yangtao Li To: "Darrick J. Wong" Cc: Yangtao Li , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2, RESEND 07/10] xfs: convert to kobject_del_and_put() Date: Sun, 19 Mar 2023 17:26:38 +0800 Message-Id: <20230319092641.41917-7-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230319092641.41917-1-frank.li@vivo.com> References: <20230319092641.41917-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR01CA0137.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::17) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4012:EE_ X-MS-Office365-Filtering-Correlation-Id: ba4d3692-bfbd-46fe-ca72-08db285c2448 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WqCf7bgT3615EQMexCaRiphIMCssX4CiRjz0bbppti/v945gWHQoby3MiWfFSNLtDO+3btzBsmh/2mWYT9jN1H1NkVOHbOHu/UweTwX2JrC5RNsbwcueMs4jXWW7XjeXs4Q9kcHcSzTVriJZvTg4hn50C4+EQLJ0i39j/iVYp0rVfHkb9G6ThxFzwYBINL7X4A14XrGTDO/N62WPbM3yZDJUfqQa7Udzdw5AXNI1XiSzoTsO+aciOJF7PZ41cTdIdcj3o6/hhI3vuMqVZEwo50KNPbUBDCWr4xmgs7RdT88/dO7MDaY87iUBLqZhKv5FPnjDFOjua7RgLZ6ykfMYyEti/iWr3T2qD5F0zgphpR52prNMUP8m6CeZJx1q9lKr/ysiN3szQLaTRMzMQMc1vGy0djKh9guz3rvShR+4jP4oQ5CVhbf79+1Jf17kuRa7RilzZx8+Tk+a7rn3bfCF8YkEy8a0ZEUnNQbS06jcKXD/92FVSikU1PRl5VRB3x7gJkZmPnMvzdxRt2bJSU4uI75+Jsai3r2CZemyE78vWWUmtpwKNbDP85VPZC9aU+muhyjKdn2rmH3noz/oOLZfW3BSztw1vkE8wb1nttfp+x8IoiMm+ZBj+PEcMucAIAjosptImGQrL6gfXb+w93f4kDQVCAHUT3oJFVsuNCko8oz4ICODn8rAZcK/M6Bbhya72AItWYnXx8CYNRNRBRgZcw== 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)(346002)(136003)(366004)(396003)(39850400004)(451199018)(52116002)(2616005)(478600001)(6486002)(83380400001)(6666004)(316002)(54906003)(8676002)(66476007)(66556008)(66946007)(186003)(26005)(6506007)(6512007)(1076003)(4326008)(6916009)(5660300002)(41300700001)(4744005)(8936002)(38350700002)(38100700002)(2906002)(36756003)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: myITlizxOMNexpKekaTOBHwnG2Sj9eAOa/6DtqAJAG27mEwXNl0NINdUKOp9LqxdhChq99ZVS6xj1sFZznrE2ex2+jTYnjOw5ELPtE0mi+bYRZWWRqYJ5c5oJojhDBx8LsJY7lihv904gLLGWgtlVu1EJnU7INWcVhUdsXYEjxQjQo08t2VHV+GtF1bxhch38o8qg7G8GudK1BR5MUbQqN0ckMB2aQMAA+DfJ86VROp5MVeAbz/QraItqIoz/a0AybEP72u/QJonxCB6bXRRVZwswaWfXsA758n9EWLN2GKsvho/VpYoTY/x4zZH9+CqPsZ8hYRxaAnxzs+Yg0LWZquroKQIXwNP7eHbPWE5WXNX7YLBR7t/boGmbKshuGdjNsaJ/ZUB1RgpjpBvPfssEH10F41Vyo01M8dyZeZs3B1j39m23c3uSMP3D+qHdY6TUsje7nphWGa7pBsghXjOpZStB0FoD0A7ZAuh1ya52aAj9iJdXOwipf2b9BIUIN9BBiotEnnkmxuYnZpDzyJ+zxMCC+FEmG9pZLgLqw5ygRvNC414G3lvqZ9/a+RJXs4jd9DKPfOvuUJ7jH8gHVjvgGyZ55IBef/sBxFjIM6JiikA7cfeZX09iwCTn9AUHGXH/+/3fYG9wsELfqqOlaZCZvX4yedGmfCe4WMF596fPyK+MzwZeImGId+ogaAKGLjj/N4eXj7v9jYyUO4PkufW72JMYSxD7n4HcsXc0nWBmNbCBGeL6ytgR92fbw4VrSQobtAozDjDW7XHUNryE+WRL9S9D/qTGRtmC6EQWVOWznSDRSMANVHHQk15quAm1nGQOlhMeD7M6TYtJIDCq91WEBu2VT5QtfoA34TyqQ08wmhfEj9HC2QwJg/nUzEr0by/GFuTrPCLiXlVy7+u3fd8G6yD2IDg6OQwoeW90761jVXgFlk6e7vP3K1ZwF1XVUkoQq9hg7UwO6NPcsbGEKSnu6swUNTMNvl+5L2oUZl3EtN3Qvims/cMymt4/hxM3fj22/Jd2CcdSj2OQi5o1yQ3T4t+5bbE283RCEr0HS6EE8u6x6fpFvO+pOvdoJm2n5/CK3dvDfH1ooIINTrYPH9Al46maLgjEWT9iiCbErYt1fCU8a80ltWHHBTj9yr3U/83sTC5QPbL4V3Lw3qT04Jx3GIyf9VyB1Zk5Y5IWcXI7Co8rQCldEmaQD0JMiVULg9Yr7aUVuaQQHKnzpOH6y9FuDIuB4vZlunjbN/52t7qs/KgjFLycGPn8oII02fo6AFgPJFiioffObD+TqIX46o0NaeCA6KV2ztAWeRy8BM13+va0ivtoTphcsa7jT8iI11qDi/uLwp7+DKxi7E72RoH4CrTjh3ocL7yoUx/byNTjsaQPAK1L7RvUZ3xXdfBwdAjW7jsJZjPF5IpnTKS8aueXhI4shjtj6eUy6naj8TqwjSa7lIHoAfC9oihzKcN1E2MbpqO0d8/N9OEghiUn5CoEcsTtaSIISUnZRj9UtUirgSgcVw1z0p8WEds6VNqV+mWXkqVCX7zUUFfflCMIsA2dkWLFmORvwEfo1b6knaZy0sM8USXmnvSNHGUg+ERHxi5 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: ba4d3692-bfbd-46fe-ca72-08db285c2448 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2023 09:27:21.5471 (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: grKAwbcWeuZ8b74RUuylqaN4X9yfChIhl7eaWIgVpRWhVqArnGZeiytvGhQ7EQTkTnMxcdlvKd6KKA+KWehI4A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4012 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?1760788513061242675?= X-GMAIL-MSGID: =?utf-8?q?1760788513061242675?= Use kobject_del_and_put() to simplify code. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" 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 Sun Mar 19 09:26:39 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: 71737 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp650927wrt; Sun, 19 Mar 2023 02:29:22 -0700 (PDT) X-Google-Smtp-Source: AK7set/quhabst4aw+aSyufStoRsKDQ92A2abU80mgIHXDaG4zSFd/wpZWRsUrCx2X9Nae9YKf3d X-Received: by 2002:a17:902:d48c:b0:1a0:57df:861c with SMTP id c12-20020a170902d48c00b001a057df861cmr10130334plg.1.1679218161781; Sun, 19 Mar 2023 02:29:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679218161; cv=pass; d=google.com; s=arc-20160816; b=Jt3YlGijoL/1qeHLw9c0kRD8cXAe2q0j4JrgU9d1tZuSZyrPtoftME3BRuq4Eou2iW gqHb+jqdKtq1E2UfRoy3a2cxOGaP4TdJUtV1QbFmPEqt1NE969GtQpkxYVCA8VxVTzI2 itV7t+WPoRBKEK15SqXwf7cS5wmLdKuEOKjraCjz7iGMByVApB3Mqg0P7veKYlfvxViD B5JsOAhxRWY+M5y/But/iXI5R0N6RnDw3pQJYZtj3HI6Q4ZrNYJjPglqMKjsIry3vw90 M8QBNsmMG6tI8BoeH2wrtxA6/zDbOwDaO2dKbxzHe6VCpvScwArAPgJNoF4jsoZI9eDC aRuA== 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=hls3ELBTfAPebu+2KYZozBFgc1+NwXVJaxIp2fmyeL4=; b=ICYNMt+k/1lBnToT7YHUNx+BGyQ1E/5APkPpdxBBBnjLD2IEkLkMA14OOmVd0G+zbT 822XCsxBcQ7U2qUht43CIfIMz8YPVQKzXlZ4bbEjhshNLoT71lxlKRz+Oohx986upHnh +7obl89sk79AmkZ/cB04TGbJ2+oTKMD1Phc9iiqbXekjkq0RWqKGl8iuTfD1CaBgFkbF 0QojYgM2xIB7YHEAft8HCcF4C4NAx1qBq9/Jpdq+zXMYSsYvZYRbm/DZ3q2ZuAelzt0h AKops9EHLYF4+Hvr18mTw0DXJtpIEPRxZi/Cd/Di9iR2/eyUKDzsqk/V3JFk2bF6rOED O/Xw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=AdusP5DM; 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 c13-20020a170902d48d00b0019b7766afdfsi7772325plg.626.2023.03.19.02.29.06; Sun, 19 Mar 2023 02:29: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=AdusP5DM; 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 S229621AbjCSJ2A (ORCPT + 99 others); Sun, 19 Mar 2023 05:28:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229805AbjCSJ1j (ORCPT ); Sun, 19 Mar 2023 05:27:39 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2105.outbound.protection.outlook.com [40.107.117.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE9F71A484 for ; Sun, 19 Mar 2023 02:27:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mw+j7bkkDr7BzNV/FSM3E1G2qrTLcqFhqGjF/WCMBqXlVPft7MhnpfgDhXU1XAlGkEvvc3x+IdzBC/fNKaj05azGGoyookcE2A73WIT1aDgmzkBZ5QV4hphMkchFV2VtYRvTKGhwnfKaZxIKnM4BiPO+fKXwcD8DnHWSDnvFlsi/Kt2kcecfTmYWcDECDvqEZkGzOEf464l7S8kOUkm6y5Ur4qS8UFSamrGUEp7H7jy7fg4W6RojuXZL0TSTC6giBPKaTk1YeROj7VW9l5E/zr5TZncc+z859+alOMIlDMInixtn006cefgiY/OyUmMv8bISmoHJGMFqUjsYh+0nhg== 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=hls3ELBTfAPebu+2KYZozBFgc1+NwXVJaxIp2fmyeL4=; b=oX/5Yvtfo5qgoF9IhN4cv061c/yU1WBJDtj6MGFe0DZLoGrwhMlpICLSfMAYlMTE5F+wPgeQP+hHdjfo20pILdjsXsRhEAu/hGN0duRL4QqYfOphFBWg+DTCQvFGPg753KpXv6J3bKZZHqtIgyMpwnfPWfAynQTL4yxa8E2rYzyrDSKnvsqphSaVXCo0QbOvfo7fxmfLlZ7CMlpxB0SCQ+2EqkwBHG9BU9AxXkFwzST8ZOjOtdvqLMlPiV2PnrfvXfBuOX/fQrnjKTPhqyy8HcKDz6PWi6MagRNuUG1Icjv8/DU1lTu2SNdsqQFXuSzH+SxXVfL3MOU0zXTR7owpgg== 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=hls3ELBTfAPebu+2KYZozBFgc1+NwXVJaxIp2fmyeL4=; b=AdusP5DMXxj39u9WzxW2k06xK+ds6CzkFg5fzaODk4NmnoziZkQq4kairmMkEiqSEGw1yu5BpPTb16URyhpTjaldENCx4NQ6j8TbD0fYHrDw8aSZh8X/XX4CmMC4ISnkO7UuNFBWEeiyeb37YzsEpFR1Gsaz6bbNh2WwT7BazTVJDZhNxI7p4iCykhmMdjw3YZWYJOD4v2hfaOWhxIfnHy9wzPf5CYrXQYlNTOtFMRqehMvw7btPukAvAwmPbQynRZku/Z3r40iD0C/2IFAXv3bP6voDDI6Ysu7GND8fjCFcExYjqko/f3AYI+OZMIveph6XREbDKFtnuzpREwPvJw== 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 SI2PR06MB4012.apcprd06.prod.outlook.com (2603:1096:4:f9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Sun, 19 Mar 2023 09:27:23 +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; Sun, 19 Mar 2023 09:27:23 +0000 From: Yangtao Li To: Mark Fasheh , Joel Becker , Joseph Qi Cc: Yangtao Li , Greg Kroah-Hartman , "Rafael J. Wysocki" , ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org Subject: [PATCH v2, RESEND 08/10] ocfs2: convert to kobject_del_and_put() Date: Sun, 19 Mar 2023 17:26:39 +0800 Message-Id: <20230319092641.41917-8-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230319092641.41917-1-frank.li@vivo.com> References: <20230319092641.41917-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR01CA0137.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::17) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4012:EE_ X-MS-Office365-Filtering-Correlation-Id: 5488fe64-967d-4777-fe43-08db285c2598 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kB+NjScSeuCcXXqadgKmgzjfRup8SXEggCkOBKCYxNWB2CCTjV47KY2jcMT9eVQHUVU5LoWDDw6kkCKXp2oh1eAD7DndGmTSWQQBGVna4hDSczA4ZrNDKA4EayL2aSo/Zfd1DwVP7DF5Hq4pJpDVeAclIbG6l00AdRLW0SPqCOFED83eqq3EqauQGha8wq3Fxk55kzunNNtoj+5JuUANhKZeP7Vb5xGhF0evy1rUb0yjnFutTCDJyvD89ZxwD/lfQ01UjtIYD6N+M8RsRG/7C23nF/eU1i3PadCsarzdvR8VVy845bRaF/kZC44sF0Di+ycDkfu6IkXtYXvEpRdnTcTZEZndCs9C3NgUX6yEDgJZrxldh8JajbrZygpOkHGs84lG99J9Jamuih/LE5MDjeL7hv0zPyfftlBNWzIfNnGsgjD1VmcA2+hHz7LJgwMq58i3hT7tALK/kW5ps8GLHXIW3dYzYkl8cwfa8UtMcDwugIx7rj7DAKjmm6CiZbSHj2nnQ2jw6oNM4isCc6HABBxozC+deqdb3vuBMhDcfrY+/yvkc6m8mr+Y4h+7TdoiCgAsa+VQkSgciFeHETAF/YWZJRIA8Wf9x7u3cS5oilGbI6KHhKcl8DdegoEirYxZ3CRa6IkAzuZYa3ehT/IZN2+ZwG5/57dJ5X2H1UgfflDpPbkxoGOUOq16IdkuSJP7RLVlVkNx8UlHWAKqQ78aGg== 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)(346002)(136003)(366004)(396003)(39850400004)(451199018)(52116002)(2616005)(478600001)(6486002)(83380400001)(6666004)(316002)(54906003)(8676002)(66476007)(66556008)(66946007)(186003)(26005)(6506007)(6512007)(110136005)(1076003)(4326008)(5660300002)(41300700001)(4744005)(8936002)(38350700002)(38100700002)(2906002)(36756003)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MsMOPiaqI/u31IjWiVCLfrNN6rgv5vXfdVVxDm2FmI23bPXOX/46rv5aoGtvm42AJ6UqXgmRhdT5sChI0JXH4YFnyoK1o2PR892KJZIGZk1/XkLlTslV7r6Q9NIdRZxlUmOR1kgLHF3ejVeC4S3n4OK8KX42soxKcPE4D9r8y9HzfBjBdGIFj8xEwGAx4DXGrpZiw6opxI1rqvJK8zN3IK2kDNYugJhAyneXNj1GvQfCz5lTbNhltrjvM2OgUyzOwmDQQbFu5cJ2DbhrPMdcAfLi9eA5QtJTXIytjRmBrEY/mY9p3T7pLZ+WblUyxO1JrKR+maR41PXeHXGobeBfkLIX48jPvQdN2Jj/wBv8Lc6l1VtY16kXIiWIqZoN/V9/QHfUqlyQbZEXUCjxFaEbQz+FZ9QH65BPq/dqq8Rgm0Emp6ix5ivFaDaJC23OFhEQZKzrsvKxlpLRh8cektsclVE0g3Q8A1VmdnYFov4wNKFFCaObBIph6EERGVH1wTNkED7cjEB4TWkJQCNWkk3E3KIjEg87ShuKDeRqV3CY23XKkK7ekGVnB1FXz8lP6OSC551kjwGpXF+kDFyb8uM7GC++SYqhjTA3WzensQq0dK+IuUYLkTnP0MMLW5a92799BN19K61otmeLrsOE2K/vMQm9lNPxapbWoIdKQrXcSsClYZ9AkBZmolLfxC5gGrOg1DQzb1AaJd6Ra0ws/DejUB5rQIyhEuAqaRQet/e/BRC80kPKPvwKZj60C9qj5Zz5Yc7Iu197TxcL7X0JyVCa3uoIxZ1XqEz9XkGMH2CC6gdzRAGYzqrWRGNil8Iqxh5zIH0rlGt4QXYtN4UeAA5MLfnlV1WPBCBz9Xi61zpTtrvn+d7wBU28dzWug22ULQFUnAtPjp8h0YGarNWsE/QnhF49ztAkVKr3dPlQqXFeCfPFSPUwMuCPSpT+ZK+ESlAv/hu+POKfDtpGujtcPZRHVQ5zL0T8QVpftb7EvgcutSZ2syDEgPYTVeQ1ieoV4SnHgo+uD8vhPei/z9Avn6JEnCD5DLlSXzCankwffhA0/WbPxvK14SM3oSzupQ/IaDvPHjY6T42bhDtbmP0kmh4nlGgjOx5dcE8QHN/2bUo8KVsS2vjj0cBeS0oWIxeGtiP8ZJQn3pdy9rYBI6GazZeHpEWz3lN+HkSkpJXFBZWu+udpgdahEmcs19UpCTDRfYIMpJF9tw0+WyYj7HwLKg3AK953m+7DSPwYJYFL+CS8EVH7lu5E3X2d2Ik7ODhYNp0LCpOs7nf5lPemZXR7kjxCQR+aNu+KLP2gbhiSLnMPJSMHGOcqButvePk0Co5INGXOY20c3rTLHLFpBb1P1tmPW+cIhQkZ/xf4xNSQkifiwvjiqDJTHjjYdPhXmaxxtSBt8oK8YRp+xVZiDcHD8fIb8YryKnzg7QvpUhhK9WVW3rGM29jLOo4VURJUlKEco6mTNv02rBo6VsSdHF7hgUvYNHWOre/0hdDSO/2310lUfa6Gkm7YHjJcYmzOMyyPb9BoHkAzq8vWcm32FHGrFLy06DlFuk8EptsYoQJW7xZ36FDQqU+eBFvph5cKCplug8WD X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5488fe64-967d-4777-fe43-08db285c2598 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2023 09:27:23.7661 (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: w1YrRh/ffdLb0e6vs+HtYh6XCLIuKCevTIpq5Cdq/MEZag904R4IXMGR63SWw3iu6l/I1iKMncwbcqWTV+5PNw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4012 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?1760787863359137623?= X-GMAIL-MSGID: =?utf-8?q?1760787863359137623?= Use kobject_del_and_put() to simplify code. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" 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 Sun Mar 19 09:26:40 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: 71738 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp651509wrt; Sun, 19 Mar 2023 02:31:28 -0700 (PDT) X-Google-Smtp-Source: AK7set86FynPVs8GODYzZtoQu4psoB8wjKbZR5f3CYt7TWnDU84f9XMQ/eai1+79ZO+gqFGnrJly X-Received: by 2002:a17:902:d4ca:b0:1a1:cc60:73ec with SMTP id o10-20020a170902d4ca00b001a1cc6073ecmr545945plg.38.1679218287793; Sun, 19 Mar 2023 02:31:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679218287; cv=pass; d=google.com; s=arc-20160816; b=EpNqrWtbZYR3tE5clJX/AgMG7hHDLPIT8xznUHb6simypv/d7M5GyXljHbbqMaHwYU iVwTgcf0i3wDEB4Y6RMLSMED4R9TvWsTjjv+YLF93nusWwy8PkpGWo9L/dFry8pronfR DZD3F6gHLMVyE7Ul6VPbyhE1LugL213eVQsFpTjC2okf5K3DrQE3eB5rWhPk0C9LBnNH HjegBFpK7ypkNZBb3Gyn8jB0OXbJySwWdU8G0XZLaZ2FQGkbGv/xjjdP+n4OwjHU1hSk oiCqItTn6R7KC/I7sVVsSaEv0ELA1XOFAaZsT/14AGwjjDHshSzuHgzzGLsXKh2/4Pcq 3WYA== 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=q81iK7HLN6yJNsX3Y6yye3cjtezWCjI30boi9TiN/gQ=; b=AhAEDrRtIdKsc4yNN44+YHpWEH+RxUYKQ0DCSx8EJkJesskvuM2bseQcecvcS9NIfG j0VJDrCknzULCI9OmbgXmUZiwui583C0N/+zvLTcEkHa/msTlRTerxhrig7S1lOFapZb m9tSN3CkL9sR6ilj6XwIY7Jn08bpFkb9GN0KNHQ5NP/USiqDuyWcaT+r1nQI0RlikMbk HRtB01R/BOw5oglhiN9PWDqwehCJ77K5VL8G47dv+Df89+BLQprsIDmW4ODgt4d6krue TQT6fBtaqmcB1yslA93a1pE1FiVqe05IlLkJemUQTsNEfK/GTj20Q4/D9BgLSEGIt2Je Uhdg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=Ixym8emj; 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 s11-20020a170902c64b00b001a05e6bd125si7185476pls.25.2023.03.19.02.31.12; Sun, 19 Mar 2023 02:31:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=Ixym8emj; 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 S230176AbjCSJ2M (ORCPT + 99 others); Sun, 19 Mar 2023 05:28:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229911AbjCSJ1k (ORCPT ); Sun, 19 Mar 2023 05:27:40 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2123.outbound.protection.outlook.com [40.107.117.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4A5A19F37; Sun, 19 Mar 2023 02:27:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hrLpavS3TTlwUd55EY/yOQwOlyt9sPk0+J3bJ7rwOTUj++oBjGY73IwAzy4zl5v2SYTrGwd1o4TZdk2U8PrmtG1ckK3LYJ6l3N/4AmCEo+uscC1Z0T4CvkxfCQKbuph3Or+7wUbFtCUbcNeKj9YeLkMvfcn/EivB4jw4vbI2pK5i2mXpDAfdYNpHe/Q2SRWnV6FDanmQzyALg2UVKzRhd6B80zOv9AyD7A4QxW+Ue1u3eCgOoxy2LlOX2YUUaStsX/uhLFTROdEGBB33ZPB0KBBjA0tckKd468Jqlh+a7GAf/D9ZPcx52XcYeUxNfOZ93HSEifUMPu1A5erKMX5jOw== 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=q81iK7HLN6yJNsX3Y6yye3cjtezWCjI30boi9TiN/gQ=; b=isGKijz7Rwtxhv06lJncDJO54ulwS2xfSxMKARkzXcB8rsnw9GQ3pLlZ048NmlaZZ7W/JEqiEBtwPswzXm3AlmZ5Kekax3Q2gEFFV4yWVEdJw5CVPzHBGySayiWXJpNyhXxewn7p4rh/HX8IFGBKNjY2A/Q3mf5+IMeL3Gq736lw6j/27WZDYemEdZ/7af/lnCmC3N8eDmgWIlMtkY9wg+HKQdDNp96MT2Cx7gEstSv5ao9t74NbOsDZDU8yUvOIV8HN5M57Li8YsvI6BToTaNAqFZRjel2EMa39SAl+XSB7xHdRUoDfdXDlsP3kSkrfmYjycI4EY39m0ko69Fef0Q== 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=q81iK7HLN6yJNsX3Y6yye3cjtezWCjI30boi9TiN/gQ=; b=Ixym8emjX3qKB1E2STdZ9EB0N4aMoNLwmeruUp8u+whuq1kitBOny+VE+UsQzgZj2iXIOrkMwfnG/W9xk9QK9C8YnhQWDG6lkgt7Y8Nn1ktr2K3M3GeR/Fr5skbi12C9n7Z5EPG8JWk7eSRmjDAFQUXFLAY7Ey6tOtvOxM2UQDnWbkSC4ywHDxZsSs93pt+aqBwR2NehV/t3fmphTgmEOBtsnSRfyuUuvLAFIndsBfux72v3zIgK8oGvQnwXhDJDcZxJJ/IZRWOGG0Fl6ahxXNe8SiiSBzSWO7FzAa3NNizqxTduTp7QrrcWFPgcuIVEYGoEnN3OuAyRQ8ik/JzGGA== 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 SI2PR06MB4012.apcprd06.prod.outlook.com (2603:1096:4:f9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Sun, 19 Mar 2023 09:27:26 +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; Sun, 19 Mar 2023 09:27:25 +0000 From: Yangtao Li To: Trond Myklebust , Anna Schumaker Cc: Yangtao Li , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2, RESEND 09/10] nfs: convert to kobject_del_and_put() Date: Sun, 19 Mar 2023 17:26:40 +0800 Message-Id: <20230319092641.41917-9-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230319092641.41917-1-frank.li@vivo.com> References: <20230319092641.41917-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR01CA0137.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::17) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4012:EE_ X-MS-Office365-Filtering-Correlation-Id: 716614c1-f5f9-47b2-6225-08db285c26dd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AeP1jLEm2MBQqfmAR8xREOnWFoScJ+UVXYccsQ6oStax/7X8JAACLKkoE3U/MnTVcj3aoCf1pQRIDNh54tVdoIAosrBChqz7zZQTnS9GHhwRivwOFsklGLPJGXmHu5fUy030kG65qTgewxDZ7QQp6OLgbqVJl5huV8p19687a+eli7duh76PZcBq3LGQIUOCyWbB9houDsflVhZjQC7rbuEZ/9Mq0JCO6hyWOwXS1z1nrC+HHQXVQ3cDM/stefVvnk83Lzd7SX/ZNy0kweUl8kzR2vF/UTURPVfTE0DDCHYpgQW7mwpcAJ8IgPQSTK3N4MBdZdcO3CtYio2ZOmhTm+TF7gEKcpnxDto6a7ZVxVHfaWNNcWCJQFGBhEkZpCjAZRNjbA0oy7qG6OFHNScAZduaH2xRjrcNt60T0a3kzCp9ez33ZUoKiJh8G4hGAN4fsbJU8M3XTYPyWctVu2NveaywoTcCUujAUMFl7jVLKqPL5m/JVSGcubtvqRoy28Vv4fOr2WD/rXKNEtbfwau4jsWi8vuTXBjEk5qJbRwwMwNQJ5+NjH2Tm8UYbzwMH/0P1HeCO72V/5PbAGUUI2SPPO7A616CIEfw+AH5Krr9ht7Xt4MRCR41rYnBJ4++m0bGNOcPa8uRFo4iXl1W4PMvAgIN1yRsqjPw4DfXBGO0dMriLBrE5PJ10zCQgs6grKObXHBvK6CWzAROGy9iNQhIig== 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)(346002)(136003)(366004)(396003)(39850400004)(451199018)(52116002)(2616005)(478600001)(6486002)(83380400001)(6666004)(316002)(54906003)(8676002)(66476007)(66556008)(66946007)(186003)(26005)(6506007)(6512007)(110136005)(1076003)(4326008)(5660300002)(41300700001)(4744005)(8936002)(38350700002)(38100700002)(2906002)(36756003)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rMmbAg56LXeB5ddZj45Z9BeGxnHeiTgKKWRovBvEKavC8JzplA0z8KELHTvn/WDaoBH8i53LLJcafUDD1qJu9nHzSKragrMBXiE07QgJ7Ss+zNvthV768e/Z3JYoCnqPYB/7zIT81/dK1om2vfVZPcSu7u8S4tItu/nDAD7SCpiSIhuxEf1sSo4Wi0VlAD4TC+X/iSZmPtl5OZI8RPqPkkxO9+lrtRQ09uKObHM11h3vBmdRmVThDpXOJ3TnB6BeIoGwbp0DlBuOnz3f/CoExSq5akC/MFZyQimG65SVcDAJfSMj/8e5twXun8TDY6FwvMhNaDbggyQ/+CyuaVnDxgaDHJoGd6+M/gnzl/6D7zUbD9vNvG6UxeLmkWQ3kYlh0S40ppoq8H+Fbf/PytyijXGmD2/UGXnKeSZ18R4/swgSqRhrYIw74Jo0uHzFwLpSw3mw4AYhlY5hv7VU04+2gad5sDlU2olgYCDsdSa9t62l3prIJrH3ZjFLfahjCdlZkBkYYqdDBSwCQlw5FlJFnlVyBQ2wxN2NAC0A0yFNrZCkvXaK0lsECgHCf6/PNVhhi8eAmJga0B4wjV8Ky35NK69tNltC4kjsWRl2JQQDO4JncP3GHb/sJrdxVkVSrpqgqAyB4jJ45atMHXf/Wyv3zc6D8kWdt8BXgT1q2dAVjspuf6RNI/oZI4tcc9SY09vRRw88XK6Kt5qVtosdwKarlA0ZYyjvorlb7iHrPpRWDhIC/n5CKnVx2EDru2BT80Sk8UZppVwObz9isVg9TiOjYiRjT2SN87Jm2P+UiLqJ/PuLqoR5Fe9hhfntC0pUZdv1vZsbiWHLCAdQVdJbYjkb+/UNtK9nusdddw8cfcbDGq+/SpnEWnBwRUDd/PqfjGVhz+eEn1AwJ/8p+0bfa+OLserYsIBx4UvDxkelQJSr+JubuBmgIih5MLRrHKBllN+v7LADCV2lI549VQhIHSMlRMzFE+NMri0BtB5/YWyl7fP2+l7YjCOBHxPxVTZMyFpIbGbVh7XPPa7yQi5Cumt7Ji1HWlR+I2KbW2I6imtMNtauQxtN7UMwW0pX5RisMiw1gQH+pm+P9tdBAbvB85wi8zF4d1xekduCswCUG8spfZoeI3JaDD1VYpR63bjPMGslP2OnSk6wftw+owOvgs1vla/qnADyx8O9CsFXXTYVWRsI2zdSgaTHPwxFZ8jk1WsucMdZIDQeGQHMCBMg6ctLNfdHfaBndHjpjPh69vO3NtxYvBpVu05I4ayrZGCV75m9pJY2XnARiFqrWDR4pTM/jQY3T6/5Zz0hOWUXwqmbNlEKFY93K6PBtKtAySCD77aY2iXojNYI/CvmMoY9fJV7yhcP3+FdKPIdHM/weybMu3lNgq9UL+NCRLNJQovFAwsOh7ndCM0jxXZ/+JHGewT2+dHF+sFnUL7qjq4cL9NX0QEf6mFLEzupUOfQ4z400BwsTrvuZ0MvwxKm7RSKAZHGu9baJC6tfCFF2OESPM8QlJffYsIZuH66fnAYVgFVIi4Yr67Ta8hPazrpshKwbWpMIo+k26iRFY8Ff9ue4UJiyKfjbb7UXeXbRr4JMOyEgT3k X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 716614c1-f5f9-47b2-6225-08db285c26dd X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2023 09:27:25.8920 (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: TqJauQuv7VluhK5Y5zIfoDtdBjyPCuK6eSiLSKq+Eo4XXazUhgWIohgprLlEClG6un0WEJ9V95Nk2oddMMEm9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4012 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?1760787995509363346?= X-GMAIL-MSGID: =?utf-8?q?1760787995509363346?= Use kobject_del_and_put() to simplify code. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" 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 Sun Mar 19 09:26:41 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: 71739 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp651536wrt; Sun, 19 Mar 2023 02:31:35 -0700 (PDT) X-Google-Smtp-Source: AK7set9vfdl22SoMPbGTk3PuGBZKB4e5jxtFB61CaWeBdqlFvDQsd6zwwD18ONpdUyv+tE5t2Co9 X-Received: by 2002:a17:902:f9cf:b0:19c:dedd:2ace with SMTP id kz15-20020a170902f9cf00b0019cdedd2acemr11407972plb.18.1679218295410; Sun, 19 Mar 2023 02:31:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679218295; cv=pass; d=google.com; s=arc-20160816; b=H4xxKGEtkeZ6S9yu8Fn3veAXzcrVwvykv7NNh6WLumMPxbmWx7qInt9AclHuEUuxBb g0YTJuOeTD+lJdNO/16W28sFUNQFe/RPJTDlClJkF+VkDswK90hvlhHuofRZdkIZrDVO i9oFLZXDaE2Fitb7Q1MQngssLnX8nS9yJvgs1mTR6H18fW+8zm/x8pXvAU9fjns+bvTz j1GktxxG1UqFFdWlIs4gmobxpl52GSyeIjuijyLZH+yuTXpGrI174pjSmyEFPExjgxaP 7yG65RwA7EhpXkLZfWcSm1NSmxHJQxOe17LTod/Un6lJDpOSzxwCqlFfbnaYLbnjhEmf HUWQ== 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=WayaedDV/a0VW4u6mHDaeEBAtKbErUi9bs6Ndywk30M=; b=PeBhiz3tLOy+hykJhWzIelCHi7ZGSYQ8/yurnIwrSR6Lf8iQsafPe8Klmjf0xTxU/b 5KEvL7LQzT4LkLWBAosPvWbtgfj+HGHGTTKlVufqaKiJI0qpSQDDTlWIFjv4wCXuSHuN BF+XVGXyDWOEluy1Ymz80YBd/UgTMwbu2Qjiocyywmbqi+Qveq6j9jIjzjPmDOMUuNK+ J7Sl1Iaud0UqPRNvtAwCcrTuF+qHAdRBUslKpBfsCIXK2RPqir8nP5qu4aVJL2vOB29m JU7/C7fPKhLLVVqk26X5g426QUCnTNfG0VSCd0biurNTv6HS7ER3B9yhi2PtOIXmTW9p JzNQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=qZHbrM6M; 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 g3-20020a170902934300b0019a9834bb23si7025138plp.192.2023.03.19.02.31.20; Sun, 19 Mar 2023 02:31:35 -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=qZHbrM6M; 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 S230225AbjCSJ2R (ORCPT + 99 others); Sun, 19 Mar 2023 05:28:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229959AbjCSJ1l (ORCPT ); Sun, 19 Mar 2023 05:27:41 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2105.outbound.protection.outlook.com [40.107.117.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE7D71A48A; Sun, 19 Mar 2023 02:27:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ccw6RGF0uxbN9wejF3TV2j3VLjMELcQH5HkLawsn1Qqq/SoqjFcnpg62yMerqukBKg93pSrLCJ52BnWY8tSAiOaD6Dl8ytVkl9ulI2zLI+bnRaUYoPPB+28JVGprwIoHo0lWLH5qgZ6ISghrObjossKNDc+d32+vzDFEAzrhk+7uqKFW4QA3Yv97gvU9Xo+vLgAmNkuWtz5NGWIKhhPsHa0HHedXRWqrRUhZl2Em30unzxGFa9eBmN3QUb3Gunw9AqXeL4AdlzcqzGnrtnwnVbHPUhHi2493UZoAPx4DJENtZL4PqS20Lh1pXAzFhpHNQe8tIzI5VOM+Wy3QrCE6iw== 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=WayaedDV/a0VW4u6mHDaeEBAtKbErUi9bs6Ndywk30M=; b=lk/aARJfKX27iDPgz3QWQuCnuE5004PyMiXkrIfVFwC7+sYxLDYVa1ZzNf+pzurkQCNypAuZbtFNDo0B/ub53SgGKFvyUILKZXaKQglw9C3TCZMOTT2YAd0rgdSu5GNtNMD8vA4vaDGXF730wlnBBUD0eBad77yCE/ZOz9QVJq7WDjyWOpKwMVtJtM9JVbHW4RVg3JRu9EdwdAh2eZiOjqwlGvN7IQTvcortOhTywLzxHu8FjwkQ66Zr3nmGNCGHWlkWzGc0kS1p1WGxCecrbRQtHMl67CzpaZ1ESXfrUUahMTMcL7KxXDxVthJzbq7LvLPSaKRzzxcBUnfP/DhAhw== 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=WayaedDV/a0VW4u6mHDaeEBAtKbErUi9bs6Ndywk30M=; b=qZHbrM6MC4YkPV/7OmL/AH5SunaCkm92WJvCbppx3BV2kIJDFZXD5UTuBSJSlzebklcSle+h+3iOBOMGOaIj1gk2tGHjAQp1VStrgD76cCNQ52mLJLuO8TRFiNyXqqxjzaSiUloY8ZjF2RjYcUFgggD+z9GEckfJxw0oCstsexNdLD2sHlLFTNtVRM9XYHMEqktHD9a2bcNirBdBVHUnJcBSVKZ7QxI1hTXUNwDmz80dEW/UrgmaIZOlVg2aEc0l4M000srFoeFkIu7vKnUNPlc7+4RG9r+sh/VhnBVtkqXchSjCAuyThP7plvHuHZQB1u7ujvbACR9LXTym9InJCw== 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 SI2PR06MB4012.apcprd06.prod.outlook.com (2603:1096:4:f9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Sun, 19 Mar 2023 09:27:28 +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; Sun, 19 Mar 2023 09:27:28 +0000 From: Yangtao Li To: Ryusuke Konishi Cc: Yangtao Li , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-nilfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2, RESEND 10/10] nilfs2: convert to kobject_del_and_put() Date: Sun, 19 Mar 2023 17:26:41 +0800 Message-Id: <20230319092641.41917-10-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230319092641.41917-1-frank.li@vivo.com> References: <20230319092641.41917-1-frank.li@vivo.com> X-ClientProxiedBy: SG2PR01CA0137.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::17) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SI2PR06MB4012:EE_ X-MS-Office365-Filtering-Correlation-Id: f4c36f81-8d23-4d9c-eace-08db285c2828 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OPm+CE1yA+rUlks5zQOuJyGghzCNqQzo5mNHzRnnqPEWJgGULcRkG6JK1BHHEYHF+zQiF+fQUevh4eaJIoIVG8WehFA8Iaxn0emWZ3VCk1vzpd+K5a3zDIFVOE/epDvY94QXiQc+HKfc59AKqsD61dpNTyEhNJ1dNG9+watc4+4hHta25vfcUwY+CDKLAMbNLv/ZtNLmpxLJQTINCkca2MuGgTcc8V7k5AL1Hmt11akME34EKizZFv8TXCL9UMutRADlvymBQbjUzCaehv2deLy6PvGmhxoCMAoh1bXbhs0jsMDxMRZYi3VQFYWyPECzgG9EPz0E+1LpYl3EDs31jLiKIQGuG0JykhbSusEKAMQUfuUAMDBrMehAuFhk4OLN6h8dXYMLlamgGwLw2NozDXQoPmMh16KxbpQOinXPtmNGVZaaOoVIdAfCeh8vTu4pNNH/W5nb+gGqKLoSeG4ex7DN8gLKeT2h0rZAUDjE76+xWjwm4UGwfk05hLemP4+B76+Ka6ZWLG2oiiNHzw1eWBrH9xL0LS/2C0Wi0QVw+rbpJxrU7o2UrUvPkhVfGToTYvX8X5hutDXRu/8nTEQhQzMgghSl5pIPrHXAFVUAc+kQ/UnEo5/M4cQtj5vywJaupR/MzwZ2bsR80wmPGM0NIFwDzs5+SsYEidSCDn3DC0mEBjKU0VH8EMiY33jaktG/scXyjJn/nh5wxGo/fM/VcQ== 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)(346002)(136003)(366004)(396003)(39850400004)(451199018)(52116002)(2616005)(478600001)(6486002)(83380400001)(6666004)(316002)(54906003)(8676002)(66476007)(66556008)(66946007)(186003)(26005)(6506007)(6512007)(1076003)(4326008)(6916009)(5660300002)(41300700001)(4744005)(8936002)(38350700002)(38100700002)(2906002)(36756003)(86362001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kDuZT7jHrtsJoWzE3R4FbGm3SFWkh2Kvc5tddyg+EYu3P5dsCPAOqr+AESpfqd2RIx28S9glt1+QvMdnjkn3AOTrTDYeCGOQj88/U967FBFkO/t2jRrfDeC1Q4zf9JFUZRj/lYCkfLHtBbXVCQ3kJMLdxZC/JnNC6ItajrkPDLJHzpcU1CDfTqAstseaMhjAu/YUHJsnQA6ZEdoiHk/MaHmxVLaDdXOk/4QgvbKL/tzDWPOgZS3olJB0k62dDrBM7BMqyHMC5IdkKm05CcS8W1ELpNqaAf4fuqdPloTo/tyX8bfF3QrVOczgM8jq28vstKP2En0EiBU28KDYfTcHkam9YuatNCEhUYXZiPREFkbAgBEDZJfHGc8iXMPyu386fPLkmmurG+PEboHqMOgCDx6+pOV2GbFgdpwEKQ3R3hWv5M8v70PYDADmsE1p/qatdLYqiz7BFkKLcIXAOxuEw89m4dHgWssmUrYdo68abcWo2/GBTCCDYC5Jqotm6OnWetLID+fheqWbfesM4ASV1mxHLyT1Jg0y5Y1jxS4oz9bVnDyj4+KwIDxoanJGl8u64MJ3CHQ/zLeNwWyV4dFjzn7ofgwbhkzk4SyrLhuadSBGkqGZtzQiJEVSMTuA31PcMYzlvoRX8XpK+gIr07cYcvPSpB3pfKXPwFESw0wsf3xjZoVnarAmrO+pAcHDhDSLHUjVx7mFPf/zqfkNcWDux6yRshTXHuyCct33BGeBYGGdh6p5/oH9DtItdJUo9ZbvHs9PxlspWq3AuejNpNiGr4Ps6kij18GF+BFHaagzkKquNrZ4E7z+bAv31bfsqx9tQERRPdZXJlj1o3krL+F0xE45VbX/uCBgkT8quF35FHr9c4c7OU7Ao8j50/+oOWi3gevTpavxs8vu+kJJQyHUTeRSlyBwrctkiNB2mTuokLemnn/pSmDbQTm5/SNUSoJGABCoFFqJTFAHVCv0FsqFXBmbIqsRvZsuZrcz98LRE7zgKkaf4QUabhEBWMK7C5Lc2VVYd3/yJx08Mos+O21+eaA3G+LmuQdCgvzYcP9hsA35PoKwSTKU7AoAhOXNyUpvi6X3PdCeNDmC3HwyjBZkHrXe5/zarrpOiwZpQEf2Jq8HjOGkF6n/dXYQTCtPb6Tjyz9RNs7isEaF3cGxs/FOFF5BunSZC0bDGGrKOuaps8Cfu2G0+atiTJqH1I6WTrhabdUaR0grmf4Om00aAjY3WUp6PazaVtINYfc2zVUzrnSRHU5qVhMVfiw4dQP778/t9LpztSNRBQOXd4g1JWESlw4aqcGOAGcAEOdJyCqKr58DOZlAIomf4NsBkRHFH5bE5eaBBYN0ar1ZZ6LYE0aIAW4OztjnXjlIi+sJO7L3zETYRb8zdx/yli1zSpvD2gyCudzNfQqLlsgySsICp9zhWColmcAkslb8SeDM4gWcA/oh0rEhjTFJBU4H5IQtkUc9kD0cwNMi1mr6mydCo3pJ8bNkl+NI9bXFsd/8s1YgL1+70ifYiiM9TnvfxJQ9z0Ff4C3xiqXFYIVUgp8zoqZUR/bKOxzWi0H5+Gt2AylQRU8xud7eo7/CQsjkyvD0uzxl X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: f4c36f81-8d23-4d9c-eace-08db285c2828 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2023 09:27:28.0471 (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: ay5qR4Lten7nu/Fk8tdWxNOUUyHnx2hMHWwUzXLTAp10urSw7jGJVou84gShBYM86CmeO2FUxAOhNAsXB5O+fA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB4012 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?1760788003617989163?= X-GMAIL-MSGID: =?utf-8?q?1760788003617989163?= Use kobject_del_and_put() to simplify code. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" 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); }