Update to 3.4-final.
[linux-flexiantxendom0-3.2.10.git] / fs / signalfd.c
index bdd4496..7ae2a57 100644 (file)
 #include <linux/signalfd.h>
 #include <linux/syscalls.h>
 
+void signalfd_cleanup(struct sighand_struct *sighand)
+{
+       wait_queue_head_t *wqh = &sighand->signalfd_wqh;
+       /*
+        * The lockless check can race with remove_wait_queue() in progress,
+        * but in this case its caller should run under rcu_read_lock() and
+        * sighand_cachep is SLAB_DESTROY_BY_RCU, we can safely return.
+        */
+       if (likely(!waitqueue_active(wqh)))
+               return;
+
+       /* wait_queue_t->func(POLLFREE) should do remove_wait_queue() */
+       wake_up_poll(wqh, POLLHUP | POLLFREE);
+}
+
 struct signalfd_ctx {
        sigset_t sigmask;
 };
@@ -216,6 +231,7 @@ static const struct file_operations signalfd_fops = {
        .release        = signalfd_release,
        .poll           = signalfd_poll,
        .read           = signalfd_read,
+       .llseek         = noop_llseek,
 };
 
 SYSCALL_DEFINE4(signalfd4, int, ufd, sigset_t __user *, user_mask,