[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230406093056.33916-2-frank.li@vivo.com>
Date: Thu, 6 Apr 2023 17:30:55 +0800
From: Yangtao Li <frank.li@...o.com>
To: xiang@...nel.org, chao@...nel.org, huyue2@...lpad.com,
jefflexu@...ux.alibaba.com, damien.lemoal@...nsource.wdc.com,
naohiro.aota@....com, jth@...nel.org, gregkh@...uxfoundation.org,
rafael@...nel.org
Cc: linux-erofs@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org, Yangtao Li <frank.li@...o.com>
Subject: [PATCH 2/3] erofs: convert to use kobject_is_added()
Use kobject_is_added() instead of directly accessing the internal
variables of kobject. BTW kill kobject_del() directly, because
kobject_put() actually covers kobject removal automatically.
Signed-off-by: Yangtao Li <frank.li@...o.com>
---
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..daac23e32026 100644
--- a/fs/erofs/sysfs.c
+++ b/fs/erofs/sysfs.c
@@ -240,8 +240,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);
+ if (kobject_is_added(&sbi->s_kobj)) {
kobject_put(&sbi->s_kobj);
wait_for_completion(&sbi->s_kobj_unregister);
}
--
2.35.1
Powered by blists - more mailing lists