Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 258113
b: refs/heads/master
c: 88bfa32
h: refs/heads/master
i:
  258111: c576178
v: v3
  • Loading branch information
Kay Sievers authored and Rusty Russell committed Jul 24, 2011
1 parent a4329de commit 92a6d0b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4befb026cf74b52fc7d382142bbfc0e9b6aab5e7
refs/heads/master: 88bfa3247961fe5f3623f4d2cf1cd5dc72457598
1 change: 1 addition & 0 deletions trunk/include/linux/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ struct module_version_attribute {
extern ssize_t __modver_version_show(struct module_attribute *,
struct module_kobject *, char *);

extern struct module_attribute module_uevent;

/* These are either module local, or the kernel's dummy ones. */
extern int init_module(void);
Expand Down
17 changes: 17 additions & 0 deletions trunk/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -975,10 +975,27 @@ static struct module_attribute initstate = {
.show = show_initstate,
};

static ssize_t store_uevent(struct module_attribute *mattr,
struct module_kobject *mk,
const char *buffer, size_t count)
{
enum kobject_action action;

if (kobject_action_type(buffer, count, &action) == 0)
kobject_uevent(&mk->kobj, action);
return count;
}

struct module_attribute module_uevent = {
.attr = { .name = "uevent", .mode = 0200 },
.store = store_uevent,
};

static struct module_attribute *modinfo_attrs[] = {
&modinfo_version,
&modinfo_srcversion,
&initstate,
&module_uevent,
#ifdef CONFIG_MODULE_UNLOAD
&refcnt,
#endif
Expand Down
4 changes: 4 additions & 0 deletions trunk/kernel/params.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,10 @@ static struct module_kobject * __init locate_module_kobject(const char *name)
mk->kobj.kset = module_kset;
err = kobject_init_and_add(&mk->kobj, &module_ktype, NULL,
"%s", name);
#ifdef CONFIG_MODULES
if (!err)
err = sysfs_create_file(&mk->kobj, &module_uevent.attr);
#endif
if (err) {
kobject_put(&mk->kobj);
printk(KERN_ERR
Expand Down

0 comments on commit 92a6d0b

Please sign in to comment.