From: Shawn Landden <shawn@churchofgit.com>
To: unlisted-recipients:; (no To-header on input)
Cc: criu@openvz.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org,
Shawn Landden <shawn@churchofgit.com>,
Thomas Gleixner <tglx@linutronix.de>,
Alexander Viro <viro@zeniv.linux.org.uk>
Subject: [PATCH] timerfd: show procfs fdinfo helper
Date: Tue, 24 Dec 2013 16:33:07 +0000 [thread overview]
Message-ID: <1387902787-257492-1-git-send-email-shawn@churchofgit.com> (raw)
| pos: 0
| flags: 02004002
| clockid: 0
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Shawn Landden <shawn@churchofgit.com>
---
fs/timerfd.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/fs/timerfd.c b/fs/timerfd.c
index 9293121..e5fa587 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -25,6 +25,7 @@
#include <linux/syscalls.h>
#include <linux/compat.h>
#include <linux/rcupdate.h>
+#include <linux/seq_file.h>
struct timerfd_ctx {
union {
@@ -284,7 +285,23 @@ static ssize_t timerfd_read(struct file *file, char __user *buf, size_t count,
return res;
}
+#ifdef CONFIG_PROC_FS
+static int timerfd_show_fdinfo(struct seq_file *m, struct file *f)
+{
+ struct timerfd_ctx *ctx = f->private_data;
+ int clockid;
+
+ clockid = ctx->clockid;
+ seq_printf(m, "clockid:\t%d\n", clockid);
+
+ return 0;
+}
+#endif
+
static const struct file_operations timerfd_fops = {
+#ifdef CONFIG_PROC_FS
+ .show_fdinfo = timerfd_show_fdinfo,
+#endif
.release = timerfd_release,
.poll = timerfd_poll,
.read = timerfd_read,
--
1.8.5.2.297.g3e57c29
next reply other threads:[~2013-12-24 16:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-24 16:33 Shawn Landden [this message]
2013-12-25 8:47 ` [CRIU] [PATCH] timerfd: show procfs fdinfo helper Andrey Wagin
[not found] ` <7d057f57b1aa6dd3f6871c07374ff5a1@localhost>
2014-02-03 10:44 ` Andrew Vagin
2014-02-03 16:01 ` [PATCH] timerfd: show procfs fdinfo helper, and now accepts write() Shawn Landden
2014-02-04 20:00 ` Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1387902787-257492-1-git-send-email-shawn@churchofgit.com \
--to=shawn@churchofgit.com \
--cc=criu@openvz.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).