OSDN Git Service

proc: Don't let Google Camera and Settings run in the background
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / fs / eventpoll.c
index ac21caa..85e0470 100644 (file)
@@ -1237,15 +1237,23 @@ static int ep_create_wakeup_source(struct epitem *epi)
 {
        const char *name;
        struct wakeup_source *ws;
+       char task_comm_buf[TASK_COMM_LEN];
+       char buf[64];
+
+       get_task_comm(task_comm_buf, current);
 
        if (!epi->ep->ws) {
-               epi->ep->ws = wakeup_source_register("eventpoll");
+               snprintf(buf, sizeof(buf), "epoll_%.*s_epollfd",
+                        (int)sizeof(task_comm_buf), task_comm_buf);
+               epi->ep->ws = wakeup_source_register(buf);
                if (!epi->ep->ws)
                        return -ENOMEM;
        }
 
        name = epi->ffd.file->f_path.dentry->d_name.name;
-       ws = wakeup_source_register(name);
+       snprintf(buf, sizeof(buf), "epoll_%.*s_file:%s",
+                (int)sizeof(task_comm_buf), task_comm_buf, name);
+       ws = wakeup_source_register(buf);
 
        if (!ws)
                return -ENOMEM;