aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-12 16:40:20 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-12 16:40:20 -0400
commitdc690d8ef842b464f1c429a376ca16cb8dbee6ae (patch)
tree77955849af5a15755f5e55e24ae4b9c520583a72 /kernel/module.c
parent57399ec9077a4b962b81037aaa279fab52f5e989 (diff)
parent91a6902958f052358899f58683d44e36228d85c2 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (61 commits) sysfs: add parameter "struct bin_attribute *" in .read/.write methods for sysfs binary attributes sysfs: make directory dentries and inodes reclaimable sysfs: implement sysfs_get_dentry() sysfs: move sysfs_drop_dentry() to dir.c and make it static sysfs: restructure add/remove paths and fix inode update sysfs: use sysfs_mutex to protect the sysfs_dirent tree sysfs: consolidate sysfs spinlocks sysfs: make kobj point to sysfs_dirent instead of dentry sysfs: implement sysfs_find_dirent() and sysfs_get_dirent() sysfs: implement SYSFS_FLAG_REMOVED flag sysfs: rename sysfs_dirent->s_type to s_flags and make room for flags sysfs: make sysfs_drop_dentry() access inodes using ilookup() sysfs: Fix oops in sysfs_drop_dentry on x86_64 sysfs: use singly-linked list for sysfs_dirent tree sysfs: slim down sysfs_dirent->s_active sysfs: move s_active functions to fs/sysfs/dir.c sysfs: fix root sysfs_dirent -> root dentry association sysfs: use iget_locked() instead of new_inode() sysfs: reorganize sysfs_new_indoe() and sysfs_create() sysfs: fix parent refcounting during rename and move ...
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 9bd93de01f4a..015d60cfd90e 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -488,8 +488,7 @@ static void free_modinfo_##field(struct module *mod) \
488 mod->field = NULL; \ 488 mod->field = NULL; \
489} \ 489} \
490static struct module_attribute modinfo_##field = { \ 490static struct module_attribute modinfo_##field = { \
491 .attr = { .name = __stringify(field), .mode = 0444, \ 491 .attr = { .name = __stringify(field), .mode = 0444 }, \
492 .owner = THIS_MODULE }, \
493 .show = show_modinfo_##field, \ 492 .show = show_modinfo_##field, \
494 .setup = setup_modinfo_##field, \ 493 .setup = setup_modinfo_##field, \
495 .test = modinfo_##field##_exists, \ 494 .test = modinfo_##field##_exists, \
@@ -793,7 +792,7 @@ static ssize_t show_refcnt(struct module_attribute *mattr,
793} 792}
794 793
795static struct module_attribute refcnt = { 794static struct module_attribute refcnt = {
796 .attr = { .name = "refcnt", .mode = 0444, .owner = THIS_MODULE }, 795 .attr = { .name = "refcnt", .mode = 0444 },
797 .show = show_refcnt, 796 .show = show_refcnt,
798}; 797};
799 798
@@ -851,7 +850,7 @@ static ssize_t show_initstate(struct module_attribute *mattr,
851} 850}
852 851
853static struct module_attribute initstate = { 852static struct module_attribute initstate = {
854 .attr = { .name = "initstate", .mode = 0444, .owner = THIS_MODULE }, 853 .attr = { .name = "initstate", .mode = 0444 },
855 .show = show_initstate, 854 .show = show_initstate,
856}; 855};
857 856
@@ -1032,7 +1031,6 @@ static void add_sect_attrs(struct module *mod, unsigned int nsect,
1032 sattr->mattr.show = module_sect_show; 1031 sattr->mattr.show = module_sect_show;
1033 sattr->mattr.store = NULL; 1032 sattr->mattr.store = NULL;
1034 sattr->mattr.attr.name = sattr->name; 1033 sattr->mattr.attr.name = sattr->name;
1035 sattr->mattr.attr.owner = mod;
1036 sattr->mattr.attr.mode = S_IRUGO; 1034 sattr->mattr.attr.mode = S_IRUGO;
1037 *(gattr++) = &(sattr++)->mattr.attr; 1035 *(gattr++) = &(sattr++)->mattr.attr;
1038 } 1036 }
@@ -1090,7 +1088,6 @@ int module_add_modinfo_attrs(struct module *mod)
1090 if (!attr->test || 1088 if (!attr->test ||
1091 (attr->test && attr->test(mod))) { 1089 (attr->test && attr->test(mod))) {
1092 memcpy(temp_attr, attr, sizeof(*temp_attr)); 1090 memcpy(temp_attr, attr, sizeof(*temp_attr));
1093 temp_attr->attr.owner = mod;
1094 error = sysfs_create_file(&mod->mkobj.kobj,&temp_attr->attr); 1091 error = sysfs_create_file(&mod->mkobj.kobj,&temp_attr->attr);
1095 ++temp_attr; 1092 ++temp_attr;
1096 } 1093 }