fix module_update_markers() compile error
[sfrench/cifs-2.6.git] / include / linux / module.h
index b6a646cea1cba4f1a3cbd9a3139077a3c162e21d..819c4e889bf16f0157f45ad4326afa7e83418582 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/stringify.h>
 #include <linux/kobject.h>
 #include <linux/moduleparam.h>
+#include <linux/marker.h>
 #include <asm/local.h>
 
 #include <asm/module.h>
@@ -177,7 +178,7 @@ void *__symbol_get_gpl(const char *symbol);
 #define __CRC_SYMBOL(sym, sec)                                 \
        extern void *__crc_##sym __attribute__((weak));         \
        static const unsigned long __kcrctab_##sym              \
-       __attribute_used__                                      \
+       __used                                                  \
        __attribute__((section("__kcrctab" sec), unused))       \
        = (unsigned long) &__crc_##sym;
 #else
@@ -192,7 +193,7 @@ void *__symbol_get_gpl(const char *symbol);
        __attribute__((section("__ksymtab_strings")))           \
        = MODULE_SYMBOL_PREFIX #sym;                            \
        static const struct kernel_symbol __ksymtab_##sym       \
-       __attribute_used__                                      \
+       __used                                                  \
        __attribute__((section("__ksymtab" sec), unused))       \
        = { (unsigned long)&sym, __kstrtab_##sym }
 
@@ -312,9 +313,6 @@ struct module
        /* Arch-specific module values */
        struct mod_arch_specific arch;
 
-       /* Am I unsafe to unload? */
-       int unsafe;
-
        unsigned int taints;    /* same bits as kernel:tainted */
 
 #ifdef CONFIG_GENERIC_BUG
@@ -346,6 +344,9 @@ struct module
 
        /* Section attributes */
        struct module_sect_attrs *sect_attrs;
+
+       /* Notes attributes */
+       struct module_notes_attrs *notes_attrs;
 #endif
 
        /* Per-cpu data. */
@@ -354,6 +355,10 @@ struct module
        /* The command line arguments (may be mangled).  People like
           keeping pointers to this stuff */
        char *args;
+#ifdef CONFIG_MARKERS
+       struct marker *markers;
+       unsigned int num_markers;
+#endif
 };
 #ifndef MODULE_ARCH_INIT
 #define MODULE_ARCH_INIT {}
@@ -441,21 +446,14 @@ static inline void __module_get(struct module *module)
        __mod ? __mod->name : "kernel";         \
 })
 
-#define __unsafe(mod)                                                       \
-do {                                                                        \
-       if (mod && !(mod)->unsafe) {                                         \
-               printk(KERN_WARNING                                          \
-                      "Module %s cannot be unloaded due to unsafe usage in" \
-                      " %s:%u\n", (mod)->name, __FILE__, __LINE__);         \
-               (mod)->unsafe = 1;                                           \
-       }                                                                    \
-} while(0)
-
-/* For kallsyms to ask for address resolution.  NULL means not found. */
+/* For kallsyms to ask for address resolution.  namebuf should be at
+ * least KSYM_NAME_LEN long: a pointer to namebuf is returned if
+ * found, otherwise NULL. */
 const char *module_address_lookup(unsigned long addr,
-                                 unsigned long *symbolsize,
-                                 unsigned long *offset,
-                                 char **modname);
+                           unsigned long *symbolsize,
+                           unsigned long *offset,
+                           char **modname,
+                           char *namebuf);
 int lookup_module_symbol_name(unsigned long addr, char *symname);
 int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name);
 
@@ -467,6 +465,8 @@ int unregister_module_notifier(struct notifier_block * nb);
 
 extern void print_modules(void);
 
+extern void module_update_markers(void);
+
 #else /* !CONFIG_MODULES... */
 #define EXPORT_SYMBOL(sym)
 #define EXPORT_SYMBOL_GPL(sym)
@@ -518,13 +518,12 @@ static inline void module_put(struct module *module)
 
 #define module_name(mod) "kernel"
 
-#define __unsafe(mod)
-
 /* For kallsyms to ask for address resolution.  NULL means not found. */
 static inline const char *module_address_lookup(unsigned long addr,
-                                               unsigned long *symbolsize,
-                                               unsigned long *offset,
-                                               char **modname)
+                                         unsigned long *symbolsize,
+                                         unsigned long *offset,
+                                         char **modname,
+                                         char *namebuf)
 {
        return NULL;
 }
@@ -568,13 +567,19 @@ static inline void print_modules(void)
 {
 }
 
+static inline void module_update_markers(void)
+{
+}
+
 #endif /* CONFIG_MODULES */
 
 struct device_driver;
 #ifdef CONFIG_SYSFS
 struct module;
 
-extern struct kset module_subsys;
+extern struct kset *module_kset;
+extern struct kobj_type module_ktype;
+extern int module_sysfs_initialized;
 
 int mod_sysfs_init(struct module *mod);
 int mod_sysfs_setup(struct module *mod,
@@ -607,21 +612,6 @@ static inline void module_remove_modinfo_attrs(struct module *mod)
 
 #endif /* CONFIG_SYSFS */
 
-#if defined(CONFIG_SYSFS) && defined(CONFIG_MODULES)
-
-void module_add_driver(struct module *mod, struct device_driver *drv);
-void module_remove_driver(struct device_driver *drv);
-
-#else /* not both CONFIG_SYSFS && CONFIG_MODULES */
-
-static inline void module_add_driver(struct module *mod, struct device_driver *drv)
-{ }
-
-static inline void module_remove_driver(struct device_driver *drv)
-{ }
-
-#endif
-
 #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x)
 
 /* BELOW HERE ALL THESE ARE OBSOLETE AND WILL VANISH */