diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-22 16:17:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-22 16:17:15 -0400 |
commit | 6eaaaac97433575894570a990aa27310040a8177 (patch) | |
tree | 0d61224358c40309096a0c026ad0d1c7120fa0d6 /include | |
parent | 06b8147c5dbd385b5b97ca74e19f6f3951ebc1cb (diff) | |
parent | a1ef5adb4cad43460ebba23c5a78cf4a55bb6a5b (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
remove CONFIG_KMOD from core kernel code
remove CONFIG_KMOD from lib
remove CONFIG_KMOD from sparc64
rework try_then_request_module to do less in non-modular kernels
remove mention of CONFIG_KMOD from documentation
make CONFIG_KMOD invisible
modules: Take a shortcut for checking if an address is in a module
module: turn longs into ints for module sizes
Shrink struct module: CONFIG_UNUSED_SYMBOLS ifdefs
module: reorder struct module to save space on 64 bit builds
module: generic each_symbol iterator function
module: don't use stop_machine for waiting rmmod
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kmod.h | 5 | ||||
-rw-r--r-- | include/linux/module.h | 50 |
2 files changed, 30 insertions, 25 deletions
diff --git a/include/linux/kmod.h b/include/linux/kmod.h index 5dc13848891b..0509c4ce4857 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h | |||
@@ -25,15 +25,16 @@ | |||
25 | 25 | ||
26 | #define KMOD_PATH_LEN 256 | 26 | #define KMOD_PATH_LEN 256 |
27 | 27 | ||
28 | #ifdef CONFIG_KMOD | 28 | #ifdef CONFIG_MODULES |
29 | /* modprobe exit status on success, -ve on error. Return value | 29 | /* modprobe exit status on success, -ve on error. Return value |
30 | * usually useless though. */ | 30 | * usually useless though. */ |
31 | extern int request_module(const char * name, ...) __attribute__ ((format (printf, 1, 2))); | 31 | extern int request_module(const char * name, ...) __attribute__ ((format (printf, 1, 2))); |
32 | #define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x))) | ||
32 | #else | 33 | #else |
33 | static inline int request_module(const char * name, ...) { return -ENOSYS; } | 34 | static inline int request_module(const char * name, ...) { return -ENOSYS; } |
35 | #define try_then_request_module(x, mod...) (x) | ||
34 | #endif | 36 | #endif |
35 | 37 | ||
36 | #define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x))) | ||
37 | 38 | ||
38 | struct key; | 39 | struct key; |
39 | struct file; | 40 | struct file; |
diff --git a/include/linux/module.h b/include/linux/module.h index 3e03b1acbc94..fce15ebd0e1c 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -249,27 +249,30 @@ struct module | |||
249 | 249 | ||
250 | /* Exported symbols */ | 250 | /* Exported symbols */ |
251 | const struct kernel_symbol *syms; | 251 | const struct kernel_symbol *syms; |
252 | unsigned int num_syms; | ||
253 | const unsigned long *crcs; | 252 | const unsigned long *crcs; |
253 | unsigned int num_syms; | ||
254 | 254 | ||
255 | /* GPL-only exported symbols. */ | 255 | /* GPL-only exported symbols. */ |
256 | const struct kernel_symbol *gpl_syms; | ||
257 | unsigned int num_gpl_syms; | 256 | unsigned int num_gpl_syms; |
257 | const struct kernel_symbol *gpl_syms; | ||
258 | const unsigned long *gpl_crcs; | 258 | const unsigned long *gpl_crcs; |
259 | 259 | ||
260 | #ifdef CONFIG_UNUSED_SYMBOLS | ||
260 | /* unused exported symbols. */ | 261 | /* unused exported symbols. */ |
261 | const struct kernel_symbol *unused_syms; | 262 | const struct kernel_symbol *unused_syms; |
262 | unsigned int num_unused_syms; | ||
263 | const unsigned long *unused_crcs; | 263 | const unsigned long *unused_crcs; |
264 | unsigned int num_unused_syms; | ||
265 | |||
264 | /* GPL-only, unused exported symbols. */ | 266 | /* GPL-only, unused exported symbols. */ |
265 | const struct kernel_symbol *unused_gpl_syms; | ||
266 | unsigned int num_unused_gpl_syms; | 267 | unsigned int num_unused_gpl_syms; |
268 | const struct kernel_symbol *unused_gpl_syms; | ||
267 | const unsigned long *unused_gpl_crcs; | 269 | const unsigned long *unused_gpl_crcs; |
270 | #endif | ||
268 | 271 | ||
269 | /* symbols that will be GPL-only in the near future. */ | 272 | /* symbols that will be GPL-only in the near future. */ |
270 | const struct kernel_symbol *gpl_future_syms; | 273 | const struct kernel_symbol *gpl_future_syms; |
271 | unsigned int num_gpl_future_syms; | ||
272 | const unsigned long *gpl_future_crcs; | 274 | const unsigned long *gpl_future_crcs; |
275 | unsigned int num_gpl_future_syms; | ||
273 | 276 | ||
274 | /* Exception table */ | 277 | /* Exception table */ |
275 | unsigned int num_exentries; | 278 | unsigned int num_exentries; |
@@ -285,10 +288,10 @@ struct module | |||
285 | void *module_core; | 288 | void *module_core; |
286 | 289 | ||
287 | /* Here are the sizes of the init and core sections */ | 290 | /* Here are the sizes of the init and core sections */ |
288 | unsigned long init_size, core_size; | 291 | unsigned int init_size, core_size; |
289 | 292 | ||
290 | /* The size of the executable code in each section. */ | 293 | /* The size of the executable code in each section. */ |
291 | unsigned long init_text_size, core_text_size; | 294 | unsigned int init_text_size, core_text_size; |
292 | 295 | ||
293 | /* The handle returned from unwind_add_table. */ | 296 | /* The handle returned from unwind_add_table. */ |
294 | void *unwind_info; | 297 | void *unwind_info; |
@@ -300,29 +303,15 @@ struct module | |||
300 | 303 | ||
301 | #ifdef CONFIG_GENERIC_BUG | 304 | #ifdef CONFIG_GENERIC_BUG |
302 | /* Support for BUG */ | 305 | /* Support for BUG */ |
306 | unsigned num_bugs; | ||
303 | struct list_head bug_list; | 307 | struct list_head bug_list; |
304 | struct bug_entry *bug_table; | 308 | struct bug_entry *bug_table; |
305 | unsigned num_bugs; | ||
306 | #endif | ||
307 | |||
308 | #ifdef CONFIG_MODULE_UNLOAD | ||
309 | /* Reference counts */ | ||
310 | struct module_ref ref[NR_CPUS]; | ||
311 | |||
312 | /* What modules depend on me? */ | ||
313 | struct list_head modules_which_use_me; | ||
314 | |||
315 | /* Who is waiting for us to be unloaded */ | ||
316 | struct task_struct *waiter; | ||
317 | |||
318 | /* Destruction function. */ | ||
319 | void (*exit)(void); | ||
320 | #endif | 309 | #endif |
321 | 310 | ||
322 | #ifdef CONFIG_KALLSYMS | 311 | #ifdef CONFIG_KALLSYMS |
323 | /* We keep the symbol and string tables for kallsyms. */ | 312 | /* We keep the symbol and string tables for kallsyms. */ |
324 | Elf_Sym *symtab; | 313 | Elf_Sym *symtab; |
325 | unsigned long num_symtab; | 314 | unsigned int num_symtab; |
326 | char *strtab; | 315 | char *strtab; |
327 | 316 | ||
328 | /* Section attributes */ | 317 | /* Section attributes */ |
@@ -342,6 +331,21 @@ struct module | |||
342 | struct marker *markers; | 331 | struct marker *markers; |
343 | unsigned int num_markers; | 332 | unsigned int num_markers; |
344 | #endif | 333 | #endif |
334 | |||
335 | #ifdef CONFIG_MODULE_UNLOAD | ||
336 | /* What modules depend on me? */ | ||
337 | struct list_head modules_which_use_me; | ||
338 | |||
339 | /* Who is waiting for us to be unloaded */ | ||
340 | struct task_struct *waiter; | ||
341 | |||
342 | /* Destruction function. */ | ||
343 | void (*exit)(void); | ||
344 | |||
345 | /* Reference counts */ | ||
346 | struct module_ref ref[NR_CPUS]; | ||
347 | #endif | ||
348 | |||
345 | }; | 349 | }; |
346 | #ifndef MODULE_ARCH_INIT | 350 | #ifndef MODULE_ARCH_INIT |
347 | #define MODULE_ARCH_INIT {} | 351 | #define MODULE_ARCH_INIT {} |