mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +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
|
@ -1251,40 +1251,40 @@ static int psi_fop_release(struct inode *inode, struct file *file)
|
|||
return single_release(inode, file);
|
||||
}
|
||||
|
||||
static const struct file_operations psi_io_fops = {
|
||||
.open = psi_io_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.write = psi_io_write,
|
||||
.poll = psi_fop_poll,
|
||||
.release = psi_fop_release,
|
||||
static const struct proc_ops psi_io_proc_ops = {
|
||||
.proc_open = psi_io_open,
|
||||
.proc_read = seq_read,
|
||||
.proc_lseek = seq_lseek,
|
||||
.proc_write = psi_io_write,
|
||||
.proc_poll = psi_fop_poll,
|
||||
.proc_release = psi_fop_release,
|
||||
};
|
||||
|
||||
static const struct file_operations psi_memory_fops = {
|
||||
.open = psi_memory_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.write = psi_memory_write,
|
||||
.poll = psi_fop_poll,
|
||||
.release = psi_fop_release,
|
||||
static const struct proc_ops psi_memory_proc_ops = {
|
||||
.proc_open = psi_memory_open,
|
||||
.proc_read = seq_read,
|
||||
.proc_lseek = seq_lseek,
|
||||
.proc_write = psi_memory_write,
|
||||
.proc_poll = psi_fop_poll,
|
||||
.proc_release = psi_fop_release,
|
||||
};
|
||||
|
||||
static const struct file_operations psi_cpu_fops = {
|
||||
.open = psi_cpu_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.write = psi_cpu_write,
|
||||
.poll = psi_fop_poll,
|
||||
.release = psi_fop_release,
|
||||
static const struct proc_ops psi_cpu_proc_ops = {
|
||||
.proc_open = psi_cpu_open,
|
||||
.proc_read = seq_read,
|
||||
.proc_lseek = seq_lseek,
|
||||
.proc_write = psi_cpu_write,
|
||||
.proc_poll = psi_fop_poll,
|
||||
.proc_release = psi_fop_release,
|
||||
};
|
||||
|
||||
static int __init psi_proc_init(void)
|
||||
{
|
||||
if (psi_enable) {
|
||||
proc_mkdir("pressure", NULL);
|
||||
proc_create("pressure/io", 0, NULL, &psi_io_fops);
|
||||
proc_create("pressure/memory", 0, NULL, &psi_memory_fops);
|
||||
proc_create("pressure/cpu", 0, NULL, &psi_cpu_fops);
|
||||
proc_create("pressure/io", 0, NULL, &psi_io_proc_ops);
|
||||
proc_create("pressure/memory", 0, NULL, &psi_memory_proc_ops);
|
||||
proc_create("pressure/cpu", 0, NULL, &psi_cpu_proc_ops);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue