Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
mptcp: Fix up build error for mptcp proc filesystem
Browse files Browse the repository at this point in the history
proc_create_net_single() now provides a simpler way to add an entry to
the proc filesystem, and the old single_open_net() and
single_release_net() functions are no longer available.

Signed-off-by: Mat Martineau <[email protected]>
  • Loading branch information
mjmartineau authored and cpaasch committed Sep 14, 2018
1 parent dd64d1c commit 4379ee6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 45 deletions.
34 changes: 4 additions & 30 deletions net/mptcp/mptcp_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2879,19 +2879,6 @@ static int mptcp_pm_seq_show(struct seq_file *seq, void *v)
return 0;
}

static int mptcp_pm_seq_open(struct inode *inode, struct file *file)
{
return single_open_net(inode, file, mptcp_pm_seq_show);
}

static const struct file_operations mptcp_pm_seq_fops = {
.owner = THIS_MODULE,
.open = mptcp_pm_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release_net,
};

static int mptcp_snmp_seq_show(struct seq_file *seq, void *v)
{
struct net *net = seq->private;
Expand All @@ -2905,19 +2892,6 @@ static int mptcp_snmp_seq_show(struct seq_file *seq, void *v)
return 0;
}

static int mptcp_snmp_seq_open(struct inode *inode, struct file *file)
{
return single_open_net(inode, file, mptcp_snmp_seq_show);
}

static const struct file_operations mptcp_snmp_seq_fops = {
.owner = THIS_MODULE,
.open = mptcp_snmp_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release_net,
};

static int mptcp_pm_init_net(struct net *net)
{
net->mptcp.mptcp_statistics = alloc_percpu(struct mptcp_mib);
Expand All @@ -2928,11 +2902,11 @@ static int mptcp_pm_init_net(struct net *net)
net->mptcp.proc_net_mptcp = proc_net_mkdir(net, "mptcp_net", net->proc_net);
if (!net->mptcp.proc_net_mptcp)
goto out_proc_net_mptcp;
if (!proc_create("mptcp", S_IRUGO, net->mptcp.proc_net_mptcp,
&mptcp_pm_seq_fops))
if (!proc_create_net_single("mptcp", S_IRUGO, net->mptcp.proc_net_mptcp,
mptcp_pm_seq_show, NULL))
goto out_mptcp_net_mptcp;
if (!proc_create("snmp", S_IRUGO, net->mptcp.proc_net_mptcp,
&mptcp_snmp_seq_fops))
if (!proc_create_net_single("snmp", S_IRUGO, net->mptcp.proc_net_mptcp,
mptcp_snmp_seq_show, NULL))
goto out_mptcp_net_snmp;
#endif

Expand Down
17 changes: 2 additions & 15 deletions net/mptcp/mptcp_fullmesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -1858,19 +1858,6 @@ static int mptcp_fm_seq_show(struct seq_file *seq, void *v)
return 0;
}

static int mptcp_fm_seq_open(struct inode *inode, struct file *file)
{
return single_open_net(inode, file, mptcp_fm_seq_show);
}

static const struct file_operations mptcp_fm_seq_fops = {
.owner = THIS_MODULE,
.open = mptcp_fm_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release_net,
};

static int mptcp_fm_init_net(struct net *net)
{
struct mptcp_loc_addr *mptcp_local;
Expand All @@ -1887,8 +1874,8 @@ static int mptcp_fm_init_net(struct net *net)
goto err_mptcp_local;
}

if (!proc_create("mptcp_fullmesh", S_IRUGO, net->proc_net,
&mptcp_fm_seq_fops)) {
if (!proc_create_net_single("mptcp_fullmesh", S_IRUGO, net->proc_net,
mptcp_fm_seq_show, NULL)) {
err = -ENOMEM;
goto err_seq_fops;
}
Expand Down

0 comments on commit 4379ee6

Please sign in to comment.