From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932378Ab3KFLs0 (ORCPT ); Wed, 6 Nov 2013 06:48:26 -0500 Received: from mail-la0-f46.google.com ([209.85.215.46]:55619 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932240Ab3KFLsR (ORCPT ); Wed, 6 Nov 2013 06:48:17 -0500 Message-Id: <20131106114812.801879299@openvz.org> User-Agent: quilt/0.60-1 Date: Wed, 06 Nov 2013 15:47:46 +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" , Andrew Morton Subject: [patch 4/7] eventfd: Use sequential fdinfo engine References: <20131106114742.988532945@openvz.org> Content-Disposition: inline; filename=0003-procfs-eventfd-2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: Andrew Morton --- fs/eventfd.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) Index: linux-2.6.git/fs/eventfd.c =================================================================== --- linux-2.6.git.orig/fs/eventfd.c +++ linux-2.6.git/fs/eventfd.c @@ -287,23 +287,28 @@ static ssize_t eventfd_write(struct file } #ifdef CONFIG_PROC_FS -static int eventfd_show_fdinfo(struct seq_file *m, struct file *f) +static int seq_show(struct seq_file *m, void *v) { - struct eventfd_ctx *ctx = f->private_data; - int ret; + struct eventfd_ctx *ctx = ((struct file *)m->private)->private_data; spin_lock_irq(&ctx->wqh.lock); - ret = seq_printf(m, "eventfd-count: %16llx\n", - (unsigned long long)ctx->count); + seq_printf(m, "eventfd-count: %16llx\n", (unsigned long long)ctx->count); spin_unlock_irq(&ctx->wqh.lock); - return ret; + return 0; } + +static struct seq_operations eventfd_fdinfo_op = { + .start = single_start, + .next = single_next, + .stop = single_stop, + .show = seq_show, +}; #endif static const struct file_operations eventfd_fops = { #ifdef CONFIG_PROC_FS - .show_fdinfo = eventfd_show_fdinfo, + .fdinfo_op = &eventfd_fdinfo_op, #endif .release = eventfd_release, .poll = eventfd_poll,