Re: [PATCH] kobject: introduce kobj_completion

From: Jeff Mahoney
Date: Wed Sep 11 2013 - 14:37:35 EST


On 9/11/13 1:15 PM, Greg KH wrote:
> On Wed, Sep 11, 2013 at 01:00:30PM -0400, Jeff Mahoney wrote:
>> A common way to handle kobject lifetimes in embedded in objects with
>> different lifetime rules is to pair the kobject with a struct completion.
>>
>> This introduces a kobj_completion structure that can be used in place
>> of the pairing, along with several convenience functions for
>> initialization, release, and put-and-wait.
>>
>> Signed-off-by: Jeff Mahoney <jeffm@xxxxxxxx>
>> ---
>> include/linux/kobj_completion.h | 18 ++++++++++++++
>
> Does this really need a new .h file, or can we just cram it into
> kobject.h? It's only 13 more lines to add to that file.

It doesn't need to be, but it avoids everywhere that already uses a
kobject having to include <linux/completion.h> indirectly.

-Jeff

--
Jeff Mahoney
SUSE Labs

Attachment: signature.asc
Description: OpenPGP digital signature