mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-02 12:02:47 +00:00
proc: convert everything to "struct proc_ops"
The most notable change is DEFINE_SHOW_ATTRIBUTE macro split in seq_file.h. Conversion rule is: llseek => proc_lseek unlocked_ioctl => proc_ioctl xxx => proc_xxx delete ".owner = THIS_MODULE" line [akpm@linux-foundation.org: fix drivers/isdn/capi/kcapi_proc.c] [sfr@canb.auug.org.au: fix kernel/sched/psi.c] Link: http://lkml.kernel.org/r/20200122180545.36222f50@canb.auug.org.au Link: http://lkml.kernel.org/r/20191225172546.GB13378@avx2 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
d56c0d45f0
commit
97a32539b9
100 changed files with 960 additions and 1005 deletions
|
@ -535,12 +535,12 @@ static int pgctrl_open(struct inode *inode, struct file *file)
|
|||
return single_open(file, pgctrl_show, PDE_DATA(inode));
|
||||
}
|
||||
|
||||
static const struct file_operations pktgen_fops = {
|
||||
.open = pgctrl_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.write = pgctrl_write,
|
||||
.release = single_release,
|
||||
static const struct proc_ops pktgen_proc_ops = {
|
||||
.proc_open = pgctrl_open,
|
||||
.proc_read = seq_read,
|
||||
.proc_lseek = seq_lseek,
|
||||
.proc_write = pgctrl_write,
|
||||
.proc_release = single_release,
|
||||
};
|
||||
|
||||
static int pktgen_if_show(struct seq_file *seq, void *v)
|
||||
|
@ -1707,12 +1707,12 @@ static int pktgen_if_open(struct inode *inode, struct file *file)
|
|||
return single_open(file, pktgen_if_show, PDE_DATA(inode));
|
||||
}
|
||||
|
||||
static const struct file_operations pktgen_if_fops = {
|
||||
.open = pktgen_if_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.write = pktgen_if_write,
|
||||
.release = single_release,
|
||||
static const struct proc_ops pktgen_if_proc_ops = {
|
||||
.proc_open = pktgen_if_open,
|
||||
.proc_read = seq_read,
|
||||
.proc_lseek = seq_lseek,
|
||||
.proc_write = pktgen_if_write,
|
||||
.proc_release = single_release,
|
||||
};
|
||||
|
||||
static int pktgen_thread_show(struct seq_file *seq, void *v)
|
||||
|
@ -1844,12 +1844,12 @@ static int pktgen_thread_open(struct inode *inode, struct file *file)
|
|||
return single_open(file, pktgen_thread_show, PDE_DATA(inode));
|
||||
}
|
||||
|
||||
static const struct file_operations pktgen_thread_fops = {
|
||||
.open = pktgen_thread_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.write = pktgen_thread_write,
|
||||
.release = single_release,
|
||||
static const struct proc_ops pktgen_thread_proc_ops = {
|
||||
.proc_open = pktgen_thread_open,
|
||||
.proc_read = seq_read,
|
||||
.proc_lseek = seq_lseek,
|
||||
.proc_write = pktgen_thread_write,
|
||||
.proc_release = single_release,
|
||||
};
|
||||
|
||||
/* Think find or remove for NN */
|
||||
|
@ -1926,7 +1926,7 @@ static void pktgen_change_name(const struct pktgen_net *pn, struct net_device *d
|
|||
|
||||
pkt_dev->entry = proc_create_data(dev->name, 0600,
|
||||
pn->proc_dir,
|
||||
&pktgen_if_fops,
|
||||
&pktgen_if_proc_ops,
|
||||
pkt_dev);
|
||||
if (!pkt_dev->entry)
|
||||
pr_err("can't move proc entry for '%s'\n",
|
||||
|
@ -3638,7 +3638,7 @@ static int pktgen_add_device(struct pktgen_thread *t, const char *ifname)
|
|||
pkt_dev->clone_skb = pg_clone_skb_d;
|
||||
|
||||
pkt_dev->entry = proc_create_data(ifname, 0600, t->net->proc_dir,
|
||||
&pktgen_if_fops, pkt_dev);
|
||||
&pktgen_if_proc_ops, pkt_dev);
|
||||
if (!pkt_dev->entry) {
|
||||
pr_err("cannot create %s/%s procfs entry\n",
|
||||
PG_PROC_DIR, ifname);
|
||||
|
@ -3708,7 +3708,7 @@ static int __net_init pktgen_create_thread(int cpu, struct pktgen_net *pn)
|
|||
t->tsk = p;
|
||||
|
||||
pe = proc_create_data(t->tsk->comm, 0600, pn->proc_dir,
|
||||
&pktgen_thread_fops, t);
|
||||
&pktgen_thread_proc_ops, t);
|
||||
if (!pe) {
|
||||
pr_err("cannot create %s/%s procfs entry\n",
|
||||
PG_PROC_DIR, t->tsk->comm);
|
||||
|
@ -3793,7 +3793,7 @@ static int __net_init pg_net_init(struct net *net)
|
|||
pr_warn("cannot create /proc/net/%s\n", PG_PROC_DIR);
|
||||
return -ENODEV;
|
||||
}
|
||||
pe = proc_create(PGCTRL, 0600, pn->proc_dir, &pktgen_fops);
|
||||
pe = proc_create(PGCTRL, 0600, pn->proc_dir, &pktgen_proc_ops);
|
||||
if (pe == NULL) {
|
||||
pr_err("cannot create %s procfs entry\n", PGCTRL);
|
||||
ret = -EINVAL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue