projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] powerpc: oprofile support for POWER6
[powerpc.git]
/
lib
/
kobject_uevent.c
diff --git
a/lib/kobject_uevent.c
b/lib/kobject_uevent.c
index
f56e27a
..
7f20e7b
100644
(file)
--- a/
lib/kobject_uevent.c
+++ b/
lib/kobject_uevent.c
@@
-22,12
+22,16
@@
#include <linux/kobject.h>
#include <net/sock.h>
#include <linux/kobject.h>
#include <net/sock.h>
-#define BUFFER_SIZE
1024
/* buffer for the variables */
+#define BUFFER_SIZE
2048
/* buffer for the variables */
#define NUM_ENVP 32 /* number of env pointers */
#define NUM_ENVP 32 /* number of env pointers */
-#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET)
+#if defined(CONFIG_HOTPLUG)
+u64 uevent_seqnum;
+char uevent_helper[UEVENT_HELPER_PATH_LEN] = "/sbin/hotplug";
static DEFINE_SPINLOCK(sequence_lock);
static DEFINE_SPINLOCK(sequence_lock);
+#if defined(CONFIG_NET)
static struct sock *uevent_sock;
static struct sock *uevent_sock;
+#endif
static char *action_to_string(enum kobject_action action)
{
static char *action_to_string(enum kobject_action action)
{
@@
-38,6
+42,10
@@
static char *action_to_string(enum kobject_action action)
return "remove";
case KOBJ_CHANGE:
return "change";
return "remove";
case KOBJ_CHANGE:
return "change";
+ case KOBJ_MOUNT:
+ return "mount";
+ case KOBJ_UMOUNT:
+ return "umount";
case KOBJ_OFFLINE:
return "offline";
case KOBJ_ONLINE:
case KOBJ_OFFLINE:
return "offline";
case KOBJ_ONLINE:
@@
-149,6
+157,7
@@
void kobject_uevent(struct kobject *kobj, enum kobject_action action)
spin_unlock(&sequence_lock);
sprintf(seq_buff, "SEQNUM=%llu", (unsigned long long)seq);
spin_unlock(&sequence_lock);
sprintf(seq_buff, "SEQNUM=%llu", (unsigned long long)seq);
+#if defined(CONFIG_NET)
/* send netlink message */
if (uevent_sock) {
struct sk_buff *skb;
/* send netlink message */
if (uevent_sock) {
struct sk_buff *skb;
@@
-173,6
+182,7
@@
void kobject_uevent(struct kobject *kobj, enum kobject_action action)
netlink_broadcast(uevent_sock, skb, 0, 1, GFP_KERNEL);
}
}
netlink_broadcast(uevent_sock, skb, 0, 1, GFP_KERNEL);
}
}
+#endif
/* call uevent_helper, usually only enabled during early boot */
if (uevent_helper[0]) {
/* call uevent_helper, usually only enabled during early boot */
if (uevent_helper[0]) {
@@
-243,6
+253,7
@@
int add_uevent_var(char **envp, int num_envp, int *cur_index,
}
EXPORT_SYMBOL_GPL(add_uevent_var);
}
EXPORT_SYMBOL_GPL(add_uevent_var);
+#if defined(CONFIG_NET)
static int __init kobject_uevent_init(void)
{
uevent_sock = netlink_kernel_create(NETLINK_KOBJECT_UEVENT, 1, NULL,
static int __init kobject_uevent_init(void)
{
uevent_sock = netlink_kernel_create(NETLINK_KOBJECT_UEVENT, 1, NULL,
@@
-258,5
+269,6
@@
static int __init kobject_uevent_init(void)
}
postcore_initcall(kobject_uevent_init);
}
postcore_initcall(kobject_uevent_init);
+#endif
#endif /* CONFIG_HOTPLUG */
#endif /* CONFIG_HOTPLUG */