Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754864Ab3J3UWa (ORCPT ); Wed, 30 Oct 2013 16:22:30 -0400 Received: from mail-lb0-f178.google.com ([209.85.217.178]:53531 "EHLO mail-lb0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752343Ab3J3UW0 (ORCPT ); Wed, 30 Oct 2013 16:22:26 -0400 Message-Id: <20131030202221.365598265@openvz.org> User-Agent: quilt/0.60-1 Date: Wed, 30 Oct 2013 23:59:55 +0400 From: Cyrill Gorcunov To: linux-kernel@vger.kernel.org Cc: Cyrill Gorcunov , Pavel Emelyanov , Oleg Nesterov , Andrey Vagin , Al Viro , Alexey Dobriyan , James Bottomley , "Aneesh Kumar K.V" , Matthew Helsley , "J. Bruce Fields" , Tvrtko Ursulin , Andrew Morton Subject: [patch 4/6] signalfd: Use sequential fdinfo engine References: <20131030195951.201688764@openvz.org> Content-Disposition: inline; filename=0004-procfs-signalfd Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2263 Lines: 77 Signed-off-by: Cyrill Gorcunov Cc: Pavel Emelyanov Cc: Oleg Nesterov Cc: Andrey Vagin Cc: Al Viro Cc: Alexey Dobriyan Cc: James Bottomley Cc: "Aneesh Kumar K.V" Cc: Alexey Dobriyan Cc: Matthew Helsley Cc: "J. Bruce Fields" Cc: "Aneesh Kumar K.V" Cc: Tvrtko Ursulin Cc: Andrew Morton --- fs/signalfd.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 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,26 @@ static ssize_t signalfd_read(struct file } #ifdef CONFIG_PROC_FS -static int signalfd_show_fdinfo(struct seq_file *m, struct file *f) +static void *seq_start(struct seq_file *m, loff_t *pos) { - struct signalfd_ctx *ctx = f->private_data; + if (*pos == 0) + return m->private; + return NULL; +} + +static void seq_stop(struct seq_file *m, void *v) +{ +} + +static void *seq_next(struct seq_file *m, void *p, loff_t *pos) +{ + ++*pos; + return NULL; +} + +static int seq_show(struct seq_file *m, void *v) +{ + struct signalfd_ctx *ctx = ((struct file *)v)->private_data; sigset_t sigmask; sigmask = ctx->sigmask; @@ -241,11 +258,18 @@ static int signalfd_show_fdinfo(struct s return 0; } + +static struct seq_operations signalfd_fdinfo_ops = { + .start = seq_start, + .next = seq_next, + .stop = seq_stop, + .show = seq_show, +}; #endif static const struct file_operations signalfd_fops = { #ifdef CONFIG_PROC_FS - .show_fdinfo = signalfd_show_fdinfo, + .fdinfo_ops = &signalfd_fdinfo_ops, #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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/