proc: introduce proc_create_seq{,_data}
Variants of proc_create{,_data} that directly take a struct seq_operations argument and drastically reduces the boilerplate code in the callers. All trivial callers converted over. Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
@@ -1382,19 +1382,6 @@ static const struct seq_operations dn_dev_seq_ops = {
|
||||
.stop = dn_dev_seq_stop,
|
||||
.show = dn_dev_seq_show,
|
||||
};
|
||||
|
||||
static int dn_dev_seq_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
return seq_open(file, &dn_dev_seq_ops);
|
||||
}
|
||||
|
||||
static const struct file_operations dn_dev_seq_fops = {
|
||||
.open = dn_dev_seq_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = seq_release,
|
||||
};
|
||||
|
||||
#endif /* CONFIG_PROC_FS */
|
||||
|
||||
static int addr[2];
|
||||
@@ -1424,7 +1411,7 @@ void __init dn_dev_init(void)
|
||||
rtnl_register_module(THIS_MODULE, PF_DECnet, RTM_GETADDR,
|
||||
NULL, dn_nl_dump_ifaddr, 0);
|
||||
|
||||
proc_create("decnet_dev", 0444, init_net.proc_net, &dn_dev_seq_fops);
|
||||
proc_create_seq("decnet_dev", 0444, init_net.proc_net, &dn_dev_seq_ops);
|
||||
|
||||
#ifdef CONFIG_SYSCTL
|
||||
{
|
||||
|
Reference in New Issue
Block a user