source: trunk/target/linux/generic-2.6/patches-2.6.34/219-kobject_uevent.patch @ 20140

Last change on this file since 20140 was 20140, checked in by acoul, 7 years ago

generic-2.6: add 2.6.34 preliminary support (patches)

File size: 1.1 KB
  • lib/kobject_uevent.c

    a b u64 uevent_seqnum; 
    2929char uevent_helper[UEVENT_HELPER_PATH_LEN] = CONFIG_UEVENT_HELPER_PATH; 
    3030static DEFINE_SPINLOCK(sequence_lock); 
    3131#if defined(CONFIG_NET) 
    32 static struct sock *uevent_sock; 
     32struct sock *uevent_sock = NULL; 
     33EXPORT_SYMBOL_GPL(uevent_sock); 
    3334#endif 
    3435 
    3536/* the strings here must match the enum in include/linux/kobject.h */ 
    static const char *kobject_actions[] = { 
    4243        [KOBJ_OFFLINE] =        "offline", 
    4344}; 
    4445 
     46u64 uevent_next_seqnum(void) 
     47{ 
     48        u64 seq; 
     49 
     50        spin_lock(&sequence_lock); 
     51        seq = ++uevent_seqnum; 
     52        spin_unlock(&sequence_lock); 
     53 
     54        return seq; 
     55} 
     56EXPORT_SYMBOL_GPL(uevent_next_seqnum); 
     57 
    4558/** 
    4659 * kobject_action_type - translate action string to numeric type 
    4760 * 
    int kobject_uevent_env(struct kobject *k 
    201214                kobj->state_remove_uevent_sent = 1; 
    202215 
    203216        /* we will send an event, so request a new sequence number */ 
    204         spin_lock(&sequence_lock); 
    205         seq = ++uevent_seqnum; 
    206         spin_unlock(&sequence_lock); 
     217        seq = uevent_next_seqnum(); 
    207218        retval = add_uevent_var(env, "SEQNUM=%llu", (unsigned long long)seq); 
    208219        if (retval) 
    209220                goto exit; 
Note: See TracBrowser for help on using the repository browser.