Re: [rfc 3/4] fs, eventfd: Add procfs fdinfo helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +static void *seq_start(struct seq_file *m, loff_t *pos)
> +{
> +	struct proc_fdinfo_extra *extra = m->private;
> +	return *pos == 1 ? extra->fd_file : NULL;
> +}
> +
> +static void seq_stop(struct seq_file *m, void *v)
> +{
> +}
> +
> +static void *seq_next(struct seq_file *m, void *p, loff_t *pos)
> +{
> +	struct proc_fdinfo_extra *extra = m->private;
> +	return ++*pos == 1 ? extra->fd_file : NULL;
> +}
> +

<snip>

> +static const struct seq_operations eventfd_fdinfo_ops = {
> +	.start	= seq_start,
> +	.next	= seq_next,
> +	.stop	= seq_stop,
> +	.show	= seq_show,

I think, you can use the single_ part of the seq files engine.

> +};

Thanks,
Pavel
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux