mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
proc: introduce proc_create_net{,_data}
Variants of proc_create{,_data} that directly take a struct seq_operations
and deal with network namespaces in ->open and ->release. All callers of
proc_create + seq_open_net converted over, and seq_{open,release}_net are
removed entirely.
Signed-off-by: Christoph Hellwig <[email protected]>
This commit is contained in:
parent
a2dcdee374
commit
c350637227
57 changed files with 202 additions and 939 deletions
|
|
@ -239,19 +239,6 @@ static const struct seq_operations kcm_seq_ops = {
|
|||
.stop = kcm_seq_stop,
|
||||
};
|
||||
|
||||
static int kcm_seq_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
return seq_open_net(inode, file, &kcm_seq_ops,
|
||||
sizeof(struct kcm_proc_mux_state));
|
||||
}
|
||||
|
||||
static const struct file_operations kcm_seq_fops = {
|
||||
.open = kcm_seq_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = seq_release_net,
|
||||
};
|
||||
|
||||
static int kcm_stats_seq_show(struct seq_file *seq, void *v)
|
||||
{
|
||||
struct kcm_psock_stats psock_stats;
|
||||
|
|
@ -376,7 +363,8 @@ static int kcm_proc_init_net(struct net *net)
|
|||
&kcm_stats_seq_fops))
|
||||
goto out_kcm_stats;
|
||||
|
||||
if (!proc_create("kcm", 0444, net->proc_net, &kcm_seq_fops))
|
||||
if (!proc_create_net("kcm", 0444, net->proc_net, &kcm_seq_ops,
|
||||
sizeof(struct kcm_proc_mux_state)))
|
||||
goto out_kcm;
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue