Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346511
b: refs/heads/master
c: cbac554
h: refs/heads/master
i:
  346509: 163a410
  346507: a72582a
  346503: 1eb1585
  346495: 8fe7baf
v: v3
  • Loading branch information
Cyrill Gorcunov authored and Linus Torvalds committed Dec 18, 2012
1 parent 75e53b1 commit 45322fa
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 55985dd72ab27b47530dcc8bdddd28b69f4abe8b
refs/heads/master: cbac5542d48127b546a23d816380a7926eee1c25
20 changes: 20 additions & 0 deletions trunk/fs/eventfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include <linux/export.h>
#include <linux/kref.h>
#include <linux/eventfd.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>

struct eventfd_ctx {
struct kref kref;
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 45322fa

Please sign in to comment.