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
160 .release = single_release, \160 .release = single_release, \
161}161}
162 162
163#define DEFINE_PROC_SHOW_ATTRIBUTE(__name) \
164static int __name ## _open(struct inode *inode, struct file *file) \
165{ \
166 return single_open(file, __name ## _show, inode->i_private); \
167} \
168 \
169static 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
163static inline struct user_namespace *seq_user_ns(struct seq_file *seq)176static inline struct user_namespace *seq_user_ns(struct seq_file *seq)
164{177{
165#ifdef CONFIG_USER_NS178#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
63void rpc_proc_unregister(struct net *,const char *);63void rpc_proc_unregister(struct net *,const char *);
64void rpc_proc_zero(const struct rpc_program *);64void rpc_proc_zero(const struct rpc_program *);
65struct proc_dir_entry * svc_proc_register(struct net *, struct svc_stat *,65struct proc_dir_entry * svc_proc_register(struct net *, struct svc_stat *,
66 const struct file_operations *);66 const struct proc_ops *);
67void svc_proc_unregister(struct net *, const char *);67void svc_proc_unregister(struct net *, const char *);
68 68
69void svc_seq_show(struct seq_file *,69void 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
75static inline void rpc_proc_zero(const struct rpc_program *p) {}75static inline void rpc_proc_zero(const struct rpc_program *p) {}
76 76
77static inline struct proc_dir_entry *svc_proc_register(struct net *net, struct svc_stat *s,77static 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; }
79static inline void svc_proc_unregister(struct net *net, const char *p) {}79static inline void svc_proc_unregister(struct net *net, const char *p) {}
80 80
81static inline void svc_seq_show(struct seq_file *seq,81static inline void svc_seq_show(struct seq_file *seq,