mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH v2, RESEND 01/10] kobject: introduce kobject_del_and_put()
@ 2023-03-20  3:34 Yangtao Li
  2023-03-20  4:08 ` Damien Le Moal
  0 siblings, 1 reply; 5+ messages in thread
From: Yangtao Li @ 2023-03-20  3:34 UTC (permalink / raw)
  To: clm, josef, dsterba, xiang, chao, huyue2, jefflexu, jaegeuk,
	trond.myklebust, anna, konishi.ryusuke, mark, jlbec, joseph.qi,
	richard, djwong, damien.lemoal, naohiro.aota, jth, gregkh,
	rafael
  Cc: linux-btrfs, linux-kernel, linux-erofs, linux-f2fs-devel,
	linux-nfs, linux-nilfs, ocfs2-devel, linux-mtd, linux-xfs,
	linux-fsdevel

Hi all,

Out of consideration for minimizing disruption, I did not send the
patchset to everyone. However, it seems that my consideration was
unnecessary, so I CC'd everyone on the first patch. If you would
like to see the entire patchset, you can access it at this address.

https://lore.kernel.org/lkml/20230319092641.41917-1-frank.li@vivo.com/

Thx,
Yangtao

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2, RESEND 01/10] kobject: introduce kobject_del_and_put()
  2023-03-20  3:34 [PATCH v2, RESEND 01/10] kobject: introduce kobject_del_and_put() Yangtao Li
@ 2023-03-20  4:08 ` Damien Le Moal
  2023-03-20  7:11   ` Yangtao Li
  0 siblings, 1 reply; 5+ messages in thread
From: Damien Le Moal @ 2023-03-20  4:08 UTC (permalink / raw)
  To: Yangtao Li, clm, josef, dsterba, xiang, chao, huyue2, jefflexu,
	jaegeuk, trond.myklebust, anna, konishi.ryusuke, mark, jlbec,
	joseph.qi, richard, djwong, naohiro.aota, jth, gregkh, rafael
  Cc: linux-btrfs, linux-kernel, linux-erofs, linux-f2fs-devel,
	linux-nfs, linux-nilfs, ocfs2-devel, linux-mtd, linux-xfs,
	linux-fsdevel

On 3/20/23 12:34, Yangtao Li wrote:
> Hi all,
> 
> Out of consideration for minimizing disruption, I did not send the
> patchset to everyone. However, it seems that my consideration was
> unnecessary, so I CC'd everyone on the first patch. If you would
> like to see the entire patchset, you can access it at this address.
> 
> https://lore.kernel.org/lkml/20230319092641.41917-1-frank.li@vivo.com/

Hard to comment on patches with this. It is only 10 patches. So send everything
please.

> 
> Thx,
> Yangtao

-- 
Damien Le Moal
Western Digital Research


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2, RESEND 01/10] kobject: introduce kobject_del_and_put()
  2023-03-20  4:08 ` Damien Le Moal
@ 2023-03-20  7:11   ` Yangtao Li
  2023-03-20  7:26     ` Damien Le Moal
  0 siblings, 1 reply; 5+ messages in thread
From: Yangtao Li @ 2023-03-20  7:11 UTC (permalink / raw)
  To: clm, josef, dsterba, xiang, chao, huyue2, jefflexu, jaegeuk,
	trond.myklebust, anna, konishi.ryusuke, mark, jlbec, joseph.qi,
	richard, djwong, damien.lemoal, naohiro.aota, jth, gregkh,
	rafael
  Cc: linux-btrfs, linux-kernel, linux-erofs, linux-f2fs-devel,
	linux-nfs, linux-nilfs, ocfs2-devel, linux-mtd, linux-xfs,
	linux-fsdevel

Hi filesystem maintainers,

> Hard to comment on patches with this. It is only 10 patches. So send everything please.

If you are interested in the entire patchset besides Damien,
please let me know. I'll resend the email later to cc more people.

Thx,
Yangtao

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2, RESEND 01/10] kobject: introduce kobject_del_and_put()
  2023-03-20  7:11   ` Yangtao Li
@ 2023-03-20  7:26     ` Damien Le Moal
  0 siblings, 0 replies; 5+ messages in thread
From: Damien Le Moal @ 2023-03-20  7:26 UTC (permalink / raw)
  To: Yangtao Li, clm, josef, dsterba, xiang, chao, huyue2, jefflexu,
	jaegeuk, trond.myklebust, anna, konishi.ryusuke, mark, jlbec,
	joseph.qi, richard, djwong, naohiro.aota, jth, gregkh, rafael
  Cc: linux-btrfs, linux-kernel, linux-erofs, linux-f2fs-devel,
	linux-nfs, linux-nilfs, ocfs2-devel, linux-mtd, linux-xfs,
	linux-fsdevel

On 3/20/23 16:11, Yangtao Li wrote:
> Hi filesystem maintainers,
> 
>> Hard to comment on patches with this. It is only 10 patches. So send everything please.
> 
> If you are interested in the entire patchset besides Damien,
> please let me know. I'll resend the email later to cc more people.

Yes, I said I am interested, twice already. It is IMPOSSIBLE to review a patch
without the context of other patches before/after said patch. So if you want a
review/ack for zonefs, then send the entire series.

> 
> Thx,
> Yangtao

-- 
Damien Le Moal
Western Digital Research


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2, RESEND 01/10] kobject: introduce kobject_del_and_put()
@ 2023-03-19  9:26 Yangtao Li
  0 siblings, 0 replies; 5+ messages in thread
From: Yangtao Li @ 2023-03-19  9:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki; +Cc: Yangtao Li, linux-kernel

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 <frank.li@vivo.com>
---
v2:
-add kobject_del_and_put() users
resend patchset to gregkh and Rafael
 include/linux/kobject.h |  1 +
 lib/kobject.c           | 17 +++++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index bdab370a24f4..782d4bd119f8 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -111,6 +111,7 @@ extern struct kobject *kobject_get(struct kobject *kobj);
 extern struct kobject * __must_check kobject_get_unless_zero(
 						struct kobject *kobj);
 extern void kobject_put(struct kobject *kobj);
+extern void kobject_del_and_put(struct kobject *kobj);
 
 extern const void *kobject_namespace(const struct kobject *kobj);
 extern void kobject_get_ownership(const struct kobject *kobj,
diff --git a/lib/kobject.c b/lib/kobject.c
index 6e2f0bee3560..8c0293e37214 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -731,6 +731,20 @@ void kobject_put(struct kobject *kobj)
 }
 EXPORT_SYMBOL(kobject_put);
 
+/**
+ * kobject_del_and_put() - Delete kobject.
+ * @kobj: object.
+ *
+ * Unlink kobject from hierarchy and decrement the refcount.
+ * If refcount is 0, call kobject_cleanup().
+ */
+void kobject_del_and_put(struct kobject *kobj)
+{
+	kobject_del(kobj);
+	kobject_put(kobj);
+}
+EXPORT_SYMBOL_GPL(kobject_del_and_put);
+
 static void dynamic_kobj_release(struct kobject *kobj)
 {
 	pr_debug("kobject: (%p): %s\n", kobj, __func__);
@@ -874,8 +888,7 @@ void kset_unregister(struct kset *k)
 {
 	if (!k)
 		return;
-	kobject_del(&k->kobj);
-	kobject_put(&k->kobj);
+	kobject_del_and_put(&k->kobj);
 }
 EXPORT_SYMBOL(kset_unregister);
 
-- 
2.35.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-20  7:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-20  3:34 [PATCH v2, RESEND 01/10] kobject: introduce kobject_del_and_put() Yangtao Li
2023-03-20  4:08 ` Damien Le Moal
2023-03-20  7:11   ` Yangtao Li
2023-03-20  7:26     ` Damien Le Moal
  -- strict thread matches above, loose matches on Subject: below --
2023-03-19  9:26 Yangtao Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®