diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-04 22:56:40 -0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-04 22:56:40 -0500 |
| commit | eb4c69033fd1dda8b60e48af3accdd578c2e59ed (patch) | |
| tree | 154e4a181389c49cc729603581340a685e23b675 /lib | |
| parent | 5bd2010fbe027b224db2e74a4fdfec9a7b7918d2 (diff) | |
Revert "kobject: introduce kobj_completion"
This reverts commit eee031649707db3c9920d9498f8d03819b74fc23.
Jeff writes:
I have no objections to reverting it. There were concerns from
Al Viro that it'd be tough to get right by callers and I had
assumed it got dropped after that. I had planned on using it in
my btrfs sysfs exports patchset but came up with a better way.
Cc: Jeff Mahoney <jeffm@suse.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/kobject.c | 50 |
1 files changed, 0 insertions, 50 deletions
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 | */ |
