From 45322fa24eb3bdd903d012785cfadfb6dcbeb54c Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Mon, 17 Dec 2012 16:04:57 -0800 Subject: [PATCH] --- yaml --- r: 346511 b: refs/heads/master c: cbac5542d48127b546a23d816380a7926eee1c25 h: refs/heads/master i: 346509: 163a41078054a2d5d1c492348b324c61256cca5e 346507: a72582a69f575159a5de663c368160738e4f81a7 346503: 1eb15857fe7b597297f7c52b87daf994f2a0d265 346495: 8fe7baf35e4f3852ab658057c6bcc126244bb16f v: v3 --- [refs] | 2 +- trunk/fs/eventfd.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index e30ae79c2b16..5eeb2c44d2ed 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 55985dd72ab27b47530dcc8bdddd28b69f4abe8b +refs/heads/master: cbac5542d48127b546a23d816380a7926eee1c25 diff --git a/trunk/fs/eventfd.c b/trunk/fs/eventfd.c index d81b9f654086..35470d9b96e6 100644 --- a/trunk/fs/eventfd.c +++ b/trunk/fs/eventfd.c @@ -19,6 +19,8 @@ #include #include #include +#include +#include struct eventfd_ctx { struct kref kref; @@ -284,7 +286,25 @@ static ssize_t eventfd_write(struct file *file, const char __user *buf, size_t c return res; } +#ifdef CONFIG_PROC_FS +static int eventfd_show_fdinfo(struct seq_file *m, struct file *f) +{ + struct eventfd_ctx *ctx = f->private_data; + int ret; + + spin_lock_irq(&ctx->wqh.lock); + ret = seq_printf(m, "eventfd-count: %16llx\n", + (unsigned long long)ctx->count); + spin_unlock_irq(&ctx->wqh.lock); + + return ret; +} +#endif + static const struct file_operations eventfd_fops = { +#ifdef CONFIG_PROC_FS + .show_fdinfo = eventfd_show_fdinfo, +#endif .release = eventfd_release, .poll = eventfd_poll, .read = eventfd_read,