History

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>

Alexey Dobriyan committed 6 years ago

Commit 97a32531 parent d56c0d4100 files · +961 −1006Browse files

Showing the changes to include/linux (2 of 100 files). Show all

Unified · Split

2 files
  1. include/linux/seq_file.h +13 −0
  2. include/linux/sunrpc/stats.h +2 −2
include/linux/seq_file.h+13−0
@@ -160,6 +160,19 @@ static const struct file_operations __name ## _fops = { \ · 159 unmodified lines
160160 .release = single_release, \
161161 }
162162
163+#define DEFINE_PROC_SHOW_ATTRIBUTE(__name) \
164+static int __name ## _open(struct inode *inode, struct file *file) \
165+{ \
166+ return single_open(file, __name ## _show, inode->i_private); \
167+} \
168+ \
169+static const struct proc_ops __name ## _proc_ops = { \
170+ .proc_open = __name ## _open, \
171+ .proc_read = seq_read, \
172+ .proc_lseek = seq_lseek, \
173+ .proc_release = single_release, \
174+}
175+
163176 static inline struct user_namespace *seq_user_ns(struct seq_file *seq)
164177 {
165178 #ifdef CONFIG_USER_NS
include/linux/sunrpc/stats.h+2−2
@@ -63,7 +63,7 @@ struct proc_dir_entry * rpc_proc_register(struct net *,struct rpc_stat *); · 62 unmodified lines
6363 void rpc_proc_unregister(struct net *,const char *);
6464 void rpc_proc_zero(const struct rpc_program *);
6565 struct proc_dir_entry * svc_proc_register(struct net *, struct svc_stat *,
66− const struct file_operations *);
66+ const struct proc_ops *);
6767 void svc_proc_unregister(struct net *, const char *);
6868
6969 void svc_seq_show(struct seq_file *,
@@ -75,7 +75,7 @@ static inline void rpc_proc_unregister(struct net *net, const char *p) {} · 5 unmodified lines
7575 static inline void rpc_proc_zero(const struct rpc_program *p) {}
7676
7777 static inline struct proc_dir_entry *svc_proc_register(struct net *net, struct svc_stat *s,
78− const struct file_operations *f) { return NULL; }
78+ const struct proc_ops *proc_ops) { return NULL; }
7979 static inline void svc_proc_unregister(struct net *net, const char *p) {}
8080
8181 static inline void svc_seq_show(struct seq_file *seq,