From patchwork Sun Mar 19 08:41:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 71731 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp641246wrt; Sun, 19 Mar 2023 01:51:31 -0700 (PDT) X-Google-Smtp-Source: AK7set8WUrAa+vJj/94iqSvW2wFictaB+OzomOHq6AV8YcHPkaUFstc5D3klLFddGtZC6gsN+I0C X-Received: by 2002:a05:6a20:6982:b0:d4:5ae6:fbaf with SMTP id t2-20020a056a20698200b000d45ae6fbafmr19965006pzk.60.1679215891015; Sun, 19 Mar 2023 01:51:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679215890; cv=pass; d=google.com; s=arc-20160816; b=ZqLYf6KQ5I79qk1a8HqR476QGlXoAx9fOxE64ca8RnkxJ1YXwW1uC2SQ44ZKAg1cUZ 7CChv0tXMeTQIcoCH9W8ZwmWBSmNEatd2UJ01RRAVj/UFxiqjqupXfZliKFF4xL0PuSI xOGDtGTngm7btYx6YdnNgxPsy59XweFlAbIUAvnKI3vCJfHYtUnxHu4XOEfp7FvTBHly rjKsBvE6ZJrHIf2CFz30xf5Dj34qQveRrDWsdZefrpKpt91DKlGj8ArDiqoeMnRMwrwn rjoOeWhid5D25f9Gc22lvItlJZdIcz5M03zCOQ/S9C+3GUMk40YTN7kSIZ9dQ663NVWm 3ncQ== 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=6BZayVBRrs48yzFLcLJlf01NdTuhulQfafIL7TCrlZg=; b=AnxYUZpnUZYkxwdEns+sH4rcfTTMVlUXVaKx5YWyVKvOlBZwV2Ieqs7Rk06GdeDJlj /fdkXAAwEFtxrt6wBAUfpZ/hZGdT908PkIvRR6E0VOkbIhIlldR2Yr9ZdRfTzCjTyQm8 dDf3GfZcBsr9wFK00CAhdEzfnoYqoCCIkmiZki2YHbNIshxmVBze0tCaG0TpRaJXxF3K sEuzmHaVn7MNjaPo2syK9GWC6EhARQfMLZdEXZcQ+QrLQwtWkZ6FdwcwENGJKrbtOubl AiqRkwQW0ED+OyRJyjsWrhEjZWFxTiXrMvaY/BwUAnlO2Ubt+mir4vN034WquoTtqjKQ GDaQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=J6fCEEhR; 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 bd12-20020a656e0c000000b004fab1ea0112si7700538pgb.528.2023.03.19.01.51.19; Sun, 19 Mar 2023 01:51:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=J6fCEEhR; 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 S229927AbjCSIl4 (ORCPT + 99 others); Sun, 19 Mar 2023 04:41:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbjCSIlx (ORCPT ); Sun, 19 Mar 2023 04:41:53 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2098.outbound.protection.outlook.com [40.107.117.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7253E1042C for ; Sun, 19 Mar 2023 01:41:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DU2H/x/pK1tDKAxdarh5x9R1u2kWGXHPMwwaDmtG19Cet6vbduExN1Y+W+1oQDC6oKpZDLouwctVkb98FF5jFA2QpEAJeUG4XaBhaKfP7qoNKhs7MCqxiU5RxRBmWheHVdsw8HZO1AlRzYHhzG00Av/a5MJDcayhf42jE8yVWZKSfTL1m1C/uWd53DhYBJtvsPdcjhNNkH3CJ5Nm1jDVXmr3HVlVsYFNTCfA7pl7wwwdHqa13sqwNt50JGxZElu0HCw8BqHQlwgihzFPCLLGgGZBhpqzBgxbOAGrmCTS38rtCExBeuYDARa/zek3xbNYngtSraT8fv745aQSBTaAZw== 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=6BZayVBRrs48yzFLcLJlf01NdTuhulQfafIL7TCrlZg=; b=hyMI/xlg4ZupwwWff1vUdO7cMxYhj0HJQ1v0Nr0WK5xPmN2eRp/gO2q+Y/M63Li82gDNYKAXM4Chpo7R0GEoZHnUlzugk5IZdxMaZ8KKFBrOcIzfjksa//qXki4QWU7mNnJ/W30wVsXVxFTlcffj29OZ8SgaMjpNds45nTJVnlOHTRVZsdZkhL8oX+ps3LAccInaeMhHceh2UVUXuqFG+R/hHcal8eklOCL/bY+jdhCvekb+5UPCKwC2WEGQ60HZ50ynZusOlWkEiJ4WwD+rQKtQ+q1jL3eTVcGrMkxC8Zp7tGAPCDTRwPsGTQTJrGZxbr6YI7FI/F8KKPLFTZ7Eog== 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=6BZayVBRrs48yzFLcLJlf01NdTuhulQfafIL7TCrlZg=; b=J6fCEEhREDEm6yx4auOrL5Oi2pxqYzHPeqIonFpKyYdRcn+fMrX0tTBWDcqZcGSQKF1J2u4v5PhvRJ9EAuxRiAcfjYauljTBgIMOf5ELDOJLLay18wEVvvPBKkTDC6Q8wucJTdgZy2vfRYxCIVs5c3ySiadKp0iNOsAzIMTbkDvHsugUvvWCvD7ucyHooybN4//hg7P2sXZv5xB74HdgykpYaGop710o1yvu0Kof0OP39JRpA9rHEGGcNBZqe470g2P08pDAYDxWMARvUTqhwcrgzzhJDaijdcxNcfXZelDkIhwOeOWilDGScsnbCCdDiki10E25SQR665GtHtNx5A== 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 SEYPR06MB5350.apcprd06.prod.outlook.com (2603:1096:101:6a::7) 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 08:41:46 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869%9]) with mapi id 15.20.6178.037; Sun, 19 Mar 2023 08:41:45 +0000 From: Yangtao Li To: Greg Kroah-Hartman , "Rafael J. Wysocki" Cc: Yangtao Li , linux-kernel@vger.kernel.org Subject: [PATCH v2 01/10] kobject: introduce kobject_del_and_put() Date: Sun, 19 Mar 2023 16:41:24 +0800 Message-Id: <20230319084134.11804-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SI2PR02CA0033.apcprd02.prod.outlook.com (2603:1096:4:195::20) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEYPR06MB5350:EE_ X-MS-Office365-Filtering-Correlation-Id: 4784f520-a2fb-4f90-2748-08db2855c5b2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yT681Q1ECEdddz2imbxelwRiCzmu4liK0+RzRVzRt4Yjzx+CWL+C+4fRBtGGryYDGL7y7Xlcak0o9xNHd5yE+PGqy2MfIrffdKNiZXbKuUyKpR4r18ejJHl1NrzPaoUOpdW37xF0mMlfWKLFwziONV+PBeQEQW7UVX2YxGISmqP58yhdWsQnt6u92W006EglGUlmbgKlqKYpVgLecJRS0Av66n0tQEMWCEyGlKqjUqOW1iPAWhuXQiDgQQmj149X4BdrQvVVosnaOCVg38/NZkip2ce+buG1ElIbcJTlHj2Ssl1oboH3notb+FThb00CWhpEsVB+0DdvmDcLh/vzyzFR1BrO7WUHXst/g0VPhvDakgXM0zahJR9npqVbrR9d3aG5hwfgYjtxfTGZSVem6w+Im2Bq6Ckd0arnMS4oM/v5ZT5Zza5GgA6ygds5lL7Yy2qnPdngrKxDhXPCE8BaUUvC6fdtZ0YoKVJE2MBskJrp/bOXeRJEwraD2YkcLxeHNwt7wcUteIaGgfksIj7BOsqmduJ7hbdRnc/zSU57/2bro65qkvLXXwAV7NfQzhgEuOzFbUt1RoAklWnK75qKYH6HPRaSjaAVCy0aXomaejESRMcNOGSSZ43dw1V7eC2uiAONN+VpxFHUpXZYL1P254ZPk8a29QfYKjq1L+bbCfDsqBNqZqxd8jTKw4hZSMjKQiKqyGRf4PffhQrnkfB6jQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(366004)(376002)(346002)(396003)(136003)(451199018)(86362001)(36756003)(52116002)(83380400001)(316002)(8676002)(4326008)(66476007)(66946007)(66556008)(110136005)(478600001)(186003)(26005)(1076003)(6512007)(6506007)(2616005)(6486002)(6666004)(38100700002)(38350700002)(8936002)(5660300002)(41300700001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: foQBbTFJkWNU48/cfYpBch9nq5V0wsvrLbBos0a5hIAwKmqFeSCRYJrAS36kO1BDR4MolRoZ+I1o5MV0sRyTFqmgGYabM90MhSzFeyWckabqciLAzIjxYi4syS92sX433Qj6wbi3ewp7RVNAreywkQcqRJec3/XssVIH4RiIs0yfc3lA8X+YlfGNCoCBdrvqMyhzA4VIiZl6I+tHG4lZdvRT8Izc3Xy0S/4YmLiHsjewmWWC6HEWXrjvHLVB3OWooWMCrz3BnyeA2c5HnaguNa1jeGc8dA/9KOhsf/IFEpE20dmVaMzgpCwhuvTg7TrYXaAfmvp0uQcKv1BqAs2z+nK4HeME2cWOlQCCIEB7K8M5mgXFovU+BBESiNIwhYPQrbPu+ZfYqFdKXTiKFCK9yFHuV2XVTm7hIYI5rNwI9Kwxpc2FsO2smp1GVD5NgtL6Jq+Hkn3zdoz04WXE+71dNLBwXamaQkHBQJV+WKdWuTiEVMgxk2cNk9iSd494V7SMHXXMTNqiW4aoD8kPZ03H4DfQW6Mdgkzs7oR59Hhar1sozMehxy804Wo9k+cD/Gm0G9HQ3aIS+5phwuzUS2ZTKGf9aT9q7AMIQCBT69/oeePHxI5LNJVoO5sK7JxG51vNSwCdBGrUEXcZBcT9BBoxwl9VsNYMJsqV1h+4zE8aTcQjWzj76j+3AerRztsGzUo+VnJuifB1ebKtAwLUO+cJ/QQPeyamj13rM9KYvElPMIY+++i1decJl+NZLKTfPj5e02AODCGvjdL5P1nMyyBBpy18J/zNWlPHejNPPyg1Yt3Pzvk4sawiGU0pEqzmJJYcZVbZFmp2E5N/0sGQkIaXFo1dNjI0Y+0AmueZmp+jroCAjBrAkdQZvrzeGIyLBayobozHDZhFT0De5BKcrvAFWFHd/VE4dl7L4ptS478ayJjGK6khEp7AxEKTaoFVept9L/51LDvy1F4bwKFBCb26UHyJsstGZJboGVTC7mNL+HGgVnCJ+T7Z28rvCTRjrTh99Ap2VFkAm3y7httXerR7+6tgT9G37zGhFRCPztYODNnkzONH4hq43hCh4i8RkomU3lQ+W8F3Xa9s/CcMqbwA98boXxXbRbb6aRIajXkg4jGN2zXQ7GEN0gzf2FbXkSGNSlm5MX+lAPaDDD6lj7rNpOv8/dZ3GCCeS3ZNXwJxdKOchGzoy9lLyVLw7NyWcAftP6YF64vbdzI6DSfAh5WW1bNcIBKY//OjL3268qvqEbNiY3jJKmeBioO1W9q57BalnC57F/wbUHX4Ums2eRgMZsbceYrYwBW/uXWKnzqCxb5lcooRkbdbSC29m/pmLuC//II6NW83CTJl/CKvOymOCmLmG6wReLHJY7CaQ/kAhkRfm3ygI1trE8cQZ9tcrh2Z1Vg1R5576klOkHftPG6sb8Q7T7a1SSlzoWhSUyjwLt+VfI+hzZzeV9OfowPRU+13p6ulhXNv0092xa+kEG1lAjgPI4o+KQy4zNXWdW/+Hm7U2NlshQG6kjpO+dDX5FgNmLtxd3YEGBUPcpBwFARlQ5eRvPUnLuRQyHzB31xQu4WzIh23u1bd4Nx7tycCQHs0 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4784f520-a2fb-4f90-2748-08db2855c5b2 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2023 08:41:45.8425 (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: Rsd9711XFmkUTxfOXx7JsI2q8O0CdP2zqVv3uF0cGo62YwgBuLCS30wLCbKAnbG4wQlPbMrAlFrB2/H/Oal3Gw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5350 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?1760785482143863532?= X-GMAIL-MSGID: =?utf-8?q?1760785482143863532?= 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 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 08:41:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 71723 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp639293wrt; Sun, 19 Mar 2023 01:42:56 -0700 (PDT) X-Google-Smtp-Source: AK7set99mODlj2gOoWOFsxG4Hl43eVWDjmDWF0lkTFb3zydgnz5JiYBWAdnTDjX9NTngzGqR57os X-Received: by 2002:a17:903:6ce:b0:1a0:57dd:b340 with SMTP id kj14-20020a17090306ce00b001a057ddb340mr10509227plb.64.1679215375946; Sun, 19 Mar 2023 01:42:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679215375; cv=pass; d=google.com; s=arc-20160816; b=xeDeD/zmfkEYvKVUZIChMbQXBE/iwppntvbhj1+qNlZ7YDDGoIX++MKREaVjdU4H+7 iupbr/0DUkG5Dx3YNtOmUJxzUdWuINcLjH1rukq6F8Hdg2arGzjHjzxaLmyKNri5ZCCt i89BWSvj2H9KSixh9xpbXaGynMTi/H32VYYXybwpssCinMXeBGf+i9Tww+jy84b9JT1f T8gdUXJUBJAPpiDI+jo4mkarw93L9IHMrfg5gTZKZICGFrNUhSx/GjMETW9DjYuGDGRH ugV3YGpTLzKQ8IdXGWbRVPIk2Dx5GlYd3l+nsg+UkNvVHJAMiOsFFBjGJ999RCMKcMy6 zEWA== 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=I6Q21IYBQjn5QhcxshRu0Kue11o9uiBgYrm7Mp0AiXE=; b=J0a0frI2m4NHg08Ty3hI7MrsVJdJQV76W/iAFSDR1Q3hDSuKXxW7TFvevR0API/fZE YPlZU4FBn6xUEziSw+BKM4tCpN4RPrQPhJvnnZ0J0yUMr/glgHw7t4++6SEVvuoxgG9v SQ2Q6eCgQJ3T9NFzNeboW3I5OGEPMZH4yndFAG+AtpAX3aVihwueG0vdukFLKz7yu4fW 2iZJn8O52AKOnL9JiVBepgNHSZ8zAveInNJFKumsNfOT6qNqMDz3BrCwTq6I7+e61lz1 w3SPoylBm8NeUggxa0vzxWDdRcyoW/w1MoILZ/Wgg/eEAfUF6Dztf3yibG6Yk8C6Fu7K IkSg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=lBxME6GX; 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 h7-20020a632107000000b0050be2ca268csi6749830pgh.762.2023.03.19.01.42.40; Sun, 19 Mar 2023 01:42:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=lBxME6GX; 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 S230007AbjCSIl7 (ORCPT + 99 others); Sun, 19 Mar 2023 04:41:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbjCSIly (ORCPT ); Sun, 19 Mar 2023 04:41:54 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2098.outbound.protection.outlook.com [40.107.117.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8282F166F3 for ; Sun, 19 Mar 2023 01:41:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DineZIK2HUHWyVPHGkkOzvrnyMsQqGr1392+YPJf/zDFVDEjDYCJWgG7OttZPjt+/qfXmFCMjp/32pPwu6jcukO+4kYYry4HF0x0HcgUrbAscHOnqNVSgw7C47lDmEykZqWqOn3AMQVRsDJJ7woTcCcNtacFinfQhnB5lEaXyUPG/KDsDsKeilBv6mbZhjWEFZIlPLkDdMBhuo6YdSl5Qtpu38Pqoh6bxQpkohOFwVZNkQCr2HqpZIhD3C4qRYgjI2OjJUAYaZbRhYM368N/LWYQUdYZFs8SG3XA9JgOywn63X0VarSqIXIoZ02mIhz2QBmrVkObIhR4NdWSf3UAJA== 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=I6Q21IYBQjn5QhcxshRu0Kue11o9uiBgYrm7Mp0AiXE=; b=jQIPhfOGIvX2ri6MvikD/NnIe2jS6sC2FZbbndYGLWzQUjalD35c7RXTFf+F9Iq9abePw3uexl0nt5dzJuton+HQqHoP2Vdiqq5/3+5Zo3yAcrmKybVMFuaHtPzSH70CwID+yEefB4t0Pj1eOrsnxSiKkHbhzFCibp1gyfgXiZb9ud4ZFh5GmmX8rolZznzp5Auq0T3wzBGnTEA/pFmFCT0ly8hcniCNyD5y4Nq+Nf5y0gnmNLeyOWnRgwfgUcqzf2iJLe+HaHoITqeoVwSeQ12tbpjvEBcnXFhM0126WcGZV8PZYDggtYt11VrVR7DsK1p7CFpcibN1IpLfdE7PPA== 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=I6Q21IYBQjn5QhcxshRu0Kue11o9uiBgYrm7Mp0AiXE=; b=lBxME6GXPRPM6CH0cPBWt7OOZTVAJ9wHy3ZCtj4EsFF18+JhP2mBsJ7vofvBWXycD1orJSP1cB8BuEd+3oB49941u8DYNitgFORwwarwI3QyCPRe5/qqs6qdVnCRfTRpbhKz6UaVQczflgYglqSAJ7Vp/jMwSaiqUZialzI0G+/FhajF1hiJck/xW5gwUzgvH3EOHH+iM+StodZUhoweckPUaS9RY4hIceq85pMevkuE0IgF77fzE3dyFo7Swjs1Nl4gL4C8Wb7ad5M0caUtr5jA1Dj6BNk7CGxzXktq9NcNR+ViroAkuxOl+Hnl17yGNyUJktWbYRbsvMwoEFYuqA== 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 SEYPR06MB5350.apcprd06.prod.outlook.com (2603:1096:101:6a::7) 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 08:41:50 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869%9]) with mapi id 15.20.6178.037; Sun, 19 Mar 2023 08:41:50 +0000 From: Yangtao Li To: Jaegeuk Kim , Chao Yu Cc: Yangtao Li , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH v2 02/10] f2fs: convert to kobject_del_and_put() Date: Sun, 19 Mar 2023 16:41:25 +0800 Message-Id: <20230319084134.11804-2-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230319084134.11804-1-frank.li@vivo.com> References: <20230319084134.11804-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR02CA0033.apcprd02.prod.outlook.com (2603:1096:4:195::20) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEYPR06MB5350:EE_ X-MS-Office365-Filtering-Correlation-Id: eaef1371-4f45-44d4-b998-08db2855c85e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JW8U3pOOGeQJtN3cmjQuRvYDop+NKVoeJZkD61iqLmLywgBKcxZwRi8x9uTjgMbGhVHagZgdZAK7CJYPhR0/w9/DYc5xPZ4iVAOcW7as4wST59O3RCmk/x+Pbxf4apSJdR9gZPKBNzDlqc5gcpI7SzYYTPkyVhLIA6aUgfMXBfXQX74TjZaTZhfUgDcbpQmILKWu1zhCwWQmJIRjoSMdVABF4AhhcL0X/FowW95oi0RBUdV/mO2c8lJJbyTwlz3bbarOO9TPUEwW3Swk+1x4ler+0MX5wE20uMVzM31Ir+mP3y/BeV/hwhH6uSucvnlqxlAW2e2VRAyBg+vQQdsdn91w2tc0guZhHxDWDycuap4bA45wPJkExcAVmHmlN7HtrYx0NJy1Y/Oyh3HzAPjqX3aiak20w95vmpDBRbAnpelojTQwpGuPmcRUs/D3OxiADjfyYkKqYQDVgc4SaSi4aTe/4pXCUfyJmskeCRFrje+tYztQPiKnwvoo1cqqU0etvHMMTk+5zGLLFZ96sJJR+PdlmyOjPQ9N7V+aHmHiSMswlPue4ua12dsWyYNNeU+kEAaj/zePLOchPgCFdA1jpQxnuJMtaCGd2fu2c/muMChRNBeih2tuypAozYW91/gWyb6W2+uW+4R8IGQ8t+mQhfxPhBQbuADmpNCW/WAvcei5jIDQzbPuA157HEaM0hjkJgJbvfsGkSZUBQ5pRqeyoA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(366004)(376002)(346002)(396003)(136003)(451199018)(86362001)(36756003)(52116002)(83380400001)(316002)(8676002)(4326008)(66476007)(66946007)(66556008)(110136005)(478600001)(186003)(26005)(1076003)(6512007)(6506007)(2616005)(6486002)(6666004)(38100700002)(38350700002)(8936002)(4744005)(5660300002)(41300700001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qkez6sNTJJ3Zt6MpwXWhW92ABShVUgNxnaauqpsGF7rU9R9Qp873H7OGJjz38aYvJbXx3Ct6MP1eOkJVy5mrzEorpOAQd43PsLQDpSCmhAFxRnL2OWj8+uJI1FYuSIEyQ+aHPE5vPsm+2OJEj0Y/ex066LYpIjHVyA+UbnXN2kjIuFIZaEuZq8wUE65cwUgNc9pfeJ6lx6GyCeSGqGMGsPEUPUiDZQTrwn/i0aiZ6mnWbON+KzzqY0cPGXHOFQlVG4yr5WGG7bBWF4AB+FCRDriugJhe2pPykVs7RxM0mJK74f9B2OQ6v1/qtiJ/p0B3VDi00twSHGm6XkHmEPBT4t/9IF71JEFLuuzq6CqQZREyOAJuWJMNoRX105OC5r57IBJOhlYBJRK751rBUWbqkkEfd5eJtCR1pU6BwvrTMkBiCcAVTk/eQvYqabiS2oA43ZKWyYz2pcfE8Mjd1tG2OOiwqXxpib5StCDpieW9a6cw1jj0GUlLvFXZxToN6qMRw1svEQ2334mlcneDS5N6IrYkOFXWGOwilTXwXF7JDbIcyUCtBj8mAeQ1OYVwDKZznbW/A/IZKi8kfIYFTkkkbR6BWAI05eFWsqbX58ICs3n5J+n1wwP57oOGTR5OveUw0LTWcnktuxIfahAnBe0FNLgfSAKKYKzLau80fj3QqZMTbm133T4ez7kDQazaMMIXI20q8emGmuZycoTDC3K8z1bGoZWTVYRAM5UFUVbNR2Ov6zgqL75h82G55NfhPBy3S+BPuOiZvpxZXkEkaE4ZyH5c+B886DQGGr7j6NgdiewBgTJQBWSw23/oPnHzEsxnOhQSkCqN14waoWml+BM0L58C3ZpkZH9w9OSSlos8mKPxZY8DewyZZkZUGGqs5jZvegno2Kfu1ToWrfk7p6n6DKM0KClG+BYPa2ypS323POilPztHkcv8zamdeuqYETJs5CbSqsSOwPeXyl98m4t+ADD0HvhurnMDtRfX3Q9fa05Kr+gs7Z94JQUeNskSpXQbQ24nO5/cloqpdlhgOf32hCgGi49srYKEbA3XnpC0ZWHS1Sbcm35b5mcDlO61eOYdYTscqrRCz5apLptC+vmBx3ZvZaTCHjFVkjEcq8vdyTZPXnCQb2dPKWzE5gDmoB8Mju2y9mlESs3u01OYGs5Bx3KpAQsD733xyXE8QbPCT4ZbpqiD7PyXnmSjICH2mQoolh1kAndXwV+eKcViIqnbF4/pd+zzNIZDFQ52dgwmmg6FEppcpR89TJQtOdkcACbll7uR0nub3dr8HQrnN+/uVbI+sFchY4WjWPv0cX8RUwy7CsTmdmIlI8N0s2LzMHkeG7saJzLxQ/gHprKymq98siKx3JpKB9bCeR29fl9l8lppivj0VFVDCF8Ctv3CXrNLF4gmwQoKK6bIIQSR9aE38mecA1iFTt09rTknJwUbiEAIbTcMZH+sZ2kIdBo3DV7KwFgj46oRoulxzIHgJHcaep1IFRAjoTz60gKN0JLuXucr0SKKI3yT1VxOx1iEKQEm4z80fMOy8c7tdxYYjyVn6XHTs6xqLni0+GhD0eZyWKCreHEyomYaR5Hygwf48uuT X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: eaef1371-4f45-44d4-b998-08db2855c85e X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2023 08:41:50.3601 (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: vB7CjvYfHxGiZaQuiAqf4XQRUKtEfnndVYNdhTK3ucsjRnPKRFu/1qTpv0ydHUMC7Eym8b7vMpn6MmQ2v0xQpA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5350 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?1760784942447800884?= X-GMAIL-MSGID: =?utf-8?q?1760784942447800884?= Use kobject_del_and_put() to simplify code. 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 08:41:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 71727 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp640999wrt; Sun, 19 Mar 2023 01:50:26 -0700 (PDT) X-Google-Smtp-Source: AK7set8grOyXDlOLO9YmDtNB68SPtmwPcmiunO2uWE/+5J0DIUFemD4cGuuWleih9XjIRVAL+zun X-Received: by 2002:a17:90a:e7c3:b0:23f:4dfd:4fc1 with SMTP id kb3-20020a17090ae7c300b0023f4dfd4fc1mr10182609pjb.43.1679215825828; Sun, 19 Mar 2023 01:50:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679215825; cv=pass; d=google.com; s=arc-20160816; b=0N0jgwtJ46dDXa0tjeeEzkSjOSgrsEJvmZ/M+9qyBS2Kogfzx5efCGl5iZYMMdavI8 z1OkgXl6ecrynn7uRKcASp9Why/XCXraYjjWn8AwXaJiomrqRnTAeZc/R4mSAF3Kl2BN lYLJ6wLNVou2zX7c7QSFOCrmcHwKNO748v88/MNKTuATJXJqmfd9dDtWAdj1Ypf1f10X M+9fDnvnY4qejBEYhLfjYXOYnVrCDGzPuPIpqrkWz4ZSbXb6L2CQzz5Q6DILGkuPkyUD dog9EruqWpFPESx2ZoJC0o8+fZFuQ/NHZDELQDgEPGj06ke/f8VaIvVAzRQ4xQZt+kT0 +khQ== 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=LhVLGznBksksos1LREE3is/hDxk3CkKEditIjWVYL0I=; b=TJGwP72WW/w0sPwm+z4q67QY9RUIwTvliyAGcTS3/icILFYtgXRzRW+UIOOwre3ieq +myET5LYemn06gSx6rWvS/bC5DZlk8sxW3ovBKV1Hae5Yj5vOyUTMkCccDLE6VR9lpiJ 9KiM5L14zCWzdeKNqP+xXTFfbLUYWYqcbu4LLfS9PhOHRqHD8XqT+5ZqMuqsec0/OWKy o9qNF9/GjTv3HpgJj0tTo2l06t70vZnThD1GzUhycDO9mypm2DGhhVutTR38frHRS7nS kM9PMQO4XB9Ypb3if0rrr/+TeCqhrHjS23mSCIvYNN4/rMaIww2bsh9nGP+r+YtIJq0t 1ZoQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=qBqmJJTz; 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 bd12-20020a656e0c000000b004fab1ea0112si7700538pgb.528.2023.03.19.01.50.11; Sun, 19 Mar 2023 01:50:25 -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=qBqmJJTz; 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 S230173AbjCSImC (ORCPT + 99 others); Sun, 19 Mar 2023 04:42:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229861AbjCSIlz (ORCPT ); Sun, 19 Mar 2023 04:41:55 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2098.outbound.protection.outlook.com [40.107.117.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E15F1042C for ; Sun, 19 Mar 2023 01:41:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZnyxAq2WupcXNIRMx+xbO6jBYXoSH6RlxYWjc2Zg1D1HGPAKdvF2etjfEqYc5NS2qAwP/BfHiT9X6C/7IKn/Hoz9CreX+V0zzz3/CzPSIZcwDuqhF5pPEr554sTXHRv0dNfJ3FcSdj4xYWx/GkhyGDWcsHOPlMrcbdktu57wazum9kJNiqXPzV4M352w9xnDReKvbjrxYbBOUVjOsncpqohHssjUaKVQUeLSnahCO5HvDmaGRh+gpsMu1kHN/EOfXEKJAvylZAtnt811eZF/U0MnuBlzR47R43EbIZ/HH8McxlpGUy+2FDUB/PEW57EK+lZ7Ly/enPruIJBwnkOPiQ== 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=LhVLGznBksksos1LREE3is/hDxk3CkKEditIjWVYL0I=; b=DhBoZEiDk4Zva/KPdXOZ+Ee+3sAAd/by7Sg9gDaBpO5PlPPcnm5Wnnajn+kkmgvJuptkM5f0LhXGXgUhA4ApK+9A71bUIWid0vqEm7yZ89jhjZkphZ20JiQoODIPp71IHN3yA4AsnPQY3Jba6pyjFwpmO7iumMEAi6OlMJYpg8pamFxYK4pJVr7zbxpozOuZLZOivicYVUoyUjm3IEYXKIQFvUcuPnn/QJ+p4Vt0t42UiptsoCKTv2IrEXwzxXBzjzsdB8UtiQ/PHTRcb5QKKXW/WISQi7FGt2pAdCAtW22Sw8GKPDM+wZnKdTpyggpp2NI8djtxH5d2s/QdH9FnIQ== 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=LhVLGznBksksos1LREE3is/hDxk3CkKEditIjWVYL0I=; b=qBqmJJTzUQIvKbDOdl3xhM66cbEryL8Leo0uULuWJiywJxp96sHxIPAx/PWHU1jlLPL8UP0RV8ET4SwCu0DWdsmSQiEa8uaRdsWil+d0CEUO9WtYisDX0hzSkGonV0Fd6W8HmY6whk1bpkCWbJFcqmI817mUEMoisAxxB9Z/eCJVcziFUK1IhiiIXeJLHuzh3T3RI1pc8RxD1NTOJ3PQlNidSmMp14cojT1X+wjDMys80RuweAsR2JZnU/oz4ySEum/mcMndAuPTRQKcyv5ryuY4xQEdDJ1Kba4b9ecBu7c+O9JXvFxHh6sIs+U7jdBsszX08WrEY5QiTEhkr6USmw== 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 SEYPR06MB5350.apcprd06.prod.outlook.com (2603:1096:101:6a::7) 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 08:41:53 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869%9]) with mapi id 15.20.6178.037; Sun, 19 Mar 2023 08:41:53 +0000 From: Yangtao Li To: Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu Cc: Yangtao Li , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 03/10] erofs: convert to kobject_del_and_put() Date: Sun, 19 Mar 2023 16:41:26 +0800 Message-Id: <20230319084134.11804-3-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230319084134.11804-1-frank.li@vivo.com> References: <20230319084134.11804-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR02CA0033.apcprd02.prod.outlook.com (2603:1096:4:195::20) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEYPR06MB5350:EE_ X-MS-Office365-Filtering-Correlation-Id: 57fcd48f-bf40-4ad8-98c9-08db2855ca31 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yflELsa2m3GZA3i/uz9G9zrQPBTWdaEL3D24iGjcECpxZC5kKC7SYHCo8dqD2pcre2i8obkEtzRQiDIvdXUvQQNRodyRHmWxvWnFYZzDwNZIRuEA71/hqwk504D3MVL+ZneSDYJQTsv9J8yvyaXcDN2+JVo9MzGO4u669Gxe+NSCuLhrGO7BFjl+2g79TW3s1JP3o7TFLU/uiVfRMa23OgIln7WjQfUrZRDzVT+c99NMLekeo2wPF1HmycO77oIF0ob/1Za1+QJZeTsWRs/ZuUeCrJSP/wb50i3cIHjp+3b5P48d2Tm86NWxx/iGQ7dBbvpVy+H+adln+UTZol101m1gefOp9Q0VQDTxmHng9Hq4cqGbdWLmKKhrCKUucnbepaRq4RT7+Z+SMwvxvmUet+mG1s0LeH5djtGPG5DeHmW0PIBl9/111SwpoPpQZbDljIGCw4t9CNyk9aGY5+hzrbA6/xKb4Qrd5/FFuESJCBUVqwUHLwoX/XfjI1zsMZPg3a6V8Zx7eUG1TXUmxJIJIAkwxl0fql1mnW2kIhXk5QyKOeEF2NKRncqPepqDe9QkhgFvUYKNhJzVDVoojzIIfK/NGFr6RuG0pq6Bw/3kiRKB3ufmwaAfGypUeaEirmFdK1OF0NhEkNdRvZHIzdJsbLjMM7WCW9t/hx/dY5DQjGrGyQPGHzrjXbOKMHKCcXZHKNrwGuOPAuyGqOY1ryrikQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(366004)(376002)(346002)(396003)(136003)(451199018)(86362001)(36756003)(52116002)(83380400001)(316002)(8676002)(4326008)(66476007)(66946007)(66556008)(110136005)(478600001)(186003)(26005)(1076003)(6512007)(6506007)(2616005)(6486002)(6666004)(38100700002)(38350700002)(8936002)(4744005)(5660300002)(41300700001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: evVpKhuWuJQXgwny5SjqZMRl8vbHamMLTHEY+O9kPfJLl/B/dPbSbTgzMu2hHu8XzQUcVQ9zyeuLL1QERuy7zjZ8U6y3bNl8uvbECP9FRsY/S0K0L8cBI7u89LMdurUSorqPyl1zuv2UqhwX6JdBdNtcIgWvu3cbWx8CotL4cv0yV2fQ4+FsYDtsauRJtJ11qdBcXrOwqbupMYy6q6QCvCtI83VTh2mP/0ShT84SdehZJ0A4UHNxkpKgYEybKlNMWxR4uWRzGEsTvNMI/kOKAtL9pwIvUxs5uX8UM/I7+eT0SjtZNE3DbSKDbpv/LPtgnwQht+VxLgCRULw/zWqLODOklCE0OlpeKssuQP20xZj/M5MYSgSPNasbWyjaoZbu67cgucG6CrblUkfdrkyhu5SxRFOGh845NYjH7Yoldj9bTAMvdryGlHjQ6LbgpEUzppjrpqLsc+s41xzjJ4Tr2NorD9lTbMxxujQQLjHRSUcchVKTGpIC3NlR5Qj0i6XjTuZkMI6zJ9+IG/6q/3fWi7bZvRUQZss5+tc5MpUGxJzH3k9ZYZDpsLj9lmq9Cul54BZfO6LwSJ9kFT1bdrH4TZZRHksQ+3RaY7m6AAb3Q20CyVbwktuOFdHnKCfsu2xEpIaazsGpV9bv3srqxt4swsdQmtmydUO8oUfj/81LBmDeJtZrly+w9loqxY2xtj3re63H17Em4EDYwAD+/j+UQe1JU8iM40CxJ0NWaRaTI/ZN6e0ZijA5sqwmxOnEKuNdyvW1hBxoW98EgC8RA8yrtSqVFEOugI30cqE+bli2rE4Y7n+hv8CrC1i+GkIsITZsBh00VQa1MWFDn5CManIufp7rEiewVbsQqahtZ7Aw8IJ2tmwxMyL+cMuCP6XjGeum6exP6XbatPnLwRUzzUQXLXaTvvCF7JjxzN8mhEw7emyMO7y1JTSVSFy0Z786GxzegDjAdoywBVr6g9WGvoHkKXCV2yCR3PVumd3c+Q9vPIzi7hIXjp4wcPSrgOFgGH0OwM65lQmf7w2+yV0371B8oqS9u5YS40z6OqdHuERuZ/yyKYpkCbsNhc6W/+47iOhS+0+khuchfdQ6kVLHD1jJ459HuJ3dO2Y7S9VeD5eQpLFQK6sfQTFB++M+QJGg0K3D27/5KRhBT4NZdyaFVzxx00D/e6tr0pMmS9PGr9cJXczDrLWBBgKAO1y7bVtQDzEus8Tfr5dC+iBaKtgV3a39G2oNcMf6j9pd2u3qgDBCGXEM9HwUNFsd35H2ZyDC0jnzqyRhQBCWRv14FUu8duo8phs0PQJxwoyX29VVv0vkC7we5CsLlJcI6bHAxztcSW2/Vz0yWkAsia1KvGOoYF19v6ArxXyTubtyKfAwZ7wxL5cMTdzxMQBb1t3+Ridg4XmORo4TfZfsPzGfmF9LZijIB8J9tmeW1wmmuDnCy+VRRMLtfGsgmfRqIGBvZmvXolOeOY1rGFL+qgI1ty4oQ6LW6U5sNJhj8h7JJVhBxtQr8gPbTL4UsgPtyIthirvVeLgu+79HSGT67UY9CJei0haLcIZBAqe9KTTa8f/NVYBu0kW3CUbzTbRL6jWw814knAfe X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 57fcd48f-bf40-4ad8-98c9-08db2855ca31 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2023 08:41:53.4198 (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: 1kEDnVVP1cYnDK1IbzVhWFEksguEsSAta/0/QLfDITfCFcgAIVWuj2RX8YypDbKH3GX4iYxgExysByZbUDokRw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5350 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?1760785413645264565?= X-GMAIL-MSGID: =?utf-8?q?1760785413645264565?= Use kobject_del_and_put() to simplify code. 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 08:41:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 71724 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp639349wrt; Sun, 19 Mar 2023 01:43:09 -0700 (PDT) X-Google-Smtp-Source: AK7set+8MMniJb9UdU+Ta0olcExsh8IwCK5oQIW/+55qUncYBJKdiN1oda8e2VQ26r5/omSVfDmr X-Received: by 2002:a17:902:c792:b0:1a0:437c:4e82 with SMTP id w18-20020a170902c79200b001a0437c4e82mr10646037pla.13.1679215388716; Sun, 19 Mar 2023 01:43:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679215388; cv=pass; d=google.com; s=arc-20160816; b=0roRxV04ZMD3TvBvJ5UlBhAXYtYVjo8yzPQiqYUJ8xmGtNwfQOvbsNB30ztJXXC+6k CSuE0V9hVKjNykMuII8SykoKxb6HKTJlP9zrOqKPc7YMG6NPkOIg85gCxrQ4d4WoMgW2 QGw8QVd0fQOTdmJ297xZeoyVqGg4zOsXGjPOJsMEXRFbnvCVDx1AG/siYLnJvdWZpO0h KhcFaCkRwLUaCPQ4Vq32jhFDeNsXfQSBWU4T79olSu5XoE2pbR4AfTyxNP/tdQQLMcoS ZnJFvG4LRUSSaFWYIRK6Di4yxlAQvOZ5vvu3n+aJGEAsl5iSsLgP0nTryrtPSD9DPvDZ r+wA== 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=Wz/bz364FUglJebWbfcyJUUQKy/BWIZKlCTuj/CjAyU=; b=dbHNKH472BQMV+NNmv09/2U+JrvVG4BZtmawVaqGQqItjwzroWfRiQWVw3384Rwuov 8hnEvU/u6+7dQ+o3S0LzEpggA70C/hkOkv4m6It5L57Gce9BqCskAOLL0XAMiVY0L3ic PljVidRP9ruxHKhOsHZHmaTHgcbUSYgZkVIWMCcgwrSQQ+A4s0D6talRmXoUHfZgn025 gYWCn/r+uUsj6ywP17Kf+PWBh3E7enVKUzDXqM6Wl1V7MAwkAfSCXOkBPhdJSaTBsuRl cdx8U4SuG5khEWH/Nu7t4LSiLUvF5PGUGo9b4MC+TZKDI9ZhuyJmWNpBUYREPjk43rVv uvoQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b="eGH/2C73"; 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 u11-20020a17090341cb00b0019953bfaad4si8166291ple.470.2023.03.19.01.42.53; Sun, 19 Mar 2023 01:43:08 -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="eGH/2C73"; 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 S230215AbjCSImI (ORCPT + 99 others); Sun, 19 Mar 2023 04:42:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbjCSImA (ORCPT ); Sun, 19 Mar 2023 04:42:00 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2094.outbound.protection.outlook.com [40.107.117.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C465F23DB0; Sun, 19 Mar 2023 01:41:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mWYNzNPrCPD9II26Y6QFdFkrW/91nx0hSrnXjCz1pgW/VWJ9E9kKVgLgcA77M2H67Ud0Mi8QxvNtKvI+urdls7vDFEP8L9itrTkPQeYpWzalfhXyPOZkH7e4NsMbTcQ+n5XLRuoZ24M1LditLRvWy5cWw258IM2AQxFVlK4dpQc1tIEvT7L/FIhH9lSTOZdXX+Oql8OtyKQtqaNLk4O8+6wU5q0+XmiRyeLMHNhENM0nqv2UVl1mC04MQkJUmGz2lHvnxnRlbHfQQVNBtlj3Wt/mPJFDbLXpUd5DdY5JdgrdcoipymskRA5tj+EfhtRfgWslu9H46Zfyk9kl7fG5GA== 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=Wz/bz364FUglJebWbfcyJUUQKy/BWIZKlCTuj/CjAyU=; b=e7ae/7RtXWaAh8d9G24kdDNLJ55Uk+63ductEiohIy6d8KErVkTQoB+FaYvezuABFtsyQ4ZrjGvnEpOxJZK2QVnOG8SG9rvmbcvtwh6NHtkX/2+sNbOr8ioHAjZzULocnlAuKppsuz2+/KVblbQweynC1drIVOnaq2/i12gc56Qhzv/cmpwFcDIFtmUnkcJmHoMuVQEngeDZ1icYm2dq8GKUq82ktcTEN4I4eLbsyV29TMR2SRLHolEimIVwuDsJWEKjUHWYYvetbel1Qo8gkH2PsKEL/dOzPsgOq5Xy5UXG8a6OJe8v957+SnD03WrRHsr//CaOwlSii7R+NPsujg== 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=Wz/bz364FUglJebWbfcyJUUQKy/BWIZKlCTuj/CjAyU=; b=eGH/2C73p6n4EMJ+cg3Zn/LzdOp6IxPNIYLG0SiuW1f3Q+hWF250JvdlINcnLyiUNYZ5mtG0yfBWs652cBVkUuJJLAes/DD9KZ03YT1Kw57gQoTvsflIPqwb/LphfWLDMItq3jDK0B5pY2P+95dZIvRe7DhywmQRXkasLDPn3lNUndvokiarXohUUKOJgmnzALktGvfNl/vlK70MIN1HUAoYFELyDgeuIwHaQgv8Ew3JHrGhxuXvEFwkVijA0GGYXeO36KJFA7VEg25CwnesGUY7Yuo47E4XvGOrbtXr825cZI6gef5JI/GeEyotPZl/WmjZbeqKvRHw+2h09FbpFw== 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 SEYPR06MB5350.apcprd06.prod.outlook.com (2603:1096:101:6a::7) 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 08:41:56 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869%9]) with mapi id 15.20.6178.037; Sun, 19 Mar 2023 08:41:56 +0000 From: Yangtao Li To: Damien Le Moal , Naohiro Aota , Johannes Thumshirn Cc: Yangtao Li , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 04/10] zonefs: convert to kobject_del_and_put() Date: Sun, 19 Mar 2023 16:41:27 +0800 Message-Id: <20230319084134.11804-4-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230319084134.11804-1-frank.li@vivo.com> References: <20230319084134.11804-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR02CA0033.apcprd02.prod.outlook.com (2603:1096:4:195::20) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEYPR06MB5350:EE_ X-MS-Office365-Filtering-Correlation-Id: 350ef27b-c405-40f4-d31a-08db2855cc21 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JEj+nSGjFVvEfhTAnNSbwZ9HdlcN2SxI1fAjjNqNRKkQFK2H83siJsK+DJFQaGzOuWYOuKd9k5MSB6x28/9oAmOXIrOQ01eYvCAb8G4lOJmu0LYS+EmlfqILtQTo7yBjAV9artsnlmZ6OEbBELhnCiJneIsRxrzptkBxFGv77NfnG6l0JXMwM1X8RhvWg/PtxlR3VreEIsrpSALpFnBiUFrFCNUCyIxiv7xFII8ugggCZDE7HW3gpIRS+3BlITrYIwMNX0e/80TAeUtfUQ7hRHfR39G8UVf8QRalLHBybzuO+Ou3jbWx90R3LQbB7MP0b7EFshcJycUFwbJwjz/t/EnDhXJWSFa5hd+ZN4K1niMICxS4uJLDRSeM2yV/RKiDxzsS+aA5JickBd/JiVHrFEaLVP3WuZ9EQvX89AUDtjUj82bMqPHPtOsPCS1Z39owtWZ1FN/5YUgNEZ5yxdwtu6JXpZcXuwzv4XN/aU6s+GTWxOPLndBN1ii0BA1gyGbI+STQJKVH4U13QJyE7YM6+iEyXHa92kQDgRXUFdQ0F9sVPIoQX8HfC3LKcDyy6ShyekwAubHJayqLEUSstGbFoGVCSwai0f95LKPdXad0Ml1QVKJ6jOI6+GRmULJtZY+L8viT9h7+dlTqGvz5OxRH2afF7w/IGSwU++FuxnPFgzpGJv/h4wJxdDu2ln7+WuKEYWJHAKzQ5/7ePN3F6uZmrQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(366004)(376002)(346002)(396003)(136003)(451199018)(86362001)(36756003)(52116002)(83380400001)(316002)(8676002)(4326008)(66476007)(66946007)(66556008)(110136005)(478600001)(186003)(26005)(1076003)(6512007)(6506007)(2616005)(6486002)(6666004)(38100700002)(38350700002)(8936002)(4744005)(5660300002)(41300700001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0QWt+o1twEyrfRl4CNoTMRlOp54/P3iTQCfySJlqNT3daK/ezkxCngG/mmm7tQVzxem7cVnVHMF2VrqJ84w+kNf4ICSj5ZDsRwinbMLrAIOw7DJGn7x7eZpa1ddaF+h+vK/k+gGSgpI5qFmlGVlWbRP4CUwdhss8TJk+uObwObIvqByJswZibaw+8edGkYYtZT0oiviDIX8PBNk7G4Nhn1//kYHCm0gzDt1bQt4SryRvIWOQlh7B6y7MFc3FU19ZRCF3bnFx0kr5/psWBBgvbLRGUbsFjB7ZJhvApQPPGrEKlc6PPub0XBr9I045y7cwl95pplPfA4c9UcIdOa0js96uDPPHPRwfp5EtOEeubVDd0sG4qRxYkHXs8UcyzMYc3NXPDhs7xaGBKwpYX2tui2AcIO7k0i9hZ3G/v03nWFPhuUpskkecOWMn4BXN1RR00ko4bo/493tq2eCVRvwFyGUy4JD7PIvms0zm6iXJGUd4SfbztNPJqmiHo1NMW9uX/z4YxTzb+o40YF1m3ykymzddMs2yMWM3NqUzM6DRKlpkGIc/rVjMbbuIWrS74fitJeUYaMR5KZcbOWRvHdP8cP01nge6TB/XL9gHZV+VqideXMxvKaw65cHS//14DBgJdxe2Q16oJZ1E2smVidjbQoLWuVEt/CNPgQKiCIZHLiwCONS+PIcV2EioMXOwQ/VfMK6Y0/qzN3mBxIybR1g0dY9muzPY+4VmrYK4b5Nad7VVfGImzlSg1Q4w24JJD7uUvS+BAH4aDPlJ8kZ6BhPRxUUcDZ6QQl/oOtOoEChjolnTaDMr6dwu2dA4xIGWFYI5x5/BnE7YT8AmzmBaVKhh7CkpvJK5/hIFB+zHhRlCuqGfrqAxVXNnIiwWSINJZ95gH6AbfjEE2jdwmlZr5GlQRdAGvZ3Ggv2qGtyEzV7KuAP02oyrEnZnWcOoLkgLLb7XS10bH7+u2hzAwDyO/ELgG2q8zd0zxfKRoYBY1wMvttaJo7k8YpUjF0w4Ah6PKm8M+Q1jBgb4nXlmgx0KocPS2chFS5wth0BN7vChY9KcQwkX4mMK+XAJGVpkkVKVNwBPl281+DncqD5rohmBdK5Bq2l6IaU29ZsOJ7aKStmz6tiBBbHamb5WOb2jvXVgMBHdOAkejZH7MTStNTNDnAQ2PrdrDS/CXzyEDiCLY8WnstZm08d2ofz5dEOoFCdvOa61KxuB2U61rBdcAfrd1lBZeUMV0BJcMyesJjLPV3/R1CKSjCN9WBuDPOhuyAn3xmTnHd/yd/8aUa0IaXdDwp/7K9BaHced1025VLGrG/GorKvOWLXOh8/kWLdlYDSSDjaskSqf8CAt9nGA9KVm2A/eGFnNsjF9rm6scM73v2pRh5lC+mUgGRGTaT47ANhG8AjHiiKy2JdYNXDbUKXJM7Fu7KPcm1wMMJsinSaZI5j2J50q+TrT4yPfszqmGxrG/UW/Iv8RuHPEAj457yR1NcjdEIuJ8VkvhX+Dv1NF9evYooXcFRHnpzMzWG3R7iwZatL5iB5546Hz1Y+84dqtbz8hVnkxlZ1y9NB7iHCQFmDvjJhCD+cY9um06VfVLQ7o5QVe X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 350ef27b-c405-40f4-d31a-08db2855cc21 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2023 08:41:56.6718 (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: LKCFUTiSueRP7QLGBErPNqHPbK7GbMcYEmZdQicJ1AWxxjbFz7PLuwSu1BWEmbPErHbGPal/zDBTXSUzsIskbQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5350 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760784955684979687?= X-GMAIL-MSGID: =?utf-8?q?1760784955684979687?= Use kobject_del_and_put() to simplify code. 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 08:41:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 71725 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp639372wrt; Sun, 19 Mar 2023 01:43:14 -0700 (PDT) X-Google-Smtp-Source: AK7set/d53AgfDycRQ4z3/1j8aeMSC8v2b4p8mMbnrX8DiOBfCu7ZkIk4dq3NBi8KzUH0x7cgWvC X-Received: by 2002:a17:90b:1c8d:b0:233:f98a:8513 with SMTP id oo13-20020a17090b1c8d00b00233f98a8513mr14309844pjb.8.1679215393942; Sun, 19 Mar 2023 01:43:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679215393; cv=pass; d=google.com; s=arc-20160816; b=YRz95VDTjhYk1+3NFZsb8rx5qRn9fdGKtKpJ87K4HuHGipdOsOTHTKDP9ISL2yELM/ 6UNzTcC45gGcIJyzzXoEWACZsZUqliXLQb8s3fK2TT2aNydhQr7V11sYAgsvIqjyDdHV IYR6GXn9vJKEbHsSc0U5xNaO3hUXQg66LsYicJqxaXKUVTN8QurXcUGQ7+IZ9Rwvvb6D L6TqF59+m3u4c3Vj62pKhlgOK6SFm2CHf9TNh4xgl7+DflttVKu5NAIqPERPUe0LcH93 8i5y/MLifL6MzSsXSLMsp5SfMgk/FhpjD3xc4TIKXlH5Imi7KVTel/9xh+ROLUCpf+jf K81A== 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=YfzLJyGg2pPv0YkDWXwHhHcFZsGUeeX9EwBVvu3ePyA=; b=fUlpo/lSZ7s80goTpZIjlo9JYlVHKczu8YQeJh9zBsD/Z4yKHLtShg5IU1bWCJNXB7 SSeNCIJI0wrJmsIiMsWeJqZIyooJlxye743f1PeO69RIGZxN4GVMuc9PH4L63xbGPlKw /zbSOrJAFyO9xPz7+1D0k1Y3iLug1TOtGnHygtQTahscYLmbjxNGFft+fj7Vzl2MurTA GSGUGnnm3PA7bJzkZCzROonliovpAJpfJ5/3tn7P5gTDund9tM7UwDRv67pH7HwZi0Zm pj2Tso5LP6LVZ5/qJL4dnKcB0/UKEE35q1IdV2o6APmjpj9vH8VP7XZj1UGNKUUb7Ah3 DwAw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=i+FBK8dZ; 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 e14-20020a17090a4a0e00b0021918bc9a47si6730064pjh.174.2023.03.19.01.42.59; Sun, 19 Mar 2023 01:43:13 -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=i+FBK8dZ; 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 S229468AbjCSImM (ORCPT + 99 others); Sun, 19 Mar 2023 04:42:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230189AbjCSImF (ORCPT ); Sun, 19 Mar 2023 04:42:05 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2094.outbound.protection.outlook.com [40.107.117.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1142016AC7 for ; Sun, 19 Mar 2023 01:42:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ns3wRcz8cEI5wnaDzTAX1C3dzVCEc4AEXOBKKceYO+f5btY+U9CRrt9F1lKQZvni0zoFGW/8aNUicS/z1wRO1aZF5fhaasMnHCOOsmeR+YNiS7lKPLOu26Nu4LlMvU7w4MpCssrauRzrXOYI/mFUsiLBESr1Z9AzRHW16A25+PZ68jvbJpZp0M3VxdcZGDxu8bte7RT7qaVZPJA5oaCM+2+uMpB67/YgagIXSjpmd7RibUbT3JYXDuv+sUwh7J+F3xScoKXthChYMqYyzscf8OWmP3GUDi5eSBRLOkyjKkkgJ8Or8xJlsFkGpS2yO76Krn+40obBoahpMuCqB87NWA== 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=YfzLJyGg2pPv0YkDWXwHhHcFZsGUeeX9EwBVvu3ePyA=; b=bkXTIlkxDyxsCP29MK44GLleHGdRvd1y/qKEOp3yE8hYQQDGID1apcfMC6h3EuUTVuPBfxSpcf7hixr0zPTkS5RMfTGUW/uvUSjPmskU2egwxCVY9HhRG0kIych89WcYFtBXgolm7dl1+BYslO01EZyCmTGKs5pw9elv2qk/XCOaoFiV6GkrE2vX8TLA6Q8LAmpAhZT4e7mXnLYEf7rK6puZ7W/3eA9ERD3wOnUfbbX7c1k9/S2HRCuHQVcPfqYKcKSWoNABiIkt4pDwLkNA6NhMil775Df0YLj+VRQ3oWJdJMJ6eqVP0GkpxNSzYGRjRWvDrzxyAV4pVyo35JKdKQ== 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=YfzLJyGg2pPv0YkDWXwHhHcFZsGUeeX9EwBVvu3ePyA=; b=i+FBK8dZ6ax7t14r9fEz9+epcR42PDI1rYM3WR/qBM+EVwedEzMeD+2JmYVf84J3KakRVGuFr9AP1pD9PtUcXusge3Ay/HUHCOwetiIhiOg7Ja80DV9+bSKByAi9URdphmKaG3FAGHFFkWubfBYPJjw6D1/m/GrN7Pbayb4zibkgHwnxTNqMRT6nGtZ0V3kHdbK1YQxaR9FR5HU7H9KfVMqvdn/fSk2+fGq0beeFyQ/yzIh4UgTjV+8S09Oa+ZZEBqFjN1ncnoE+m3lvUzFpWlsgEGa+8TTuFJ5hyyrOmwwFj4YIj4Fwb12Jn4+hsGgU8DwF1pzsLR8aTfkwj5yVBg== 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 SEYPR06MB5350.apcprd06.prod.outlook.com (2603:1096:101:6a::7) 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 08:41:59 +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 08:41:59 +0000 From: Yangtao Li To: Richard Weinberger Cc: Yangtao Li , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 05/10] ubifs: convert to kobject_del_and_put() Date: Sun, 19 Mar 2023 16:41:28 +0800 Message-Id: <20230319084134.11804-5-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230319084134.11804-1-frank.li@vivo.com> References: <20230319084134.11804-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR02CA0033.apcprd02.prod.outlook.com (2603:1096:4:195::20) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEYPR06MB5350:EE_ X-MS-Office365-Filtering-Correlation-Id: 40eb91a2-5180-4e37-52b9-08db2855cdbe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Fa5vZQtT9fsUkB/5Ka2knB6z9O5EVHDIoSjlUxIcYMWU2Q+01ZYi5nKkr7HFMt97R7SLy+aaXP06HipEsDA+FnmJGtIcgNFcZLQ8vn2kC2YtSrC8OkYtTghz+kbb3AHdyQQj3RIY982jbEM3MfqFgYePZu+qBWnJieLtHp0bevrlv1hHrNaE7PWo1nZEjLBm2SsEsKipkHh7s7M/FElxC/0AXlE/GqjNqY23evk18DKtRmKaA2sFI75f/JarSXK9TOwsNVh9qg5l3K6hfMjTYf5tuR+Pp1l3Udjbu6pCml6jD2M1KX0v3NLPP3x9fFVbqJTNaGnVxUXH96NzX07O9slkX4lVh9sZ+RzSr9DQO+e7pC5dSP9Nu3vbG6jbQfmscGBbCeBz9pgoQN5Tr62uFrWJR+AltCnTLwPGJGQbNnVs+5SisgF9Ivke4baEN3wEDTR4cFeYxZtGSvJ0dbfvXKgcyvD20O15o20ZqmGIcDIJJX0nwQGT4Dqv7uz59K5/WBMkUX5KOU8hUUeujUfv9HwdnSv0ofT92GaBRiI/SfWZlOtU2JugkOOx54G+F1cxqWzFa+dW2Gwkwxc/DuKU5WR2lbIJirK2OpXDxmIUu2ziMp7T7nxQCPUsicePDrmZZ5aUEgFMoFhVtHjw6ym7WYURS9cQyWC2goJg+eQlAIJINsoyy5yzW8Buew/hFaxr2fwRm1hluYI8vlh+9Y4Pmg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(366004)(376002)(346002)(396003)(136003)(451199018)(86362001)(36756003)(52116002)(83380400001)(316002)(8676002)(6916009)(4326008)(66476007)(66946007)(66556008)(478600001)(186003)(26005)(1076003)(6512007)(6506007)(2616005)(6486002)(6666004)(38100700002)(38350700002)(8936002)(4744005)(5660300002)(41300700001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LK2O1aLvIlDcgoGQDOTKmz5T0dHo3CioSF//Euoaql2E7dTUIPw5tWHXq77yjV+73mQrTls68OWZ8PqSDr0pNu1DOjyMjvSFvoJv8nVGFm2jzgRkqm+sHkmP9RZ2e1JKJtbMfTaEl4duxI+Pd4HGo71wDTT2Dl/9bxy7f8B5zPMcK461GYG2ti7PkZ5HzEkFB6BNGTk5tmRayJa81ZaFlXlsmjGJakk5wy1H3+WaIT8AskAM6CMtQcZhijOf96nN3PnOUW3kP+mT7s2ZeBsGXO5BqPumWc0rAEaH24d7bW+UzKBjgOLk6R3aYt2C2kIYbU0iembkBVMIv+pAr+VyKGwpb8Uu4BhD43J9WeIar9HBEJZrKPEDPf6aFhwfVY/U/IjXzfQxORZDrSMyynNNcoByacOs1pdE2IDPfeNrxIomCiwx03HzDN6AlQeITweFyZCmTjJoZCKibhcWFhjRWAs+J2RfYcflFo0KMEgp8LYRASIGV4CBaxZpnrurDjoD1Qnt0ZTTRgs81WgJ7zM0eLj9g4gyWOJfokMUlCzDM1AyR1x7TYCdwi241gpb44/Md2P6PajXAvfUWnAbw1pzKyd40YyGI8WDZoLLQaAKjSTp9KMBJKzliqXUrrdM1Wojv5O2KGj6vKc/jkWgH8KtA9wirJSZmdgJchNvZ51cO6Sg8iHPcciQXCADH6T6dbjlgkOaCOcIHwRPFBqsIjp/dq660Gkf6ByJGYk6o8+lq2paHo03Na5UwTfSyh+RocUF/Vfry71+7TEZE35BOFR0q9NHdWZ8+ZaKvkvVQLlhcdzhC/BND09eERbaP7q2AFj7YEYCwU6BydsMDslkCASNpYXf19omJiwukr5oztGUvF3bmB2G8vDTozAR4bIyhsdR0VtpA432SwHmuIIo9RAMr5ZhnKQsbAZysxpH20R8rWmLqQ2m7fqAuUK4qCxxnfRzvi6WZWXxT+/InFPS9bAflG5JpPejEN0q21Ft0xvKaoFKY+Au2I9Kwc5BMMH3DKx7l+BlIeSr8yBfCh9nhZvcUhh5sysKRQqupkYU5gSqupdGUM00uGhAQ+5jcOT95cvWjov0muXp7IzwnFkvqrgDRJm2ZG9Mw7xd1utKkqCrv26okZcBrhP4sDZIKHGXacNDAMaztV0URegmR6OuG7EsdXeKebQ/vWJHPGzPUywlxQ5G84JfEPjh4EKPuBTsATuOfCqe4PvVfeY5VKxKa45laKQlx+p3Mr71qSGTHBoaHbH7/GCogC9/6tAfzK2W50tZ4uqJTppyzmgMsk5H5t+7eNMB1q12KDGiVl/DykU9usV+elIiprRP8HS9x8eycIKDR3+LqY1r1tJasWqZbIuEtDRZ/vM0Yr2+mlxjayA23MO/8iSuqmf+0K61odQR8bWfr7YiqBEOUmZUzUu7PYyVEk7kDCRugGA31tluEPApQcIrpkoXUpE+8MxhptpHG1wgJmRJ1BNGiUwWlHEssWMOPnYIe2FQbBNuZjF1hNQTKFBNwzbEcG6J0dzQm/rfinhkMKW9dpDPcySFq27/ktjwuhnKpv1rmhigtKjV6fUYkRUisnycMp/jy5rn+VJatax0 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 40eb91a2-5180-4e37-52b9-08db2855cdbe X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2023 08:41:59.4065 (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: J3zC/wjrsicP5XZkozj4984nDvsbEAXGJ4T04JUHapJA7widCdJGfZkTfIt4x1v7WWuNFycArupKMKPjiDYQCQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5350 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760784960846528057?= X-GMAIL-MSGID: =?utf-8?q?1760784960846528057?= Use kobject_del_and_put() to simplify code. 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 08:41:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 71726 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp639428wrt; Sun, 19 Mar 2023 01:43:25 -0700 (PDT) X-Google-Smtp-Source: AK7set+hghNhLdeA87NYtq46FlQE0FPbdwpEfKt3g4aWbqqPs5oQFVbDz7xtkd0OjcF205xS/rNW X-Received: by 2002:a17:902:db01:b0:19f:2503:a201 with SMTP id m1-20020a170902db0100b0019f2503a201mr9496569plx.29.1679215405306; Sun, 19 Mar 2023 01:43:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679215405; cv=pass; d=google.com; s=arc-20160816; b=I7RNKA/i5z6QYpnIbRbMVHhbK51/U9eE6/aEj28v+fqloT1ywlU3J2JzgBm6gCbr+J UvEZv8pEnbe13Mh6EOOqxG/SrRzyo+xfbmj5+V3HDvsQhN/Bj9IVAE5NsGWQ6OGsPcGN Okz6Co5ySwa8guqanbBBxnvGy3ngke0QwIf605qoL/CXTCCANo350DXQ+vLO6/oYqR6X vho1f8GWth6GqbVa/3BIQjRcW7ptxzLOXrE3CBnpfE0qjbq5mdt8MltZkyI0ymBkKrUz uiOhtzrUgbYrX0ai3s4gogsAYG0kwoyphF/d4q9ZwaKh2rZ58O+vBRodPsZGRbFBKSBv PxvQ== 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=OlT6wa0rq/oWNEWGEA+Yww5+xB3nakyoVLcNIuupIpM=; b=nEWbK8aaxstZ4sieUZovluvlTIXqHg9u5pgUCdCTHG+4g62U6VDulMEETXcfVRH4Kb avKv75mf1a6TtYnv8DI25gXXoj6gqklsmPtkvN7QjxtXcs2eB1SqHSkXK121/dJrafcM J7mcH2XKN0TqDe+rKYSjXlx+FWz9hDxGoyXLz0eAIHiOxwnBytzUh33+1AT4D82Z2pTY d/ViBEHfB6TDXyXFBz+ijdDlwsbho7y0FHoFV4Nw75xBzfY5iseV24cyJyFPOPHsEeXb bHGkh0YHdjoMSvG6RiSM4wQLBQruHx4iSBjBxgFBV3vUYox68x2EO7dIdRQ+Z+2/uzXv 2tDQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b="mwSeA/Nz"; 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 194-20020a6300cb000000b0050bcda4bdf5si7477112pga.428.2023.03.19.01.43.11; Sun, 19 Mar 2023 01:43:25 -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="mwSeA/Nz"; 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 S230213AbjCSImY (ORCPT + 99 others); Sun, 19 Mar 2023 04:42:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230185AbjCSImH (ORCPT ); Sun, 19 Mar 2023 04:42:07 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2094.outbound.protection.outlook.com [40.107.117.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04FE116894; Sun, 19 Mar 2023 01:42:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M+SNo2E1oNZK8iYYa5B9+wl+xgvajvjRZCZsIY/kzrtn51LR0KrTleLusEYJGNsZ39XmvigsMk2Vly4CpkkRRC8TMNPuYjPULVxC5FnkHfWyqT5rGhWXK6K522DUVtBOzZyLjHFGE3pRP3zHIdi3hwcuRhr5n28rJn16O+NswkMEczR8KVz6HQFYOuKpc4KBlyUygkapGqNxN3y4yDkfpBwWgmDKF3899kcTn8BXAPso+gU/H4aaVqyvFCDeifVAFUj1xPtSby4B0DaU5tAVsNpxdUnkLe31BMTTF6cucq4dwYuBKgAxy+k+zseepruzdfuSLcifwaGi+MW5bfePQA== 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=OlT6wa0rq/oWNEWGEA+Yww5+xB3nakyoVLcNIuupIpM=; b=Yq90sQr2OrmbHO5QUMkFYidWe3tGQpq+hGBc5oDThpZg4PG8nDds86D3CF2CnTV2cRXEo8SWsGtO9TBa4Q8YrUiiLpHxAtXZN2a1cGlfxa8vp3FK+Z1QXOfHCs7Xb8L76v4wQZ6X/ZHhOCK4tk9THOlnRoNdt+tA39Iufad/DwnqC1FU+C3jlKxDoIxzoYqRR4LVUTdb2XXo54rYsIs/hqNzUa8peOd5UwVH0jjKB0hhNs9o/vXu+aWTS//BNrnBeAPUXCEZx/Cjhh3B68CBYmnvyrTBgqStyNfTlBmdUsJLw/tV0SEuNy5gxybW+T/EY20EPejSPcQFISZeX+2sRg== 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=OlT6wa0rq/oWNEWGEA+Yww5+xB3nakyoVLcNIuupIpM=; b=mwSeA/NzBYqEBNN9EoAno5dXR8eCmTO6RNesOTJpmeFb0vmtI8+r7oYWgJFvFWS6b3sdEDKsKNQFTOZkI4r7L7bQV2YcJwgyuDoz5xMMPYII41X4zZA7dZiZmjzTn2Z4kKqy3Phf58kjowTYym+M6tRVMKMIVCAn3ghjIjGK0lenHb50JWeAtz/2apAZ21t+XKElLWvuzGkNKY4PymBpV0+nv9mb7P/aV9nVglgAq6j2YpANjuQufSDshXG4IeAbZKDonzsfr913s/5z9+J7IYvvBsXPVgyDLa3O3v2j3papbhHQ5cFnqpBbLoWLcRJZgmBA9a9kQ8Tp0mGyh52A3g== 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 SEYPR06MB5350.apcprd06.prod.outlook.com (2603:1096:101:6a::7) 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 08:42:02 +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 08:42:02 +0000 From: Yangtao Li To: Chris Mason , Josef Bacik , David Sterba Cc: Yangtao Li , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 06/10] btrfs: convert to kobject_del_and_put() Date: Sun, 19 Mar 2023 16:41:29 +0800 Message-Id: <20230319084134.11804-6-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230319084134.11804-1-frank.li@vivo.com> References: <20230319084134.11804-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR02CA0033.apcprd02.prod.outlook.com (2603:1096:4:195::20) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEYPR06MB5350:EE_ X-MS-Office365-Filtering-Correlation-Id: 94b5616b-6d5b-4d42-0e4b-08db2855cf7a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uskNL7xN3SMolybc+tqT3uuPFJIDM8Zroca6sJfrgTHXh0yIA9feRCdBzlTsdtp1TXIBDg6ACMhvjmie7YglG+zMgy7lPFUx3wG/4SN4i2jeKhxXWYD1/4a+vJVYcKUKENABLS4U1e/zvyu6xOMl/qdfxus2GwOsxA6c89+/APZRV99FCPXudaTms1OZUG6p7xrPEq6AgAHo77xUpgbYueca/oxoC+Tq+dS9prureuG232qH7wHhYyfJMzRPHFjqwQ+XauMDoLc9SpmYC6M9Dp1OAk0byBaFZw/fVHQ4JCkfgB8WW4Pxm+pI8ETFyw1R36W4p7SKVsaEKZUAdTVgGNgya9zY2wd4mRDMrkORvZB+ic70mlcTb5thN1GA1V2xFjz96dZHHSvwUqpvUV7fjAUu0/9ufsgznKjPk8bupCS8lrnU9T13sq3MsuHSvYJmQicTDc2DGrO/uleiZXtaVl8tx7AOflZV/1CBxeuU0LzyEFYh66mt47vLfwIVDNmWftUkubj7uxaSZkO4LOEPvpA6pca4iWzI99HWeeOSIj+3jRwl1fjmSbo/WC9Q3HyfDWw52KB4sFBaasOYtmVTgPZZ0HnzhlY2dwuw1w+VPxHuNOnflAfRKRMSw07VFNP/ppOEKRy+s3c3bpcQvWhzRNBJLkcnzuP/0tdKaZHliaboJeifRgwcPMWgEF2Ctp1bgr8fHeQ9u0+gpqaQzHK5ww== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(366004)(376002)(346002)(396003)(136003)(451199018)(86362001)(36756003)(52116002)(83380400001)(316002)(8676002)(4326008)(66476007)(66946007)(66556008)(110136005)(478600001)(186003)(26005)(1076003)(6512007)(6506007)(2616005)(6486002)(6666004)(38100700002)(38350700002)(8936002)(5660300002)(41300700001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GfJ3l0NVdqliGwu/0Xwdg4PAJEV0WSM/6ypqs3hyDB4StYenY6oZ41NAYlsI09F+Io3nuqpqXU29lz+ONrZfg9ivZ0wSObtbQdCMwOcKu3pLHe17itS0EqWe5MdW7HDlw/D0FhxyBlxjhaef7T+XNrmpvIQr8c1QJALoprLwjazuPg/zPhwYuKKOd+wN/5LA5sviMXR96EsGUHhI7KFWTzsejOQZqbarJZNvMR9jVAn4QsuUXRcRx17KQxVcQcDdJ05/M/+RyUc8uVU+gnYtc78YkEhHKlyfZyer1kLpw5Mv/tKWD47Hn9W/tyDWQP1mCK4u1kQiQ20NIyZDu16D/QsjQ4LrFh5+lpM+sS4yugCLUH8waltx4KhNuebBqBcoYIzGMnpDokWgyDbW3/6hhuzHzrOpaPVnMzfImRRbpzfRLNnxNKoSPoUb/lFkY1jJCvNncCOcgWvPgdN7N18eXUgqJLWuH3YRCev1B5pfkeURSgAjBTQRaKdHZ6p6t3KVCqfWNHDdeklQYVrNznH18d8S3DlPVYipHlQBGr3xynjeGCC0U0112Qm33NVuxyUwxGmXKi5lmHevvIxshBlMgnR4bPF5+fm6WubcZYmx44VVt7MmihDi3t9S/LhHkQJjgPQAITdpKp+15LI+k2xQiWhnzV0hC09hVNJ+/ilSzJ3ULeVSR2OYd3UisFqqe43O1ijKOqYsp/pBQw0p5FdyhYUnObd+s4SR3OsHvFOkXL3LJe6AVoEWI31udo/GebYP+eKhpBc09rUELpb7WjbuvH4KGKX1eaeK4KkKai8yoKNFnKEwhkCvhnLGFX26Bce81bQ4UxXx92i9Jt9OYMgGOB2QqBUE2Nr143dt/SO/EPDQHDV173g9EroBacD4Efxd8dIYBWIHwbTGlmqRzI4OIcOJixjw+k6QLMards3VKbTsl+9tqtiDWXQ4Dez0HI0oqQ+4lIlzDWFp2rqf60sQl6FtbSV3fKzXid50XMnZqXLmvxDRBnNpxQQzKZ4KU6dXfugmMb7vY0yosWS61cB7ewZm7BcR6F4Jnd3w8UFYXfa/xavVFL9EmLzpZ31ZDOpo13Vi3mej/STo7IKGwIOGd74AFqbBUW4npvynVpSF+2/aQdMd88YNyIWgMSF26TZDQjfioVbbabDCTz9nD6+PsVXf5HeEohYCszOgP1tlsYom01Ze9/W5iLzM6EUT9CF8MB6obMkyUyfQDyrghQHw4qDEKN2ft3neSvfVOnhtnYx5BCCEGFHquNSIi33TJzMVgGhUxtfEBAVsJR8wgQyDoqzfZL9K/+RrfMT+OKePbvdGos39JVkKAFJdo1t9C+lfkYQ0tmgbKnewYwqrkMiSXmmVMbxwiORceBGieKTbu2k++gc/r8gS1z5NK2Ow8ZYFtKrZYBD5X6uK4fKnmmFOF4Ds62pMwdBW4xMMBjbnojVTgb3tDD85gV8j3pZr8amPx+n5DDFxQRwcmK8F2qUBBvdTz0wLsjtpOqPFbw7joc3Y+1cqvnfiUHQG2iShMqQq6IRN6RGdBZO0nGDuEg3Ip8GwgoimBqCNtYAzNPs5XDRYrkz+/QK18C0IOS7VkE7o X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 94b5616b-6d5b-4d42-0e4b-08db2855cf7a X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2023 08:42:02.2208 (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: NktjqHvctGJtGvM49pqk/GpstnrA32IHm+TNnoxKI7q1Eisw9AV/BFz3gdbFjaf9xUOCA/0li/5d8p7BxDE5+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5350 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760784972704594284?= X-GMAIL-MSGID: =?utf-8?q?1760784972704594284?= Use kobject_del_and_put() to simplify code. Signed-off-by: Yangtao Li --- 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 08:41:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 71732 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp641253wrt; Sun, 19 Mar 2023 01:51:33 -0700 (PDT) X-Google-Smtp-Source: AK7set8JM3dITnD/1ZE9aEH/O6QuCcWegAe/Rx927fgb93hLyrJ4O/kfUxyUpGtLG3u9Abqz/VGn X-Received: by 2002:a17:902:e74e:b0:19d:1674:c04d with SMTP id p14-20020a170902e74e00b0019d1674c04dmr14847465plf.61.1679215893373; Sun, 19 Mar 2023 01:51:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679215893; cv=pass; d=google.com; s=arc-20160816; b=Sz0Xnhvkmmy80rCERTWdczlsGPZxwrlTkyjh9fbqezN6juq54o2Pdtq3eAWjRiOoNY v6VBZK4KHT9feNkKHuttqzqpdeMF4uR6/X96SZSyfwssjRDpx/6N5tcXriziG64dd7kN aVPiRsTsg7e9qU+iUiSjrNXmFBJpZn7UtgPBg8prCBId1MEbvO6V7guA8+Gw7bdRAmh/ fyXuKDSal8q92nXIzhyy51i+6UfB6MZh8y7UqAdmCKZ8dIVt3zGiNA7x+voLqbMMGbSh wCpNMtar36RL9nTGiuzQsf7WdTIde9mRUO7+cT5mvMuI4HSY9ZTwQaFbM8Urf2ejzzWu msnQ== 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=eKaI6/jSmU8pR7rPuvsD7RTe0xNbOkuXQY/ZAgd1KWY=; b=JRY+2YgaYWDAU5ohTrOT/xqr1Ux0Il8CrEZkYsZ0744QMxrd+LhOWf7yFoVLZ2gMyS U1fggNCf6Gtz0QVPfKwbc3NEDudPY0Lzl1nbV+MaQNodkMp2bSkE7BOzKyZ3TbjIohc8 LHIeM84B/zm0FamfSF8C3lf4geghDPWLJnU0ViXzoV95R3ybKt8oA1XrXs+KpGy4cLgD moq+6SsVu3opw45CCiPcQ7wJog6JfWOwztWDSyLvKnFIo664mqh04pGYMDFNpFHs5aqV DN/X6zY1509pyhHzDdbWpp78ImcXKPwnQ9tDUtxhIi7qhyICm+jeLekcbGy070WsHSpU vnmw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=aMnbvJaq; 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 d3-20020a170903230300b0019ab692fc96si8254644plh.346.2023.03.19.01.51.21; Sun, 19 Mar 2023 01:51:33 -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=aMnbvJaq; 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 S230232AbjCSIm3 (ORCPT + 99 others); Sun, 19 Mar 2023 04:42:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230204AbjCSImU (ORCPT ); Sun, 19 Mar 2023 04:42:20 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2094.outbound.protection.outlook.com [40.107.117.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9A9F23D9D; Sun, 19 Mar 2023 01:42:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kgmv5g1w2aPjUvEynpJJqKK5W+m+yspXsOuwu329qJtlGVjOXCnhiZr2j/kbqKVPVvDFnnSemDzjaucmqx6RrHVdBKQqHSLuyrVBIBzVabbnqY984Pb+S56YO4Ws5H9LUawbUfKGz84RPHLmXfuUJO5rmIlbRtrz78mPv/zucVLhK/e4hnYBEWfjF/17ErjD2ZAp9AmdBKmyClJ7P4PrkX3LShVWqI70tdUGb2ZFH5kIv3zx14e7ScPqGLBYeh/jGYxex/FfCoS7VpGG4Y//KetFLSLy0PzoFHDFmhMBe9rfAg7YDhf5inVdjEDgfCM+7oZqcnNlfp8YMD3u0ix++w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eKaI6/jSmU8pR7rPuvsD7RTe0xNbOkuXQY/ZAgd1KWY=; b=MSLq7IYYmJ7qfcPm0G0gKQ4ZbYF8+N6jJIl4IabRppSvSlX5ZfRcaMNIrECehPxYZGPtgR58Z4R2dYa399HOBkU3n14iL85eSZsUJUnp4T4rwtoI3rKTQW946Wbf2BhvwmloRbATUx3kzaFuWJCDir0S6B5TCoqGHAXAxmK4/5qrVx64O7WBFRx/5UGsEbIr/25mxD6o76Z/x1faNOgE9d5rUkYyM9TS7n5SCyDE6rTqy7TndvILdeobeEuDanhtTrWqlamLO+7Poq+kxxP05Ne0EZ0CpaOZvA52Ngricr22/fAPrOfKgN66zVjvaNqQBD7YWo991vIroMhIhRv7Og== 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=eKaI6/jSmU8pR7rPuvsD7RTe0xNbOkuXQY/ZAgd1KWY=; b=aMnbvJaqqPovSAZOv383q4jCbMwxg4wLxZ0idbX1pYscZAOhAn1dG145zYoLAthuIZQydZ+P9wHiBh5A/zBYrPOFjsn+VrUkeR6DmH6CLAa/QMaKoAYdk+XRjWkCG/ugAYelfRmWOLAN+yu7OH1M0tvOBwgy0YrAFGhh1yA/9+IsEs7ljUB/BmnMC2iDTgVeaLhovlUnSZRlKmkFv0BzAbRMUMlaGmEPTWhXK7jNLB4fLSQxtyXhJCiQjz4LRMCHBAF/wbpLvftQNtgyGdNnRdHKK8A8+JINvpFIVdVwClC5O+D9xj/x3uFC1FBQU8qR3oZKNhRTuY6AOJTiRCsUBA== 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 SEYPR06MB5350.apcprd06.prod.outlook.com (2603:1096:101:6a::7) 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 08:42:04 +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 08:42:04 +0000 From: Yangtao Li To: "Darrick J. Wong" Cc: Yangtao Li , linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 07/10] xfs: convert to kobject_del_and_put() Date: Sun, 19 Mar 2023 16:41:30 +0800 Message-Id: <20230319084134.11804-7-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230319084134.11804-1-frank.li@vivo.com> References: <20230319084134.11804-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR02CA0033.apcprd02.prod.outlook.com (2603:1096:4:195::20) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEYPR06MB5350:EE_ X-MS-Office365-Filtering-Correlation-Id: 252f679e-ccf3-4d30-3153-08db2855d0e9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KUgwg3Sm4tuPayojyDdCNhUpdeEs0basQ0yWOaMWO5Hy8IuDOENv1L9NEdsmJ3KZV+OZqrqcwhGsPLZbfd3XfUrBAfklqG9VPvwbbKcH75/N23hhpAr/YGI/MOsw/t73A+6SFIGEPYRPexFGpPC35Kzeu8UQ0BHULykbISlYpQJE1goaR0LM1IlFOxSZx7ZHO3P7/4HJAqxkr46esUJMahtlsnknsfzyw5GP4U+7QGxQ6AI8ax5u9EBX06uWdAa4etG/Nwn2Xtmdd9dXb+FBXg782id5qkXDZ7tBzc16q+xn5fssjQHYsduFT0/BSKf6hJqbrYL7IX1U0am0+wF0xiaRyI3fZGnbrTRHOFkJsCEC9oUgVIz1liLM+rPvX+gh/LhfG0AEdmNcau8DM5B1gQqF76FIROpdqcmpZk91WB9QmhF3ElPQABuHLENwjyLH2k/s7bX9nT2X8OkhDcwzGKCQ6Twqub3KWX+H1B0JtWIvWgKh7X5vXu74/H7ytbld/f7LOh2qSUiQ98U9uqlx/HmyicOeVogu1rEksBje1Jlfyc83PjqWwORpR8ensYyD4KAgIrmsWwi63+7yf/0XgYqBDbSbCQ9x9RyjZNx31qQJ4LpuKDvuwhk71D3mKeVZWPi/lBVH2AK36vgR0GtWteLrEBF4ma2p2FTOzPiBAkRxgWGLn4ywfOMty4cdzsgZctFEN2VAbEdMev6n/aqdAg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(366004)(376002)(346002)(396003)(136003)(451199018)(86362001)(36756003)(52116002)(83380400001)(316002)(8676002)(6916009)(4326008)(66476007)(66946007)(66556008)(478600001)(186003)(26005)(1076003)(6512007)(6506007)(2616005)(6486002)(6666004)(38100700002)(38350700002)(8936002)(4744005)(5660300002)(41300700001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +dIJUrGJt02MKge/82PKlYM+heyKjDK6ltlucEmUlhKl5nIT/kZKHZcRKY81E6pdGIuAry/SnK8cje0CpCEu8IlWn2DQ6w/tio/PVg5yn5HejhEwh5cJwpseRY1GTQpEueyRzIGO/DosKJxZepLCM747cox76xqg6xNPG0HYQSEKsW7YDFAU0/2yXmkoq+sQI8o9SGecql2jgt6OLK4LI7V++w1w53GzTD9zg1U71qepWFxbravsQ8mgxvklk2n70O70I+pytAnGtd3O7/vS6u0CkzvmRPU9RAyix+Mc78mrT/3ULXYYeoa7rmFByDW8RlvlNqjL9tmQ3121BuNFHPKirGPX00bCE3GL8Nlx4nZDmjywJZV+HT+7CpNp+WyWXSQVAKojDR6UeZvDm4MC6g0mC5o6C0xoeWBWNyhCI8kxDZntw0r2ULLl9rIAoLscpRKcWje70+7SJHUuJkYtC68wcoRYj/wD2zasAJd+2vJ1R0ds0eWA3hPPePvPLYtuOiB6xEyaCNwTZmc0qZXAuvrNs/o7o7XF+rXL8QZ1l7MJqWuB3rZgb2Ww4an9Ih488U+mN+PqbFyyoS/rmL8ZhanxjxzbK8CrbB9MnuQtOaU7H8F0vnoM5d4hWbAOUdzIznEzQeW0ZmVdLKdTTDu5K/Tngvj3S1/i6a14cVX1anTS6ID+5OlmxVJAicjqQlNZcsuUV9/z1FH1bdMW64G8+2TS94oQdOZeeAnp5kvL4wFitEMvFX/JzEOBzGI9QDRgzEdfhq8UplUaBqpvkII/2oi4ghave+4VrXwoJidJksU6I7j4FRGAqjC4PCKLmTD1ghO0FcRVXGpryjUcmUGORFfgH63AZdvxSU+78iuyTXaM+xggGXtAagZoNlfoPiQ4nLzMli5QR06taiE6x/IDLj8cR7YE6Ea2trKwj/QOQ4yfdRGbVrUvYIhipB2431ZloPvQsNRgLJwo4E0C6qb2nAUfYL+TpohIZ99DBtRjYPZEFD3CwF4xeBJfmLOhgCcJI5cZNF37koq75eWTOI3oHkiToyNFOcNn4hklKsgcWA0ASvy16N2iIShCtJ9lAbnIDe4XgbY302vBBk8XUFXDP5PO6XzRSe9wgsmyD4nfm7VfBK/ZhM5hjf6Zur/BwLbQKBwkUU+8nQHOgwkFHieSHsE7iSyCFPu0yDpM+B3yGauT3oeL/YJ4e2OoQ3+FNkg2Z84xCgzendUIa8DHoAhXNw7tSMHN5k6f4a9qkNsiCmSz/dla/FBJs/XIxVIm/bcb1lkKfEGy4FZFX4WQ2d+Om3Ak2ZwTwbtGZPNGcc9lXSwRTAirZrbk+n9RJdI0Il3Q/tx/wmvqsvYdbR5WKaiSXdx9m2f6b2Y6L4Iw/8LmYyZ4Jt6UiHNUcjE0gtOSsWqV3IdA5wgnnNvQeY00nxOc+x2VNry/6HAh96jgR8fZM0McOiylTq//8pbI/ZZsH/aDi6sli3VdPi04axmkIyKt1U7eMuXnSNOuGtlpxe4MIh1rfTqcYiOnH4lewpD/NlvGc6DLnxPBalQfH/CE0um21ybuRBBl3j2t4heA6ZM5eMwVDBNMxOzZNfWpxb+joUc2 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 252f679e-ccf3-4d30-3153-08db2855d0e9 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2023 08:42:04.7050 (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: mSusfaTuZ87auyhgNnapq+irXKXHWCZMNpADoKcS7PnqvoeMAi+iwKgIEgp6g00oF95Yrb9ujOZyhRGbyzlwQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5350 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760785484292963295?= X-GMAIL-MSGID: =?utf-8?q?1760785484292963295?= Use kobject_del_and_put() to simplify code. Signed-off-by: Yangtao Li --- 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 08:41:31 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: 71729 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp641067wrt; Sun, 19 Mar 2023 01:50:41 -0700 (PDT) X-Google-Smtp-Source: AK7set+lFObLBv9pQOMQYX33w88JIMfilinD4GZic0I6vBIP7sYB9524DIM9CafQVxntNJaYEGZW X-Received: by 2002:a62:1b8a:0:b0:626:dc8:b004 with SMTP id b132-20020a621b8a000000b006260dc8b004mr8238674pfb.26.1679215840679; Sun, 19 Mar 2023 01:50:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679215840; cv=pass; d=google.com; s=arc-20160816; b=bxdq96ElJ9YgR5R1hd4aY/pHRyHxGTkL2zSqVBlGaLu46yYKsmN/ElYHRKkgnGU7FW ctWTW8gOn5uQviY5rXRzR6oIDFV9k6n3jf3EfEZkeHOpj/S44GRyI5TMCynrr+G2FE8i HTAQQ60n4imxEUXKJn1VirjqZ2hh14mLXRwEac/Swk7fG45G+J9vqmFQokQ6cUmgHpY1 ij8UOnA9RimBF3iYRt65ARFZUryHH9q4z++hZvTHc81VixtcQCC73Ff4QjreS4Eer3xe N+Rs4a3zBmyEwUTIy1+M+oytdO+JRBm6Dyw77sZZNjTYzLXdg3YkhyXmJ52zwmUfxU+1 HiJw== 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=gaz7sro1mufIsFtGo/KmH1j43gttN9A3IKPHYDRmxN8=; b=0tcaZxMAp9daWui1vFk1qG9pbNu6X9FWlcedhwzKovgus+LE1RjPJyTCqBCTLV8QPb 3m631IUYXrnU/u2syJSNdnlnHgIvbvEP6EeNOCZ0SBZ5RCXfL8jsAOI9p8KfgLDI8/wF mgOEwHkIdJS9Ex2DFwxyPUudxeZm4KSjiMQlRjJja50Q1FR3O0qZgk0kbGZs5hR2ofDv shhWDABwb2GT33JmxQvOsiRwkgHVV6+wel2qeBfPoEtTT5HTJyMiwt5ITF7725gKFReR gUFCdSsIWJSWTb8xjLuTMjEYVEyCT/6ueAifz95JLdjM7bZoWrsNWXEVKPr5erkA9IUu Rk9g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=U6V+YN+T; 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 s72-20020a632c4b000000b0050747f3cd06si6462692pgs.638.2023.03.19.01.50.27; Sun, 19 Mar 2023 01:50:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=U6V+YN+T; 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 S229561AbjCSImx (ORCPT + 99 others); Sun, 19 Mar 2023 04:42:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229648AbjCSImv (ORCPT ); Sun, 19 Mar 2023 04:42:51 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2094.outbound.protection.outlook.com [40.107.117.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E74892686C for ; Sun, 19 Mar 2023 01:42:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hJXnn42dupxCn/aHuoPhXc1MJewqxf5DQEi914iewchXmxgf7B4urbDMd7vy2GgBA+InpHukLnptxAcBim1uHM0F/S0O/ig47VMbCrKH1vzV4aUhgjBVAJMqFAC6bfQe30kNOdQaOMlHVOIxrbbwKbvAuOcOTcgH7a1WMF+7BKqTAGQRew8GzNqYvXvw7LNZ/Tf6TUp+mTd2d1jjb+si6x9toOJEcTgXMgUEgv8bHV4CZbxaVZhl6W+hx+9mGQI0Ed36U9hI9uwtnWhg/kagAropb7Jn8DI4jz7DMM7yQrOv07Rlg0eZp3V9HShgdtZPtGoaS1lqFPawvaZcRAxIsA== 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=gaz7sro1mufIsFtGo/KmH1j43gttN9A3IKPHYDRmxN8=; b=Yb0s7HzDWYBmeIlYWcEdC+zUuwgh8L9PecUrJLscn2tOxqhcBmw0/JGyFliAS8wM6fuYehC5/8WGciNedFc254peauMkfa/Mph82bYpzqFwtZr7ifA8EkUeUEoGm88P4qnlB3rkHFMPlOJ47sbkVjfx8KYFV2x1iSMPPwArhtnHH0aofi4e9hTP8xHkLIOkz+lp5pVgA9oyUFRVbly8EOydBq0IvmDxMk+Xj969rRxgimuuJD8fs4Co2UiGdT/J/Q39jMfqy7RA2gK/yfjpWid3mTKluULdFOYzq14TJ/nvVfU0JzKfUleQCihL9Ru/l+/bWGRUv/25hBMqGCZ3wqA== 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=gaz7sro1mufIsFtGo/KmH1j43gttN9A3IKPHYDRmxN8=; b=U6V+YN+TCMI1JvM+09xhAPNn5qJLmiivicecQMHjisYYMEqLtBYBY9ZRoaSaSG5PIrKqSrNYL1VYvU8VPYDqFaFj9n5UNBRvwLav267zbhlaM9Ltm9gWMbeebRIdNpvzpEYUnz3ffoCMorwgAxLqdmbkDwEKMGVhleOJjrJGoGbR0XVycABs1lO2+bxpP6/5/oS4CFLYOQCPGA5ieAoZA1kmBMvOTKvxQffF0+7KtZyMckDiDWpGnZtXIyGhkZO9UGEXsEpko9o8C9YAq2lZO3tvwPGuZvtPciPW9oV3XAzwaW8QQjNHMNRii5a116jz4G8cSRr8xhOlDQHdk0K3Qg== 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 SEYPR06MB5350.apcprd06.prod.outlook.com (2603:1096:101:6a::7) 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 08:42:07 +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 08:42:07 +0000 From: Yangtao Li To: Mark Fasheh , Joel Becker , Joseph Qi Cc: Yangtao Li , ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org Subject: [PATCH v2 08/10] ocfs2: convert to kobject_del_and_put() Date: Sun, 19 Mar 2023 16:41:31 +0800 Message-Id: <20230319084134.11804-8-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230319084134.11804-1-frank.li@vivo.com> References: <20230319084134.11804-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR02CA0033.apcprd02.prod.outlook.com (2603:1096:4:195::20) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEYPR06MB5350:EE_ X-MS-Office365-Filtering-Correlation-Id: 32019a8a-39ed-457d-5b04-08db2855d251 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ajOiPF8D8AeqrOC4LS/FV9TLlRp3sXOc1Vrd7DVy8SsfK+W9EUCzMPnz8vFjCAZwsAdyzGRIrBGv+t69aPf+2Zvn7MJIF9WqF3AzQYqGgpv29l+akxAYvGjBOUMPmZtRN4+KIU7TGe5iR7/MxDk/0eN6VyYy7XU7irqeVXrPjQH3DTkB6WvbhbTRURRthhmPs09Sa1hF+hfIRp9+Y6Hsnc0nVmof1HD6I6xQIFoJL3yRB70BeFB5tqgJjdTsbJMzeaNgMbxM/RFd5N2th1mtUJMSZBj29ZTg6sl2bQzsJ8lTxlAwdeYKkZIP9kFA+Yn9shLndlgno0MZXIYM/fzUegSU3f+rcNueF4aQZWpQ0mdELp/+dVbzX353qUVTbUTa0+ZzsNbxUWhQsUemDLGEoX6ZzqQ+7gLhk288yDXSoD8fUFw4zTMlI1UifQDSQdfZHReFGJEnjV/ZtcPDKKMbAouG8m/O4+wNfQBha7tcZg8HF/ez8Y8xKFgiLB7/04Wuaa+NQ8yIuH4Eb7Z2YM3rYMl8KRlntXAnDnt6wQ3ucvxV5BzYIrhYOB45Ql5Bgc5iVCKb7WaYtz0Qsi69njwx4je61IP+B/rXt8+SnydhfNN3L1K2RGDCg6OJ1An7GGLGEWiH0FyivJfvZaIddHg8MGZ9q0RYBc0x0G9XRRgMIABan+YhyD8EgPteDWG074MlT1hJGtMtxa9XXld8wB9n6w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(366004)(376002)(346002)(396003)(136003)(451199018)(86362001)(36756003)(52116002)(83380400001)(316002)(8676002)(4326008)(66476007)(66946007)(66556008)(110136005)(478600001)(186003)(26005)(1076003)(6512007)(6506007)(2616005)(6486002)(6666004)(38100700002)(38350700002)(8936002)(4744005)(5660300002)(41300700001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VlU0kjacWlZOW/0rCPcU3wNLD4fttd161KHqZxuWXlLSrZX+7hHfrQTkdC8maYWr9klOitjAl2FDKkwEkepPUj4WesqnQUI1O7TxwrIQtFA6x92XpWrhGqcBxhUurv3Xo9tkKHUUrdGTwWgPA/aTZH6U3Upqx/ayHGZ+bMN3XyzrkwEyL1zct942F82EIyjZthIf9WU1OUfdmrkKFxSF7jGx2pQhv84LZfRkkOqecfVQyUdEkqpqbjlPZ4GapE1W6/kynRkArFyITAov7hVhbIO4nbUhbkEd1f0fwQpIgb/wj4Q0MqoUXmqTezEGtNE3XXDN+crGWrKv0S+ByKzNOQrnY3zXNNtEvqI8Wq0HfQpUDBkCq5WtRbJwR5qBYXnzpCCv21cw9IoC79Zokn0+stQ9VQtqTafuvX0bNro2seUTRJwdwvG5hGM9woiffbEAtNcpFbpdZPCMHPOyhUzkGX3DOSEUjlj+5u66wP+IDY3w1rDX9z3C7wJs2RBFXkETuXDtxHJ1/TbkvlkCSO0XFD8tJ8l6JH9IYMRfMtYFEQY4VwtUrsTgOayLKHq/8lXxKwVPUPUjWIyZjOc7H75VUnUR/PcYGCrHLdvZtCKsMSYgtpJmRBQlxXplMBm5NXTwEZzTy1G65rztfc5N5SiqjfN6EPygypTx/BPiik8FCh8m7pNVlMvj6KlD+m8ct+vKC8b2BqTttEHoiAxkTf91gi8KhZOMwtf8b4BcAgN2a1laLMzHacdJBta2TLzyYizABt82AjP8J3POrFqhi5nFphq5nCwmVenkugSLeey9jiKCxu96ZMlDC2idjkYmD1ujYEfkTKTnmBqndmkHgfZmU9omE+uE3V8hSAtqX35K3do/dg3CSu3A368zxfUg9wRKTQTXQ1kWWnP7bQQJsQoxXM82whiitAMHA8NC3UqOcj5aM6DMomFjTsWWYZ4iqFQTsjVtMZYuXqbgLCW4tZcsTNm/8OPms9Q9fn4Y/ZHJzCtupXOP1fFfxMCHtb8g27qysESvABCRAjfgqHq6t+92rNbUjPHRPB+wP/LfxYWntUgPDJIPLGncXNogG0lxxqf/Soi3RNfBttmeKlPC8MO9EZaNIH993D79zYuAFi8FCWpXQluAflu232tD/vHZMleGiNcgAw0FwRNX2JMqwzSceW3tJ4hrYpw5ebP8MXvaEFqKLsYOpP+2sgfPATttd+IyywZAjjiXgj3efgs9gVvRvJza663bSLvF4ZK2phioMnHVhwe1g4adU4N3YQ/WglWbgH22o6WuXnJVEOAAmxVhbf1QEV3Mku2p07tOKMOfieVSB/poL8pb/wtM/diBnQVSCSwkSdnBPeOaImgG9m0MR+jo+LV/bJ9XmAHu+QZ5T4dCgLt1GqOF06q7KqhC/dHhly1qoHqQG1fUoSoobGNzXnUnPdixZsa+/NRCM7Dhkr1TsxxmUZb8Zqqg0R2fsIK8gt4vDDgr59aJuc9io9v19n6BLSTxZ55fqe4A0ojZ892pXSTGlUOyYZGdvTl/Mu9aA8Rm+HOqYBLxrltGZjT1vzNR7mjp94V65G3PTcUEicBbYLjgdgg/izmzN47zsdI+ X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 32019a8a-39ed-457d-5b04-08db2855d251 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2023 08:42:07.0653 (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: GvtUHCsDKmudGeN33oZdCIADbe75NO6GjYl/GToOAygYWhYUftcojTxBoLP00iuakud5DOUWfvS5BV5eK+dIqg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5350 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760785428927370710?= X-GMAIL-MSGID: =?utf-8?q?1760785428927370710?= Use kobject_del_and_put() to simplify code. 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 08:41: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: 71730 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp641239wrt; Sun, 19 Mar 2023 01:51:28 -0700 (PDT) X-Google-Smtp-Source: AK7set/CPBpRlYJ4itm2Vgs6hrhWBYVC3DOJmbvi9LmgT5tOjMRY8RbWEi8Mcy7bp2+s1FKKDOvs X-Received: by 2002:a05:6a20:be19:b0:d9:7424:342d with SMTP id ge25-20020a056a20be1900b000d97424342dmr90525pzb.22.1679215888079; Sun, 19 Mar 2023 01:51:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679215888; cv=pass; d=google.com; s=arc-20160816; b=Jw+p09RvvkrnIJ+PbarBR0dXAmsicpPUC+uX66ut5aadS8oAEOvspzBYwpnH+dNizv ihQ8CY15gk1x4xHVor/up+C6BZ+AN2Ta7CBrcoeDAoRpU3e7D3BtOq8uvoJ5HtKlr2tq jUdr8CLpE0OdNTgOaU+7unYKYjXFfk8olbDfQWgJtNgfHHLq13f7/md2mTydp69/aheS 6wI3pVtslzq0nyFO24h0KzdP3VJHM55w1rACJI2vX8v/EzsS7oA3Drsz8A6cMsCACxrl wD5smwRVfUA0Ic7GSLt+VOr1nxQzdI2gxJaO76NqTpSN8UH5YdeRQplbQ4TH28vMA2Cm 5Fjw== 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=7b4MF4ufqdI19H/lNLWCOS7kOuCLRTYdgbXiYjutT1w=; b=JuFBHpwNPpXdceW/WoNtrSycUpMvZ+71sSgxbQAagC/bNhT/6XfWx5lu7aZ9qQK0a8 0uHJwX7VCzDpY2tZTaBme+Lq9Fa+NMulifT2pkvfyzteGJOJQ4eCJpyqHTUXDpJ1suR0 IEJovMp4npBRI9Vh83s5KqXDug8lMLCIZhvnww8pN/NMz9QmlYCP0SYnFfApCPXfLYvW l/UxHql/cN/WajypbNwGBQASUar+Xh7QLy+Qrv0EgA2SiYMLEWBlryUU2zc/NKOTXwy6 QQPEXcedRCbevYkL1+lP2CO5DZGXsUV/vf9c5jkKTj6nxH258MRZh91GxAjy7RpnMyOS 2cDw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=DvPGhRO+; 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 19-20020a631753000000b0050bfa82c245si7037351pgx.855.2023.03.19.01.51.15; Sun, 19 Mar 2023 01:51:28 -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=DvPGhRO+; 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 S230204AbjCSInu (ORCPT + 99 others); Sun, 19 Mar 2023 04:43:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230189AbjCSIns (ORCPT ); Sun, 19 Mar 2023 04:43:48 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2071b.outbound.protection.outlook.com [IPv6:2a01:111:f403:704b::71b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7594812CD6; Sun, 19 Mar 2023 01:43:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XW2VX3n7FwHNRJRnVyPdmFvdalIHOpKdWD3yteNZ7INJ3xMj016qVe/+c/lWiqw5ZQi21XqWxv7DDV53Wbmrk1I0BS12ucjVCQ23C5DGgwjYd/0nQhh1J6cTnwgclPWFwYIjBY8YnAxsAMZzJcMA0kaAszbtMhW+3hD9tjgQVSpH9lSQIL2iSbTBLoKusfuMj5P6Qv8zDq6sjFCEWO3PC4WvRbOo2aio3b97d3++Z3Jb9B1JLImY+wRlCGWp/RRcErUGoSsPlxvwUIebbnDWm6mQUgiSb32PRocnL4XF9xEEtWNeJV7zq0BxFj5TJjvYckGfWe58/S3h84GyZk+arg== 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=7b4MF4ufqdI19H/lNLWCOS7kOuCLRTYdgbXiYjutT1w=; b=Td8BTiLpdZPDab6e6dd/40/gbC1BcEe+ad+KxBx5coRCtVFeMt7ixHeTee3wap//WK6F59TlRkxVIFZ+f3TYxkc39LV9fAuF3IB3wd32l9u9/egOiaB8aV4PJ4JLBoFJZ1gywPR0kU1hj26LgncG3iYh93MBb9sALoRPtN3tjmbs89jFRh/Hb5bHooSDhXZI0+YhNVcEmuxGOes/Y2/jijPvHth5TtYqlfxjBJoOnlaN4DM6YUhFCKQyYkQZrFOs/Np2CMLvju6TfyPqqkx9U5FLFhtmib/P+cDKtD9W1Yis4LiwSI6VQKrpFK9l0PLqZRz1wNB2tlRQixt/pry6aA== 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=7b4MF4ufqdI19H/lNLWCOS7kOuCLRTYdgbXiYjutT1w=; b=DvPGhRO+fLla80J6Rz2oYwqhzi/PqxbkliXRaW9aplUPihpj/fmrowywEcHkwP7JmyAcbOVIvsdIoY295/F7hAFWBn4mVEL+w+fGC2btWh44xKHSdw9A6USwC0/DiAaR32doY2DgQJJXoi4JlosCj4nk5gTjyTnuIi5J+TisJ1V/xQxP84Q+gJkWQGDP1MiKtMmf5P6lpwb1NYqId9X60C1Rz04yGLlDgyvzOqjPsHMo3ydE9UlJy8nwkSDa62no0m3eO5WienuKNwHTpzFwfoFtt+fiLdTITbMiwePwBIlxONkrMYfwm03S+YYe/Y68N6mGwz2Uy+JaldKs9qyeUw== 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 SEYPR06MB5350.apcprd06.prod.outlook.com (2603:1096:101:6a::7) 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 08:42:09 +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 08:42:09 +0000 From: Yangtao Li To: Trond Myklebust , Anna Schumaker Cc: Yangtao Li , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 09/10] nfs: convert to kobject_del_and_put() Date: Sun, 19 Mar 2023 16:41:32 +0800 Message-Id: <20230319084134.11804-9-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230319084134.11804-1-frank.li@vivo.com> References: <20230319084134.11804-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR02CA0033.apcprd02.prod.outlook.com (2603:1096:4:195::20) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEYPR06MB5350:EE_ X-MS-Office365-Filtering-Correlation-Id: 77b94f5d-ca75-48ce-202c-08db2855d387 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H4aJusP7V+Brnfi4lEMDsnqBznJku67k1NvNdlCSp0E+skSC43eZLRJ3X9GVQIuFl/X2bOcs0tZ3C8NUYoEBZpeKQzOxbXORv/onO8r51i0ysv9XqbDGhQwdEgELluYrlPYRdYVlhNXgXZQ4PH3I+OGldl5P4DIEnzILug4aRUcvolrKiErRsB3wQCOFdMXDuHB5KmAoeGnP/gRmoqLJ82ehAPKcYZrQ326lYdFTYuMtip+TvsbocOwwBCmNRTb5LdskNVHkXX+2FW0IEQ59rVuGe5eqN88prRgngfbEjUsp6Pr8iG1eXeN9EAxDVwHav25bVt0y5Gfo8WPOitH7zPi57lrpKMiTGU2GNauzRipRRr0RdqkKoP7DDufK4wnfXhZaf73oLT3MfCCIFlZuFjqjTbWnl+x/b3bggzcg6QmkTCXrSeKiVhBzgA0Y4G7CFYnMtp52qqT0PvERdL1g0yt9o11hLGMkK3AiSNOD5K6WyXnY5q1+s/Sn3xi19cTOONXdKS0BzQ1gHOZCDb8ydATCDwMMatH7BHGMKdpSCfN1wYT3IBw9OMor8MToQKh1+fUbU8w6Ls2I9nQezEAplGewjJb6E5xq6FKcFErAtGA5QHog3LGHwMymlvNApsdvVrMptBTM/71k25brGXRUm9kd54CV8n8IEU3VeAAc3BVxNIY6TuvYW7+LMQ5l68hY9ilV2oLBXXBTJX4JhZqfCw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(366004)(376002)(346002)(396003)(136003)(451199018)(86362001)(36756003)(52116002)(83380400001)(316002)(8676002)(4326008)(66476007)(66946007)(66556008)(110136005)(478600001)(186003)(26005)(1076003)(6512007)(6506007)(2616005)(6486002)(6666004)(38100700002)(38350700002)(8936002)(4744005)(5660300002)(41300700001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5JvAoTixD/46RWbmDw8JqdXPsun4wjd8ctFF92D1CVbTuP2Vwwqgi9N7qN3J6g+wAwUcXYmzEjLZmp/Fh+K4FqnF3/x7GMmhZVtdIr1BCBtptMz6rBw6tD66dVqmV98ibdyhjMTuVyEuNBDKDt7iGEPOIcCwdeziR3Eg3AimseqWHktQ3J/SisKhHQCLBWh6fqDop/Fw1csgMsX8sWwmw84Qlhjyte9ZkmICX2riutWF8JHhNpMjBs+I67g4N7vrU9srTovAAXYOYpMCWv4dAzL5e3IhxzAs07cOYlM+E3syJDtLiT6rlDoIjnn7tBhV1i6sp3QAHsnet4oHiDQJ4UMNn70Nn92+ldZnrCsjXGgGUV88XEvAr7tKprodFK5SBsMfKob7ZR33ZOZIZZ7rirMdF1Q0t/A9gy4IZbVpvfipe93N1ks8eyrDQYE4inDKgvEjQwHPTZysxeHKFDSI6ot7wwBMTgS7/AzQLv/IzNzlOpU9NzBwHgGVpS0PPNlQXv5pXNHB2NXj7+tMk5YtzzmVbkiQImQO8LsQgdMERyHQgzImYLLwzo5Eb1aCXFKgrz0gC10PYuJzTXF2MMZwG693E3sl7CggU9AzY5KcY8r0lpT1ZF0BAlR0Zt7dRkBYaBiJGDr5kmt558UF4HZ5g+bt4QJWKRVDMeai+uT7Pt/eEejOEsgXvQyZ5zkSRP8xYJjyzmssnNUaVuRSzQEJQBF4OAdQcIxg6s5/Jm9QozXvyw7xnOzHH1kMi7vo5JT7lO+xwrBNLmMkRM79j80xjyyUZGZhexFHiI0bdfYuJQBGuUhpRWr/kEL02GPHId7xqpMmV4L46fwuUK8QtmZ72keZDYKoz4uDTlt95xuhxggsys3ov/4XYecuAemtij7ha34aoyEmr7xfMvviO4Vks5Znt1riJ5lTAS5ol3ATFVYwnkeqjtT2thuRjQ5INCJHi8suFxB/2iWywtli19izHwwh9oiShDqkLf0R+uzB/slDw2PVwPX0PpVKcNPXVFCmDGC8Hu1Okm4rgLvAZ1CV1uinH747Uf6D0IBMCM8EgCEmt+9fEMqUYj2I85Un3fM5dcrdvbbPx2H5HRsMxq0kaEW2ZaN7kkEo5OjYchOf6csJThUoaZohHkxhFI9YQSuzrtiIM2lMJHQ2ilLcy2apkYGsFszyQnzmd/BacbxoZoecTTIsHVkB4uineFr18jB6A5U4oPWhuiawSzUETxu2DAq+A5DQWC2gOBAy0YCGOvh+3FFW5l1j6yqGMlO/XHp7dIGXq2dHQWksVmPUrzX2T8RmNAOblGtWHL+/70XWZTcw0qs3WadKWjfpqgDZs2GNGvAlJd9wOXtgthr13qr34PYxtY/vl7luoGAkhvyoCiMuAOHyAI79Lpq/42jTstnflifZ5fQVIWOUB+y/qOgWZYyOTKlymGZiC1WaHx2NGZUSJHPCB4YILLdqmKyZ5PGPPkKtQUXVlLdPbWiH/61u3ld9HAbTWQvkV7VI+KcqfNAQrigqAD+q6TXwFkUbALXbnlxvXwAdS7EuTvX1qeiTCC83hUmfvgnumyddgc/2S7f6CtLIyz0x2DJSoxgSlmm4 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77b94f5d-ca75-48ce-202c-08db2855d387 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2023 08:42:09.1111 (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: djPeD5CeIA3F62Ojlsf71h7w2oRpVqa8GRoxAg5KIMKuZEueDfb9nFyr0/hSBYfAt/+AfyqGqLcf1XM1+QP3XQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5350 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760785478892588259?= X-GMAIL-MSGID: =?utf-8?q?1760785478892588259?= Use kobject_del_and_put() to simplify code. 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 08:41: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: 71728 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp641064wrt; Sun, 19 Mar 2023 01:50:40 -0700 (PDT) X-Google-Smtp-Source: AK7set8dXXZcjXZqa1+f46js4edX8VSvmoZlu2UzW7KTIibIaDNLL1tMhOF1rQwWJll0+3x/hjGX X-Received: by 2002:a05:6a20:8405:b0:d4:f98c:8678 with SMTP id c5-20020a056a20840500b000d4f98c8678mr17404406pzd.19.1679215840161; Sun, 19 Mar 2023 01:50:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679215840; cv=pass; d=google.com; s=arc-20160816; b=ieb0FSNNo5KGcaabN8orX4MA3pAo7CUzJPA/W9Gol11Y2noDgSjIHHLTObolj5l8GH RYuRVLY3C7u/61czlIRlcW6zxYUeIkXp88eVqxxXnK7qvhzlvfec0Vnh4oXLL5qBPEOR MzL1aEvl6GVDjydMuwjnGYzoC7rS43qwLhys39yOxltOVgXw8e3jpfhPc7nWT6uK+l5d 3Raj0zR52rbAI9n2xWDQXVB94JHZgfttqZt9AeOOgk1smiWtSs0tBEnP86RYmIxG7wbs 2cb+i40Jr2DU/AvI5Tys0VZk3G+3oO1kWglzTJLqcK/Dp1azM9qYAn1hapukAvgbmtAT HR+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=cChoitUiIc7ttW7uWFlm2vga0tLO+9+UHdJAAvZFHvM=; b=Dq3yY/Aqql/MTInSDOo02xmjJc4HFDvtdNnicl0xA3ySQJPZIQmIUDUikTBr5njTuc raBsPHpdvmcNC2HeX73xEbgmZIVZNRe4m7bSdxSDAAxynoICPlhZT9ic6BvrN2RLgu9X jTNZKGUkKQue0itl2O6gKsy1ph6IUuh1sAbk1Q3JJbBD7RNsIIf5HSU+smaJZO+BC7TX jWw9XQ/aD0YbfLNCp4yaY3S+BQpTWsKOjT3N538qeIIHN41Y7Y+6erHuwfftL2JCDnEc 96tYVUccOiYd/EDyeyUvjMfNFXyJFJs5F8TDisXrqpDod0rReAMbvxHztYacpe8VdVC8 Y+uQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=E27KLRg1; 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 fc5-20020a056a002e0500b00577c17000dasi8017850pfb.166.2023.03.19.01.50.27; Sun, 19 Mar 2023 01:50:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=E27KLRg1; 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 S229541AbjCSIni (ORCPT + 99 others); Sun, 19 Mar 2023 04:43:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229648AbjCSInf (ORCPT ); Sun, 19 Mar 2023 04:43:35 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2094.outbound.protection.outlook.com [40.107.117.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B002252A6; Sun, 19 Mar 2023 01:42:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VYqkh6JgdJdfkS1T2Txg0RCOc/YPsA5SfaCviQtKoGRPiLPGJk99PThdmdNQHTloUik8CtCnh/cEqnO5B+PfeOwq7ltMN9vb5OmParfjgw9KErJHfHQjHh+DUOjvdT5DCKzlPkEg0u9Xgk3E7mQ7jNF5W9ODgfVOdO+Tyzv2hMkszn0bzpe4T2jXwDeadtTHUiT0TIj3YF7gKQp94hhBPHx4s/KWkrQZ8cDtoUpDbte0igGKQHdwhuDNJeIT8rpLeKWPFqc2TQa7157V9DX8XGAr8sQdXCS2bsFTRrmRF9PxCzHcu2cdijnl/MNPgAuYDtZfXiMjsMaAkrIeTsP/GA== 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=cChoitUiIc7ttW7uWFlm2vga0tLO+9+UHdJAAvZFHvM=; b=kQhsZsFbZccJ+AzyDHdxJ8n088gHo6xI+6cbyT2TTVGOZmMbTOU4ALs2gQMEE0DaG/DHHUd3Rn/dmC+HqsIbJT9oAgyY3zrhoq112xBvzB8H1ngSZZ+nkdHqTiNfgd6lpUadFsc4fzR1Da0MPQGRcF12f8lP24uMjt4127waVzNc86yvMTyE88KE0qF9A/oDRKljE3nabg0FT/09WlQ23fXHvhU9obNrWS0nedECjJYFvQ04jABy05b1VMgFyl9J365GAO19KeWQcxlDOd1N84Qonwhvp+61Bp3enavnzWSLczzVg6gRCrk5epXXkxltOtQsbniporJUaeiUTk3Brw== 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=cChoitUiIc7ttW7uWFlm2vga0tLO+9+UHdJAAvZFHvM=; b=E27KLRg1vYqXBeNlHnnsKgM0JBaVJSmjAfOD0IVf5RHuVkWska+N1SOFrEz3mQdV7lASzjwEZlwSAUWBM5vrs2q+G9Yq/ljWpqaAzqDsJC8+7uD1TXim8UOkcpBOMHITFY8eF51SO53bN0LM0uEjTAZo6HTJL3eu2s/e0cfvf1yUe1p03M/LbPEbDk0C47HVhQaONYx89XjXQHg7Mql3UJ7xnIcx4o7VcYnFMl6lwB2qFRe6sHj+IUhZ94Lu2+Sxf0zzqGt2PlHi+c8ukhG5PVvpug5omqgVEpfI44W8e4rpmHOW/bC2jDrMe2oPLi+30jdryjvU6kcKkETcgwPvHA== 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 SEYPR06MB5350.apcprd06.prod.outlook.com (2603:1096:101:6a::7) 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 08:42:11 +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 08:42:11 +0000 From: Yangtao Li To: Ryusuke Konishi Cc: Yangtao Li , linux-nilfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 10/10] nilfs2: convert to kobject_del_and_put() Date: Sun, 19 Mar 2023 16:41:33 +0800 Message-Id: <20230319084134.11804-10-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230319084134.11804-1-frank.li@vivo.com> References: <20230319084134.11804-1-frank.li@vivo.com> X-ClientProxiedBy: SI2PR02CA0033.apcprd02.prod.outlook.com (2603:1096:4:195::20) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEYPR06MB5350:EE_ X-MS-Office365-Filtering-Correlation-Id: 0883deff-80a3-4d5a-21b1-08db2855d4aa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9tQJ6TyvK3AiKHSk3Dzc2aQ8Rg+LVOvteoyn2hKAMQt/Nt5G28c6njLYbnJJccrw7hkBZvnk8A6JkL+SdeT1dPhdaTjsh299mBUABN8T9p1aBmlX2kDaGgKLpJsnGRifvwMWz859BzZDiG03chQTI1Rn4sX4gvllUJzDaHXqpjBN/kfZ5Lf3zCFb+QUILNTzLMg9dD04s3b7wThEiDmTLNxmJVhNBSmgRAmg1mforF0/uo/mGG74B8t4bybustsJT9UB3S0vCu8MHVf3iKXWntnqF3v6F9yov14f9TPka+PDZKMigzyVhU8mvzcxCbTCka+jL5+G3jZldJE8FAqh9aEz/ubowamc9tf8vRGISzy1RJID5Aa1cWVdLzLL9nuGKPGo/pGD9QM1hfhu4GOCCWFnR2RDiwzegOCc/B5LqIxRMrF1LDHtyBZD+C6NoydxK9ATLpLIi1KNoT7uFjGNy9XIyMVhIudzqRtfj+KFhvrJBej/RE1M4Zsgi+MSlZboA4H9/VoiT1OpRcNEltzQuXrorRGmbhYXRLb6Jg8f0G1gGZXUHipMcbTJgi8HCl7UKqJuHgzRDEWggzT9BhXZjOHpJ1zwzDmy7Mtejm/MxclfknlQKQqzm5/oXnHtxxiWqr3Mg7ccjKqNPzhNe+Uy8uGGhcaUQa74EB+w97vBnuWxqk2ozFKpOYFHun9eCXpWSJh9vHWTPPd53tIDnq5GMw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(366004)(376002)(346002)(396003)(136003)(451199018)(86362001)(36756003)(52116002)(83380400001)(316002)(8676002)(6916009)(4326008)(66476007)(66946007)(66556008)(478600001)(186003)(26005)(1076003)(6512007)(6506007)(2616005)(6486002)(6666004)(38100700002)(38350700002)(8936002)(4744005)(5660300002)(41300700001)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: H45Y/t6ZQbRdqBZmmfZcK80JUPFT+Kg9FwJ1HkPKwSD9YVgeLj2VA9cfgjYm61gkodR42qy9gzbUbulWWGRCaM1HoUaR45x3k2cFVL0WRVtX69JrFz+zlDTlcqWTEOMP/5cqGluZraK+UuRkP2j7Azo3Zi46IP3a04XtPARx+cTbcRtdu6iMr1nmKUYXWo9DZ8A0+XZOmpUDkcZOsfGB3H0ZXEddWBhRzUmV/3AIt5uVWBohjBfLIqql/HJmESw5/U5TYZl7dx7eGe+yHY2i8NZJrmb+oNLgfwTRTZiHhaZqa+dr2D43ubhkZJWJuDuxqQPryiOzrecclBG96jF93h3Ef0VBcEkPzwuLQ4HAupxjgidgFjMnse9rj4Ll+QT5OMdefD7wPD6SrXNGCAosYLFuX/dN+HV00/b8fkxx0JBZvCZoPi5pepRG1AW0gFoKOZwRVK8I9wFNOdZWXADZ2CiwjEzli1JNQ7AExpaivuknyNNJlfO4oiamOJ9PbUS02g9s+EonrtTNqlhKpBtGgydkbYoc+SvazuonEQwmwqpGe/K4MjMzYX9pYZl1Fe5iDxyRLcWMMTwS0JBJOR0luKXBeAjrhkgmKi2NGg64UZP8B7p/3ZPZUxKJTOFrSxoOuJAYfaS0wPnUB6t2ywuOWrMF1lcRTus8f9I9lGMZG+v4G0e6pONrcri/cM+c5lWwwkSpZuWUDUeqvUbHVXutNCozOzr8sBQXClLDMG0GVlT+Fk0kcj8Pg55wr/9JB7VThVCjg575fq5i88eyQAKp02mZ75wph+LiLSnFWmnLL5jpWQiwmA1YajKnLLS7Nthv5OsEWuCQnIiENGmrfeMQpR3sbDLU2yD0U4SbeWwu0FH8IaeSTQeuz/y09bMCljkU7kIVIDA8bm5+poWFSPlf/dA3NxX7AA93fCNmUmhjLjND0OSeli59Ex+bC4kagJNM9/adLSlkODLva16nm1A3oXOMbxnF2woi3Vacr4fShCO+IBYQCljJgq+O7KOHXZtaJ2lUKfSJsYZp/dLkcak9vibbIyXKHFdBA3k04V0TvmUd0HTS23JH79nNFCTqwMHaYJjWyiisgRo3AuKxuVUQ2sjE40bKvivSj3OskPFOgrpNkUKJcMdVNUSj5o456G7NczCCY7zpi5ycSCK7S2pPMcBLC0lOgMzAw39VmLdeL4DQg63rVPhNhFQ4aLtbigIYnm8VtWzojW0dfApfSx6e9P+LieFntLrj834L+rxs2OjQHrjqiyzGLmGD/XZIpv4x5pyg5etA1qhz5rPKMnY39NfN/HWGH0hnsNepAHy2Rm2OCfFjPTtZwKq0klkUxz17DOdZRLQgJ25mf2hT1McjOsXC+SYTWMXKvg+iKPnPMTaezv97db6IMAd2+yW94ltFu572jlGEreS8awrcIjL+nWdch2X3aRvzFj42YYJ191jLr8U1ZxfcDfnMNy3J/emGzGK7JW2MSn65L7ybzpOcsrVN2aE3+XxhAnUf4bIrMJ1HwNV9XDhgYe7bMgw5deshaJNeFNiBA+6VI6hZfafT+atKVMQpd+rlZtO/ZQfYlMvr1A2/qYaHIOzrlBKUm7J+ X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0883deff-80a3-4d5a-21b1-08db2855d4aa X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2023 08:42:10.9869 (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: pHCBz4j9iikHHooq1EjijmaCVEFoMrJJVjVTCjO/TR4ZUxNYmmUTHsjRxZ3VN12gsVgrRZvQNIspolLC+fKAjQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5350 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760785428791294764?= X-GMAIL-MSGID: =?utf-8?q?1760785428791294764?= Use kobject_del_and_put() to simplify code. 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); }