diff options
-rw-r--r-- | include/linux/kobj_completion.h | 18 | ||||
-rw-r--r-- | lib/kobject.c | 50 |
2 files changed, 0 insertions, 68 deletions
diff --git a/include/linux/kobj_completion.h b/include/linux/kobj_completion.h deleted file mode 100644 index a428f6436063..000000000000 --- a/include/linux/kobj_completion.h +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | #ifndef _KOBJ_COMPLETION_H_ | ||
2 | #define _KOBJ_COMPLETION_H_ | ||
3 | |||
4 | #include <linux/kobject.h> | ||
5 | #include <linux/completion.h> | ||
6 | |||
7 | struct kobj_completion { | ||
8 | struct kobject kc_kobj; | ||
9 | struct completion kc_unregister; | ||
10 | }; | ||
11 | |||
12 | #define kobj_to_kobj_completion(kobj) \ | ||
13 | container_of(kobj, struct kobj_completion, kc_kobj) | ||
14 | |||
15 | void kobj_completion_init(struct kobj_completion *kc, struct kobj_type *ktype); | ||
16 | void kobj_completion_release(struct kobject *kobj); | ||
17 | void kobj_completion_del_and_wait(struct kobj_completion *kc); | ||
18 | #endif /* _KOBJ_COMPLETION_H_ */ | ||
diff --git a/lib/kobject.c b/lib/kobject.c index 064451f2a6c3..f7f69cbe4f6e 100644 --- a/lib/kobject.c +++ b/lib/kobject.c | |||
@@ -13,7 +13,6 @@ | |||
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <linux/kobject.h> | 15 | #include <linux/kobject.h> |
16 | #include <linux/kobj_completion.h> | ||
17 | #include <linux/string.h> | 16 | #include <linux/string.h> |
18 | #include <linux/export.h> | 17 | #include <linux/export.h> |
19 | #include <linux/stat.h> | 18 | #include <linux/stat.h> |
@@ -782,55 +781,6 @@ const struct sysfs_ops kobj_sysfs_ops = { | |||
782 | }; | 781 | }; |
783 | 782 | ||
784 | /** | 783 | /** |
785 | * kobj_completion_init - initialize a kobj_completion object. | ||
786 | * @kc: kobj_completion | ||
787 | * @ktype: type of kobject to initialize | ||
788 | * | ||
789 | * kobj_completion structures can be embedded within structures with different | ||
790 | * lifetime rules. During the release of the enclosing object, we can | ||
791 | * wait on the release of the kobject so that we don't free it while it's | ||
792 | * still busy. | ||
793 | */ | ||
794 | void kobj_completion_init(struct kobj_completion *kc, struct kobj_type *ktype) | ||
795 | { | ||
796 | init_completion(&kc->kc_unregister); | ||
797 | kobject_init(&kc->kc_kobj, ktype); | ||
798 | } | ||
799 | EXPORT_SYMBOL_GPL(kobj_completion_init); | ||
800 | |||
801 | /** | ||
802 | * kobj_completion_release - release a kobj_completion object | ||
803 | * @kobj: kobject embedded in kobj_completion | ||
804 | * | ||
805 | * Used with kobject_release to notify waiters that the kobject has been | ||
806 | * released. | ||
807 | */ | ||
808 | void kobj_completion_release(struct kobject *kobj) | ||
809 | { | ||
810 | struct kobj_completion *kc = kobj_to_kobj_completion(kobj); | ||
811 | complete(&kc->kc_unregister); | ||
812 | } | ||
813 | EXPORT_SYMBOL_GPL(kobj_completion_release); | ||
814 | |||
815 | /** | ||
816 | * kobj_completion_del_and_wait - release the kobject and wait for it | ||
817 | * @kc: kobj_completion object to release | ||
818 | * | ||
819 | * Delete the kobject from sysfs and drop the reference count. Then wait | ||
820 | * until any other outstanding references are also dropped. This routine | ||
821 | * is only necessary once other references may have been taken on the | ||
822 | * kobject. Typically this happens when the kobject has been published | ||
823 | * to sysfs via kobject_add. | ||
824 | */ | ||
825 | void kobj_completion_del_and_wait(struct kobj_completion *kc) | ||
826 | { | ||
827 | kobject_del(&kc->kc_kobj); | ||
828 | kobject_put(&kc->kc_kobj); | ||
829 | wait_for_completion(&kc->kc_unregister); | ||
830 | } | ||
831 | EXPORT_SYMBOL_GPL(kobj_completion_del_and_wait); | ||
832 | |||
833 | /** | ||
834 | * kset_register - initialize and add a kset. | 784 | * kset_register - initialize and add a kset. |
835 | * @k: kset. | 785 | * @k: kset. |
836 | */ | 786 | */ |