]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
fdinfo: show sigmask for signalfd fd
authorCyrill Gorcunov <gorcunov@openvz.org>
Thu, 29 Nov 2012 03:19:18 +0000 (14:19 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 5 Dec 2012 05:23:58 +0000 (16:23 +1100)
The sigmask is read in lockless manner for a sake of
code simplicity, thus if precise data needed here
the tasks which refer to the signalfd should be
stopped before read.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andrey Vagin <avagin@openvz.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: James Bottomley <jbottomley@parallels.com>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Matthew Helsley <matt.helsley@gmail.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@onelan.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/proc/array.c
fs/signalfd.c
include/linux/proc_fs.h

index 7f7111796ea269dbbed17d2e468d3860dbcb201d..6a91e6ffbcbded857c4513cee0182ec61f899b74 100644 (file)
@@ -220,7 +220,7 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
        seq_putc(m, '\n');
 }
 
-static void render_sigset_t(struct seq_file *m, const char *header,
+void render_sigset_t(struct seq_file *m, const char *header,
                                sigset_t *set)
 {
        int i;
index 8bee4e57091183fbe98a0af52915b66f69821d2c..b534869617352259e647f4c2d099d00e6ca888e8 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/anon_inodes.h>
 #include <linux/signalfd.h>
 #include <linux/syscalls.h>
+#include <linux/proc_fs.h>
 
 void signalfd_cleanup(struct sighand_struct *sighand)
 {
@@ -227,7 +228,24 @@ static ssize_t signalfd_read(struct file *file, char __user *buf, size_t count,
        return total ? total: ret;
 }
 
+#ifdef CONFIG_PROC_FS
+static int signalfd_show_fdinfo(struct seq_file *m, struct file *f)
+{
+       struct signalfd_ctx *ctx = f->private_data;
+       sigset_t sigmask;
+
+       sigmask = ctx->sigmask;
+       signotset(&sigmask);
+       render_sigset_t(m, "sigmask:\t", &sigmask);
+
+       return 0;
+}
+#endif
+
 static const struct file_operations signalfd_fops = {
+#ifdef CONFIG_PROC_FS
+       .show_fdinfo    = signalfd_show_fdinfo,
+#endif
        .release        = signalfd_release,
        .poll           = signalfd_poll,
        .read           = signalfd_read,
index 2e24018b7cecd9fd7a3e7e3090bb9a0d61c53a9d..32676b35d2f5dceb3e340574ad9c7dccdff482dc 100644 (file)
@@ -314,4 +314,7 @@ static inline struct net *PDE_NET(struct proc_dir_entry *pde)
        return pde->parent->data;
 }
 
+#include <linux/signal.h>
+
+void render_sigset_t(struct seq_file *m, const char *header, sigset_t *set);
 #endif /* _LINUX_PROC_FS_H */