mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 15:11:16 +00:00
sysfs: kill unnecessary attribute->owner
sysfs is now completely out of driver/module lifetime game. After deletion, a sysfs node doesn't access anything outside sysfs proper, so there's no reason to hold onto the attribute owners. Note that often the wrong modules were accounted for as owners leading to accessing removed modules. This patch kills now unnecessary attribute->owner. Note that with this change, userland holding a sysfs node does not prevent the backing module from being unloaded. For more info regarding lifetime rule cleanup, please read the following message. http://article.gmane.org/gmane.linux.kernel/510293 (tweaked by Greg to not delete the field just yet, to make it easier to merge things properly.) Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
dbde0fcf9f
commit
7b595756ec
55 changed files with 44 additions and 135 deletions
|
@ -20,9 +20,13 @@ struct module;
|
|||
struct nameidata;
|
||||
struct dentry;
|
||||
|
||||
/* FIXME
|
||||
* The *owner field is no longer used, but leave around
|
||||
* until the tree gets cleaned up fully.
|
||||
*/
|
||||
struct attribute {
|
||||
const char * name;
|
||||
struct module * owner;
|
||||
struct module * owner;
|
||||
mode_t mode;
|
||||
};
|
||||
|
||||
|
@ -39,14 +43,14 @@ struct attribute_group {
|
|||
*/
|
||||
|
||||
#define __ATTR(_name,_mode,_show,_store) { \
|
||||
.attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE }, \
|
||||
.attr = {.name = __stringify(_name), .mode = _mode }, \
|
||||
.show = _show, \
|
||||
.store = _store, \
|
||||
}
|
||||
|
||||
#define __ATTR_RO(_name) { \
|
||||
.attr = { .name = __stringify(_name), .mode = 0444, .owner = THIS_MODULE }, \
|
||||
.show = _name##_show, \
|
||||
.attr = { .name = __stringify(_name), .mode = 0444 }, \
|
||||
.show = _name##_show, \
|
||||
}
|
||||
|
||||
#define __ATTR_NULL { .attr = { .name = NULL } }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue