[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140421224606.GE22730@htj.dyndns.org>
Date: Mon, 21 Apr 2014 18:46:06 -0400
From: Tejun Heo <tj@...nel.org>
To: Li Zhong <zhong@...ux.vnet.ibm.com>
Cc: LKML <linux-kernel@...r.kernel.org>, gregkh@...uxfoundation.org,
rafael.j.wysocki@...el.com, toshi.kani@...com
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists