diff options
author | Tejun Heo <htejun@gmail.com> | 2007-06-13 14:45:17 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-11 19:09:06 -0400 |
commit | 7b595756ec1f49e0049a9e01a1298d53a7faaa15 (patch) | |
tree | cd06687ab3e5c7a5a4ef91903dff207a18c4db76 /include/linux/sysfs.h | |
parent | dbde0fcf9f8f6d477af3c32d9979e789ee680cde (diff) |
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>
Diffstat (limited to 'include/linux/sysfs.h')
-rw-r--r-- | include/linux/sysfs.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 2f86b080b39d..161e19aa2b4f 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -20,9 +20,13 @@ struct module; | |||
20 | struct nameidata; | 20 | struct nameidata; |
21 | struct dentry; | 21 | struct dentry; |
22 | 22 | ||
23 | /* FIXME | ||
24 | * The *owner field is no longer used, but leave around | ||
25 | * until the tree gets cleaned up fully. | ||
26 | */ | ||
23 | struct attribute { | 27 | struct attribute { |
24 | const char * name; | 28 | const char * name; |
25 | struct module * owner; | 29 | struct module * owner; |
26 | mode_t mode; | 30 | mode_t mode; |
27 | }; | 31 | }; |
28 | 32 | ||
@@ -39,14 +43,14 @@ struct attribute_group { | |||
39 | */ | 43 | */ |
40 | 44 | ||
41 | #define __ATTR(_name,_mode,_show,_store) { \ | 45 | #define __ATTR(_name,_mode,_show,_store) { \ |
42 | .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE }, \ | 46 | .attr = {.name = __stringify(_name), .mode = _mode }, \ |
43 | .show = _show, \ | 47 | .show = _show, \ |
44 | .store = _store, \ | 48 | .store = _store, \ |
45 | } | 49 | } |
46 | 50 | ||
47 | #define __ATTR_RO(_name) { \ | 51 | #define __ATTR_RO(_name) { \ |
48 | .attr = { .name = __stringify(_name), .mode = 0444, .owner = THIS_MODULE }, \ | 52 | .attr = { .name = __stringify(_name), .mode = 0444 }, \ |
49 | .show = _name##_show, \ | 53 | .show = _name##_show, \ |
50 | } | 54 | } |
51 | 55 | ||
52 | #define __ATTR_NULL { .attr = { .name = NULL } } | 56 | #define __ATTR_NULL { .attr = { .name = NULL } } |