search for: kobject_get_ownership

Displaying 2 results from an estimated 2 matches for "kobject_get_ownership".

2023 Mar 20
1
[RESEND, PATCH v2 01/10] kobject: introduce kobject_del_and_put()
...ruct 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. + * @...
2023 Mar 22
3
[PATCH v3 01/10] kobject: introduce kobject_del_and_put()
...nlink kobject from hierarchy and decrement the refcount. + * If refcount is 0, call kobject_cleanup(). + */ +static inline void kobject_del_and_put(struct kobject *kobj) +{ + kobject_del(kobj); + kobject_put(kobj); +} + extern const void *kobject_namespace(const struct kobject *kobj); extern void kobject_get_ownership(const struct kobject *kobj, kuid_t *uid, kgid_t *gid); diff --git a/lib/kobject.c b/lib/kobject.c index f79a434e1231..e6c5a3ff1c53 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -876,8 +876,7 @@ void kset_unregister(struct kset *k) { if (!k) return; - kobject_del(&k->kobj); -...