Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 44558
b: refs/heads/master
c: 1f71740
h: refs/heads/master
v: v3
  • Loading branch information
Kay Sievers authored and Greg Kroah-Hartman committed Dec 13, 2006
1 parent 7532a49 commit 7481b36
Show file tree
Hide file tree
Showing 2 changed files with 26 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: aef6fba4f97bbec1dc5a253f388be9a4c7a30e41
refs/heads/master: 1f71740ab9714bf5ae9ee04c724ff0d5c67ca3dc
25 changes: 25 additions & 0 deletions trunk/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -824,9 +824,34 @@ static inline void module_unload_init(struct module *mod)
}
#endif /* CONFIG_MODULE_UNLOAD */

static ssize_t show_initstate(struct module_attribute *mattr,
struct module *mod, char *buffer)
{
const char *state = "unknown";

switch (mod->state) {
case MODULE_STATE_LIVE:
state = "live";
break;
case MODULE_STATE_COMING:
state = "coming";
break;
case MODULE_STATE_GOING:
state = "going";
break;
}
return sprintf(buffer, "%s\n", state);
}

static struct module_attribute initstate = {
.attr = { .name = "initstate", .mode = 0444, .owner = THIS_MODULE },
.show = show_initstate,
};

static struct module_attribute *modinfo_attrs[] = {
&modinfo_version,
&modinfo_srcversion,
&initstate,
#ifdef CONFIG_MODULE_UNLOAD
&refcnt,
#endif
Expand Down

0 comments on commit 7481b36

Please sign in to comment.