OSDN Git Service

netfilter:Notify user space on creating sysfs file
authorDevi Sandeep Endluri V V <dendluri@codeaurora.org>
Mon, 5 Jun 2017 11:04:11 +0000 (16:34 +0530)
committerGerrit - the friendly Code Review server <code-review@localhost>
Wed, 7 Jun 2017 04:08:11 +0000 (21:08 -0700)
uevent indication is required to notify the user space
on creation of sysfs file entry.
This helps in creating specific sysfs labeled entries
for newly created file which are module specific.

Change-Id: I576fa77158445ced6d5efb93b5d724d75f30b03f
CRs-Fixed: 2056628
Acked-by: Manoj Basapathi <manojbm@qti.qualcomm.com>
Signed-off-by: Tejaswi Tanikella <tejaswit@codeaurora.org>
net/netfilter/xt_HARDIDLETIMER.c
net/netfilter/xt_IDLETIMER.c

index 06322e4..ecb4a7f 100644 (file)
@@ -4,7 +4,7 @@
  * Netfilter module to trigger a timer when packet matches.
  * After timer expires a kevent will be sent.
  *
- * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2015, 2017 The Linux Foundation. All rights reserved.
  *
  * Copyright (C) 2004, 2010 Nokia Corporation
  *
@@ -187,6 +187,8 @@ static int hardidletimer_tg_create(struct hardidletimer_tg_info *info)
                pr_debug("couldn't add file to sysfs");
                goto out_free_attr;
        }
+       /*  notify userspace  */
+       kobject_uevent(hardidletimer_tg_kobj, KOBJ_ADD);
 
        list_add(&info->timer->entry, &hardidletimer_tg_list);
 
index 80b32de..f9eb864 100644 (file)
@@ -307,6 +307,8 @@ static int idletimer_tg_create(struct idletimer_tg_info *info)
                pr_debug("couldn't add file to sysfs");
                goto out_free_attr;
        }
+       /* notify userspace */
+       kobject_uevent(idletimer_tg_kobj, KOBJ_ADD);
 
        list_add(&info->timer->entry, &idletimer_tg_list);