mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04: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
|
@ -160,6 +160,19 @@ static const struct file_operations __name ## _fops = { \
|
|||
.release = single_release, \
|
||||
}
|
||||
|
||||
#define DEFINE_PROC_SHOW_ATTRIBUTE(__name) \
|
||||
static int __name ## _open(struct inode *inode, struct file *file) \
|
||||
{ \
|
||||
return single_open(file, __name ## _show, inode->i_private); \
|
||||
} \
|
||||
\
|
||||
static const struct proc_ops __name ## _proc_ops = { \
|
||||
.proc_open = __name ## _open, \
|
||||
.proc_read = seq_read, \
|
||||
.proc_lseek = seq_lseek, \
|
||||
.proc_release = single_release, \
|
||||
}
|
||||
|
||||
static inline struct user_namespace *seq_user_ns(struct seq_file *seq)
|
||||
{
|
||||
#ifdef CONFIG_USER_NS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue