<!DOCTYPE html><html dir="ltr"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><head><body><div><div><blockquote>---- Original Message ----<br>
From: "Andrey Wagin" <avagin@gmail.com><br>
To: "Shawn Landden" <shawn@churchofgit.com><br>CC: "LKML" <linux-kernel@vger.kernel.org>, "criu@openvz.org" <criu@openvz.org>, "Alexander Viro" <viro@zeniv.linux.org.uk>, linux-fsdevel@vger.kernel.org, "Thomas Gleixner" <tglx@linutronix.de><br>
Sent: Wed, Dec 25, 2013, 12:46 AM<br>
Subject: Re: [CRIU] [PATCH] timerfd: show procfs fdinfo helper<br><br><br>2013/12/24 Shawn Landden <<a target="_blank" href="mailto:shawn@churchofgit.com">shawn@churchofgit.com</a>>:<br><blockquote>| pos: 0<br>| flags: 02004002<br>| clockid: 0<br><br>Cc: Thomas Gleixner <<a target="_blank" href="mailto:tglx@linutronix.de">tglx@linutronix.de</a>><br>Cc: Alexander Viro <<a target="_blank" href="mailto:viro@zeniv.linux.org.uk">viro@zeniv.linux.org.uk</a>><br>Signed-off-by: Shawn Landden <<a target="_blank" href="mailto:shawn@churchofgit.com">shawn@churchofgit.com</a>><br>---<br>fs/timerfd.c | 17 +++++++++++++++++<br>1 file changed, 17 insertions(+)<br><br>diff --git a/fs/timerfd.c b/fs/timerfd.c<br>index 9293121..e5fa587 100644<br>--- a/fs/timerfd.c<br>+++ b/fs/timerfd.c<br>@@ -25,6 +25,7 @@<br>#include <linux/syscalls.h><br>#include <linux/compat.h><br>#include <linux/rcupdate.h><br>+#include <linux/seq_file.h><br><br>struct timerfd_ctx {<br>union {<br>@@ -284,7 +285,23 @@ static ssize_t timerfd_read(struct file *file, char __user *buf, size_t count,<br>return res;<br>}<br><br>+#ifdef CONFIG_PROC_FS<br>+static int timerfd_show_fdinfo(struct seq_file *m, struct file *f)<br>+{<br>+ struct timerfd_ctx *ctx = f->private_data;<br>+ int clockid;<br>+<br>+ clockid = ctx->clockid;<br>+ seq_printf(m, "clockid:\t%d\n", clockid);</blockquote><br><br>I think we can show ctx->ticks, itimerspec here. The ctx->ticks is<br>required for proper dumping and restoring timerfd.<br><br></blockquote><span>How? Shouldn't the itemerspec (from timerfd_gettime and restored with timerfd_settime) and clockid be enough? How do we put the ctx->ticks back into the restored timerfd if we get it out with procfs?</span><br><blockquote><blockquote>+<br>+ return 0;<br>+}<br>+#endif<br>+<br>static const struct file_operations timerfd_fops = {<br>+#ifdef CONFIG_PROC_FS<br>+ .show_fdinfo = timerfd_show_fdinfo,<br>+#endif<br>.release = timerfd_release,<br>.poll = timerfd_poll,<br>.read = timerfd_read,<br>--<br>1.8.5.2.297.g3e57c29<br><br>_______________________________________________<br>CRIU mailing list<br><a target="_blank" href="mailto:CRIU@openvz.org">CRIU@openvz.org</a><br><a target="_blank" href="https://lists.openvz.org/mailman/listinfo/criu">https://lists.openvz.org/mailman/listinfo/criu</a></blockquote></blockquote></div></div></body></html>