lkml.org 
[lkml]   [2013]   [Dec]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [CRIU] [PATCH] timerfd: show procfs fdinfo helper
From
2013/12/24 Shawn Landden <shawn@churchofgit.com>:
> | 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);

I think we can show ctx->ticks, itimerspec here. The ctx->ticks is
required for proper dumping and restoring timerfd.

> +
> + 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
>
> _______________________________________________
> CRIU mailing list
> CRIU@openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


\
 
 \ /
  Last update: 2013-12-25 10:21    [W:0.099 / U:1.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site