X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Flinux%2Fkobject.h;h=dc773d4043e8480ed581bafdfd8b506b6660cee0;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=331d25b9cc4149ed9fbf05144c36802957647c68;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 331d25b9c..dc773d404 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -22,10 +22,15 @@ #include #include #include +#include +#include #include #define KOBJ_NAME_LEN 20 +/* counter to tag the hotplug event, read only except for the kobject core */ +extern u64 hotplug_seqnum; + struct kobject { char * k_name; char name[KOBJ_NAME_LEN]; @@ -59,9 +64,7 @@ extern void kobject_unregister(struct kobject *); extern struct kobject * kobject_get(struct kobject *); extern void kobject_put(struct kobject *); -extern void kobject_hotplug(const char *action, struct kobject *); - -extern char * kobject_get_path(struct kset *, struct kobject *, int); +extern char * kobject_get_path(struct kobject *, int); struct kobj_type { void (*release)(struct kobject *); @@ -165,6 +168,8 @@ struct subsystem _varname##_subsys = { \ } \ } +/* The global /sys/kernel/ subsystem for people to chain off of */ +extern struct subsystem kernel_subsys; /** * Helpers for setting the kset of registered objects. @@ -234,5 +239,19 @@ struct subsys_attribute { extern int subsys_create_file(struct subsystem * , struct subsys_attribute *); extern void subsys_remove_file(struct subsystem * , struct subsys_attribute *); +#ifdef CONFIG_HOTPLUG +void kobject_hotplug(struct kobject *kobj, enum kobject_action action); +int add_hotplug_env_var(char **envp, int num_envp, int *cur_index, + char *buffer, int buffer_size, int *cur_len, + const char *format, ...) + __attribute__((format (printf, 7, 8))); +#else +static inline void kobject_hotplug(struct kobject *kobj, enum kobject_action action) { } +static inline int add_hotplug_env_var(char **envp, int num_envp, int *cur_index, + char *buffer, int buffer_size, int *cur_len, + const char *format, ...) +{ return 0; } +#endif + #endif /* __KERNEL__ */ #endif /* _KOBJECT_H_ */