Messages in this thread | | | Date | Mon, 21 Apr 2014 18:46:06 -0400 | From | Tejun Heo <> | Subject | Re: [RFC PATCH v5 2/2] Use kernfs_break_active_protection() for device online store callbacks |
| |
Hello,
On Mon, Apr 21, 2014 at 05:23:50PM +0800, Li Zhong wrote:
Proper /** function comment would be nice.
> +struct kernfs_node *lock_device_hotplug_sysfs(struct device *dev, > + struct device_attribute *attr)
I can see why you did this but let's please not require the user of this function to see how the thing is working internally. Let's return int and keep track of (or look up again) the kernfs_node internally.
> { ... > + /* > + * We assume device_hotplug_lock must be acquired before removing
Is this assumption true? If so, can we add lockdep assertions in places to verify and enforce this? If not, aren't we just feeling good when the reality is broken?
...
Function comment please. > +void unlock_device_hotplug_sysfs(struct device *dev, > + struct kernfs_node *kn) > +{ > + unlock_device_hotplug(); > + kernfs_unbreak_active_protection(kn); > + put_device(dev); > + kernfs_put(kn); > }
Thanks.
-- tejun
| |