History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (46 commits) UIO: Fix mapping of logical and virtual memory UIO: add automata sercos3 pci card support UIO: Change driver name of uio_pdrv UIO: Add alignment warnings for uio-mem Driver core: add bus_sort_breadthfirst() function NET: convert the phy_device file to use bus_find_device_by_name kobject: Cleanup kobject_rename and !CONFIG_SYSFS kobject: Fix kobject_rename and !CONFIG_SYSFS sysfs: Make dir and name args to sysfs_notify() const platform: add new device registration helper sysfs: use ilookup5() instead of ilookup5_nowait() PNP: create device attributes via default device attributes Driver core: make bus_find_device_by_name() more robust usb: turn dev_warn+WARN_ON combos into dev_WARN debug: use dev_WARN() rather than WARN_ON() in device_pm_add() debug: Introduce a dev_WARN() function sysfs: fix deadlock device model: Do a quickcheck for driver binding before doing an expensive check Driver core: Fix cleanup in device_create_vargs(). Driver core: Clarify device cleanup. ...

Linus Torvalds committed 18 years ago

Commit c813b4e2 parents c8d8a23 02683ff131 files · +1786 −617Browse files

Showing the changes to kernel/module.c (1 of 131 files). Show all

Unified · Split

kernel/module.c+32−1
@@ -784,6 +784,7 @@ sys_delete_module(const char __user *name_user, unsigned int flags) · 783 unmodified lines
784784 mutex_lock(&module_mutex);
785785 /* Store the name of the last unloaded module for diagnostic purposes */
786786 strlcpy(last_unloaded_module, mod->name, sizeof(last_unloaded_module));
787+ unregister_dynamic_debug_module(mod->name);
787788 free_module(mod);
788789
789790 out:
@@ -1173,7 +1174,7 @@ static void free_notes_attrs(struct module_notes_attrs *notes_attrs, · 383 unmodified lines
11731174 while (i-- > 0)
11741175 sysfs_remove_bin_file(notes_attrs->dir,
11751176 &notes_attrs->attrs[i]);
1176− kobject_del(notes_attrs->dir);
1177+ kobject_put(notes_attrs->dir);
11771178 }
11781179 kfree(notes_attrs);
11791180 }
@@ -1783,6 +1784,33 @@ static inline void add_kallsyms(struct module *mod, · 603 unmodified lines
17831784 }
17841785 #endif /* CONFIG_KALLSYMS */
17851786
1787+#ifdef CONFIG_DYNAMIC_PRINTK_DEBUG
1788+static void dynamic_printk_setup(Elf_Shdr *sechdrs, unsigned int verboseindex)
1789+{
1790+ struct mod_debug *debug_info;
1791+ unsigned long pos, end;
1792+ unsigned int num_verbose;
1793+
1794+ pos = sechdrs[verboseindex].sh_addr;
1795+ num_verbose = sechdrs[verboseindex].sh_size /
1796+ sizeof(struct mod_debug);
1797+ end = pos + (num_verbose * sizeof(struct mod_debug));
1798+
1799+ for (; pos < end; pos += sizeof(struct mod_debug)) {
1800+ debug_info = (struct mod_debug *)pos;
1801+ register_dynamic_debug_module(debug_info->modname,
1802+ debug_info->type, debug_info->logical_modname,
1803+ debug_info->flag_names, debug_info->hash,
1804+ debug_info->hash2);
1805+ }
1806+}
1807+#else
1808+static inline void dynamic_printk_setup(Elf_Shdr *sechdrs,
1809+ unsigned int verboseindex)
1810+{
1811+}
1812+#endif /* CONFIG_DYNAMIC_PRINTK_DEBUG */
1813+
17861814 static void *module_alloc_update_bounds(unsigned long size)
17871815 {
17881816 void *ret = module_alloc(size);
@@ -1831,6 +1859,7 @@ static noinline struct module *load_module(void __user *umod, · 42 unmodified lines
18311859 #endif
18321860 unsigned int markersindex;
18331861 unsigned int markersstringsindex;
1862+ unsigned int verboseindex;
18341863 struct module *mod;
18351864 long err = 0;
18361865 void *percpu = NULL, *ptr = NULL; /* Stops spurious gcc warning */
@@ -2117,6 +2146,7 @@ static noinline struct module *load_module(void __user *umod, · 280 unmodified lines
21172146 markersindex = find_sec(hdr, sechdrs, secstrings, "__markers");
21182147 markersstringsindex = find_sec(hdr, sechdrs, secstrings,
21192148 "__markers_strings");
2149+ verboseindex = find_sec(hdr, sechdrs, secstrings, "__verbose");
21202150
21212151 /* Now do relocations. */
21222152 for (i = 1; i < hdr->e_shnum; i++) {
@@ -2167,6 +2197,7 @@ static noinline struct module *load_module(void __user *umod, · 44 unmodified lines
21672197 marker_update_probe_range(mod->markers,
21682198 mod->markers + mod->num_markers);
21692199 #endif
2200+ dynamic_printk_setup(sechdrs, verboseindex);
21702201 err = module_finalize(hdr, sechdrs, mod);
21712202 if (err < 0)
21722203 goto cleanup;