[lkml]   [2003]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: kobjects, sysfs and the driver model make my head hurt
Greg KH wrote:
>>(a) kobj = kobject_get(kobj);
> This is the way to call kobject_get(), as the object we get after the
> function returns is the one we can then safely use.
> Think of it as, "now we can use this kobject, not the one before calling
> kobject_get()".

Doesn't matter. There is still absolutely no reason for the additional
pointer storage. I agree with with you "Thinks of it as", but also add
my own: think of it as a spinlock function. It doesn't return any
value, but you can't touch the locked object(s) before you call the

The alloc functions return pointers. The _get functions never need to,
because logically there should always we at least one ref when we are
calling _get. (unless we want _get to notice an OBJ_FREEING flag and
fail, that is...)


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:46    [W:0.044 / U:4.144 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site