Messages in this thread | | | Date | Thu, 22 May 2014 06:41:57 +0900 (JST) | From | Thomas Gleixner <> | Subject | Re: [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) > >
| |