[patch 5/7] signalfd: Use sequential fdinfo engine

From: Cyrill Gorcunov
Date: Wed Nov 06 2013 - 06:52:12 EST


Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxxx>
Cc: Pavel Emelyanov <xemul@xxxxxxxxxxxxx>
Cc: Oleg Nesterov <oleg@xxxxxxxxxx>
Cc: Andrey Vagin <avagin@xxxxxxxxxx>
Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Cc: Alexey Dobriyan <adobriyan@xxxxxxxxx>
Cc: James Bottomley <jbottomley@xxxxxxxxxxxxx>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@xxxxxxxxxxxxxxxxxx>
Cc: Alexey Dobriyan <adobriyan@xxxxxxxxx>
Cc: Matthew Helsley <matt.helsley@xxxxxxxxx>
Cc: "J. Bruce Fields" <bfields@xxxxxxxxxxxx>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@xxxxxxxxxxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---
fs/signalfd.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

Index: linux-2.6.git/fs/signalfd.c
===================================================================
--- linux-2.6.git.orig/fs/signalfd.c
+++ linux-2.6.git/fs/signalfd.c
@@ -230,9 +230,9 @@ static ssize_t signalfd_read(struct file
}

#ifdef CONFIG_PROC_FS
-static int signalfd_show_fdinfo(struct seq_file *m, struct file *f)
+static int seq_show(struct seq_file *m, void *v)
{
- struct signalfd_ctx *ctx = f->private_data;
+ struct signalfd_ctx *ctx = ((struct file *)m->private)->private_data;
sigset_t sigmask;

sigmask = ctx->sigmask;
@@ -241,11 +241,18 @@ static int signalfd_show_fdinfo(struct s

return 0;
}
+
+static struct seq_operations signalfd_fdinfo_op = {
+ .start = single_start,
+ .next = single_next,
+ .stop = single_stop,
+ .show = seq_show,
+};
#endif

static const struct file_operations signalfd_fops = {
#ifdef CONFIG_PROC_FS
- .show_fdinfo = signalfd_show_fdinfo,
+ .fdinfo_op = &signalfd_fdinfo_op,
#endif
.release = signalfd_release,
.poll = signalfd_poll,

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/