lkml.org 
[lkml]   [2014]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 1/3] timerfd: Implement show_fdinfo method
On Tue, 29 Apr 2014, Cyrill Gorcunov wrote:
>
> +static int timerfd_show(struct seq_file *m, struct file *file)
> +{
> + struct timerfd_ctx *ctx = file->private_data;
> + struct itimerspec t;
> +
> + spin_lock_irq(&ctx->wqh.lock);
> + t.it_value = ktime_to_timespec(timerfd_get_remaining(ctx));
> + t.it_interval = ktime_to_timespec(ctx->tintv);
> + spin_unlock_irq(&ctx->wqh.lock);
> +
> + return seq_printf(m,
> + "clockid: %d\n"
> + "ticks: %llu\n"
> + "settime flags: 0%o\n"
> + "it_value: (%llu, %llu)\n"
> + "it_interval: (%llu, %llu)\n",
> + ctx->clockid, (unsigned long long)ctx->ticks,
> + ctx->settime_flags,
> + (unsigned long long)t.it_value.tv_sec,
> + (unsigned long long)t.it_value.tv_nsec,
> + (unsigned long long)t.it_interval.tv_sec,
> + (unsigned long long)t.it_interval.tv_nsec);
> +}

Shouldn't this depend on CONFIG_PROCFS?

> static const struct file_operations timerfd_fops = {
> .release = timerfd_release,
> .poll = timerfd_poll,
> .read = timerfd_read,
> .llseek = noop_llseek,
> + .show_fdinfo = timerfd_show,
> };
>
> static int timerfd_fget(int fd, struct fd *p)
>
>


\
 
 \ /
  Last update: 2014-05-22 04:01    [W:0.137 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site