Re: [patch] add kobject_get_path

From: Greg KH
Date: Fri Aug 06 2004 - 15:57:07 EST


On Fri, Aug 06, 2004 at 04:41:43PM -0400, Robert Love wrote:
> Greg -
>
> Hey, here is an alternative to exporting those two functions.

Ah, good timing, I was just about to apply your other patch :)

>
> This patch, in lieu, creates a new function that performs the same steps
> as in kset_hotplug() and presumably what every single user of the
> previously exported functions would do: get the length, allocate memory,
> and then build the path.
>
> So just export a single function to do it right. And use it in
> kset_hotplug(). The function is prototyped as
>
> char * kobject_get_path(struct kset *kset, struct kobject *kobj,
> int gfp_mask)
>
> I like this approach better.

I do too. One problem though, get_kobj_path_length and fill_kobj_path
are only built if CONFIG_HOTPLUG is enabled. Care to respin this patch
by moving the functions outside of that #define?

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/