[lkml]   [2010]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] sysfs: differentiate between locking links and non-links
Tejun Heo <> writes:

> Hello, Eric.
> On 02/11/2010 03:25 AM, Eric W. Biederman wrote:
>>> Maybe I'm glossly misunderstanding it but wouldn't embedding struct
>>> lockdep_map into sysfs_node as in work_struct do the trick?
>> In lockdep_init_map there is the following check:
>> /*
>> * Sanity check, the lock-class key must be persistent:
>> */
>> if (!static_obj(key)) {
>> printk("BUG: key %p not in .data!\n", key);
>> return;
>> }
> Right, the lockdep_map is not the class, it's the lock instance.
>> It needs playing with but I think we can embed something in struct
>> attribute, and simply disallow dynamically allocated instances of
>> struct attribute.
> But I think something along this line would be the right way to do it,
> instead of trying to mark up all the use cases manually.

Assuming it works I am in complete agreement.

> I'm pretty
> sure if we start by giving separate classes to different sysfs types
> (by attr or by sysfs_ops) there will be far less special cases which
> would need manual markups.

sysfs_ops are not especially useful because practically everything
uses the sysfs_ops provided by the driver core.

We also need to put sysfs symlinks into a different class or possibly
even remove s_active from them as Neil Brown helpfully pointed out.


 \ /
  Last update: 2010-02-11 01:41    [W:0.074 / U:5.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site