proc: decouple proc from VFS with "struct proc_ops"
Subsystems (63)
PATCH 1/2 proc: decouple proc from VFS with "struct proc_ops"
Currently core /proc code uses "struct file_operations" for custom hooks, however, VFS doesn't directly call them. Every time VFS expands file_operations hook set, /proc code bloats for no reason.
Introduce "struct proc_ops" which contains only those hooks which /proc allows to call into (open, release, read, write, ioctl, mmap, poll). It doesn't contain module pointer as well.
Save ~184 bytes per usage:
add/remove: 26/26 grow/shrink: 1/4 up/down: 1922/-6674 (-4752)
Function old new delta
sysvipc_proc_ops - 72 +72
...
config_gz_proc_ops - 72 +72
proc_get_inode 289 339 +50
proc_reg_get_unmapped_area 110 107 -3
close_pdeo 227 224 -3
proc_reg_open 289 284 -5
proc_create_data 60 53 -7
rt_cpu_seq_fops 256 - -256
...
default_affinity_proc_fops 256 - -256
Total: Before=5430095, After=5425343, chg -0.09%
---
fs/proc/generic.c | 38 +++++++++++------------- fs/proc/inode.c | 76 ++++++++++++++++++++++++------------------------ fs/proc/internal.h | 5 ++- fs/proc/proc_net.c | 32 ++++++++++---------- fs/proc/proc_sysctl.c | 2 - fs/proc/root.c | 2 - include/linux/proc_fs.h | 23 ++++++++++++-- 7 files changed, 98 insertions(+), 80 deletions(-)
fs/proc/generic.c +18 -20
@@ -473,7 +473,7 @@ struct proc_dir_entry *proc_mkdir_data(const char *name, umode_t mode, ent =__proc_create (&parent, name,S_IFDIR | mode,2 );if (ent) { ent->data = data; - ent->proc_fops = &proc_dir_operations; + ent->proc_dir_ops = &proc_dir_operations; ent->proc_iops = &proc_dir_inode_operations; ent =proc_register (parent, ent); }
@@ -503,7 +503,7 @@ struct proc_dir_entry *proc_create_mount_point(const char *name) ent =__proc_create (&parent, name, mode,2 );if (ent) { ent->data =NULL ; - ent->proc_fops =NULL ; + ent->proc_dir_ops =NULL ; ent->proc_iops =NULL ; ent =proc_register (parent, ent); }
@@ -533,25 +533,23 @@ struct proc_dir_entry *proc_create_reg(const char *name, umode_t mode,struct proc_dir_entry *proc_create_data (const char *name,umode_t mode,struct proc_dir_entry *parent, -const struct file_operations *proc_fops,void *data) +const struct proc_ops *proc_ops,void *data) {struct proc_dir_entry *p; -BUG_ON (proc_fops ==NULL ); - p =proc_create_reg (name, mode, &parent, data);if (!p)return NULL ; - p->proc_fops = proc_fops; + p->proc_ops = proc_ops;return proc_register (parent, p); }EXPORT_SYMBOL (proc_create_data);struct proc_dir_entry *proc_create (const char *name,umode_t mode,struct proc_dir_entry *parent, -const struct file_operations *proc_fops) +const struct proc_ops *proc_ops) { -return proc_create_data (name, mode, parent, proc_fops,NULL ); +return proc_create_data (name, mode, parent, proc_ops,NULL ); }EXPORT_SYMBOL (proc_create);
@@ -573,11 +571,11 @@ static int proc_seq_release(struct inode *inode, struct file *file)return seq_release (inode, file); } -static const struct file_operations proc_seq_fops = { - .open = proc_seq_open, - .read = seq_read, - .llseek = seq_lseek, - .release = proc_seq_release, +static const struct proc_ops proc_seq_ops = { + .proc_open = proc_seq_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = proc_seq_release, }; struct proc_dir_entry *proc_create_seq_private(const char *name, umode_t mode,
@@ -589,7 +587,7 @@ struct proc_dir_entry *proc_create_seq_private(const char *name, umode_t mode, p =proc_create_reg (name, mode, &parent, data);if (!p)return NULL ; - p->proc_fops = &proc_seq_fops; + p->proc_ops = &proc_seq_ops; p->seq_ops = ops; p->state_size = state_size;return proc_register (parent, p);
@@ -603,11 +601,11 @@ static int proc_single_open(struct inode *inode, struct file *file)return single_open (file, de->single_show, de->data); } -static const struct file_operations proc_single_fops = { - .open = proc_single_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, +static const struct proc_ops proc_single_ops = { + .proc_open = proc_single_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, }; struct proc_dir_entry *proc_create_single_data(const char *name, umode_t mode,
@@ -619,7 +617,7 @@ struct proc_dir_entry *proc_create_single_data(const char *name, umode_t mode, p =proc_create_reg (name, mode, &parent, data);if (!p)return NULL ; - p->proc_fops = &proc_single_fops; + p->proc_ops = &proc_single_ops; p->single_show = show;return proc_register (parent, p); }
fs/proc/inode.c +39 -37
164 lines not on this page · raw message
fs/proc/internal.h +4 -1
@@ -39,7 +39,10 @@ struct proc_dir_entry {spinlock_t pde_unload_lock;struct completion *pde_unload_completion;const struct inode_operations *proc_iops; -const struct file_operations *proc_fops; +union { +const struct proc_ops *proc_ops; +const struct file_operations *proc_dir_ops; + };const struct dentry_operations *proc_dops;union {const struct seq_operations *seq_ops;
fs/proc/proc_net.c +16 -16
@@ -90,12 +90,12 @@ static int seq_release_net(struct inode *ino, struct file *f)return 0 ; } -static const struct file_operations proc_net_seq_fops = { - .open = seq_open_net, - .read = seq_read, - .write = proc_simple_write, - .llseek = seq_lseek, - .release = seq_release_net, +static const struct proc_ops proc_net_seq_ops = { + .proc_open = seq_open_net, + .proc_read = seq_read, + .proc_write = proc_simple_write, + .proc_lseek = seq_lseek, + .proc_release = seq_release_net, }; struct proc_dir_entry *proc_create_net_data(const char *name, umode_t mode,
@@ -108,7 +108,7 @@ struct proc_dir_entry *proc_create_net_data(const char *name, umode_t mode,if (!p)return NULL ;pde_force_lookup (p); - p->proc_fops = &proc_net_seq_fops; + p->proc_ops = &proc_net_seq_ops; p->seq_ops = ops; p->state_size = state_size;return proc_register (parent, p);
@@ -152,7 +152,7 @@ struct proc_dir_entry *proc_create_net_data_write(const char *name, umode_t modeif (!p)return NULL ;pde_force_lookup (p); - p->proc_fops = &proc_net_seq_fops; + p->proc_ops = &proc_net_seq_ops; p->seq_ops = ops; p->state_size = state_size; p->write = write;
@@ -183,12 +183,12 @@ static int single_release_net(struct inode *ino, struct file *f)return single_release (ino, f); } -static const struct file_operations proc_net_single_fops = { - .open = single_open_net, - .read = seq_read, - .write = proc_simple_write, - .llseek = seq_lseek, - .release = single_release_net, +static const struct proc_ops proc_net_single_ops = { + .proc_open = single_open_net, + .proc_read = seq_read, + .proc_write = proc_simple_write, + .proc_lseek = seq_lseek, + .proc_release = single_release_net, }; struct proc_dir_entry *proc_create_net_single(const char *name, umode_t mode,
@@ -201,7 +201,7 @@ struct proc_dir_entry *proc_create_net_single(const char *name, umode_t mode,if (!p)return NULL ;pde_force_lookup (p); - p->proc_fops = &proc_net_single_fops; + p->proc_ops = &proc_net_single_ops; p->single_show = show;return proc_register (parent, p); }
@@ -244,7 +244,7 @@ struct proc_dir_entry *proc_create_net_single_write(const char *name, umode_t moif (!p)return NULL ;pde_force_lookup (p); - p->proc_fops = &proc_net_single_fops; + p->proc_ops = &proc_net_single_ops; p->single_show = show; p->write = write;return proc_register (parent, p);
fs/proc/proc_sysctl.c +1 -1
@@ -1720,7 +1720,7 @@ int __init proc_sys_init(void) proc_sys_root =proc_mkdir ("sys" ,NULL ); proc_sys_root->proc_iops = &proc_sys_dir_operations; - proc_sys_root->proc_fops = &proc_sys_dir_file_operations; + proc_sys_root->proc_dir_ops = &proc_sys_dir_file_operations; proc_sys_root->nlink =0 ;return sysctl_init ();
fs/proc/root.c +1 -1
@@ -292,7 +292,7 @@ struct proc_dir_entry proc_root = { .nlink = 2, .refcnt = REFCOUNT_INIT(1), .proc_iops = &proc_root_inode_operations, - .proc_fops = &proc_root_operations, + .proc_dir_ops = &proc_root_operations, .parent = &proc_root, .subdir = RB_ROOT, .name = "/proc",
include/linux/proc_fs.h +19 -4
@@ -12,6 +12,21 @@ struct proc_dir_entry;struct seq_file ;struct seq_operations ; +struct proc_ops { +int (*proc_open)(struct inode *,struct file *); +ssize_t (*proc_read)(struct file *,char __user *,size_t ,loff_t *); +ssize_t (*proc_write)(struct file *,const char __user *,size_t ,loff_t *); +loff_t (*proc_lseek)(struct file *,loff_t ,int ); +int (*proc_release)(struct inode *,struct file *); +__poll_t (*proc_poll)(struct file *,struct poll_table_struct *); +long (*proc_ioctl)(struct file *,unsigned int ,unsigned long ); +#ifdef CONFIG_COMPAT +long (*proc_compat_ioctl)(struct file *,unsigned int ,unsigned long ); +#endif +int (*proc_mmap)(struct file *,struct vm_area_struct *); +unsigned long (*proc_get_unmapped_area)(struct file *,unsigned long ,unsigned long ,unsigned long ,unsigned long ); +}; +#ifdef CONFIG_PROC_FS typedef int (*proc_write_t )(struct file *,char *,size_t );
@@ -43,10 +58,10 @@ struct proc_dir_entry *proc_create_single_data(const char *name, umode_t mode,extern struct proc_dir_entry *proc_create_data (const char *,umode_t ,struct proc_dir_entry *, -const struct file_operations *, +const struct proc_ops *,void *); -struct proc_dir_entry *proc_create (const char *name,umode_t mode,struct proc_dir_entry *parent,const struct file_operations *proc_fops); +struct proc_dir_entry *proc_create (const char *name,umode_t mode,struct proc_dir_entry *parent,const struct proc_ops *proc_ops);extern void proc_set_size (struct proc_dir_entry *,loff_t );extern void proc_set_user (struct proc_dir_entry *,kuid_t ,kgid_t );extern void *PDE_DATA (const struct inode *);
@@ -108,8 +123,8 @@ static inline struct proc_dir_entry *proc_mkdir_mode(const char *name,#define proc_create_seq (name, mode, parent, ops) ({NULL;})#define proc_create_single (name, mode, parent, show) ({NULL;})#define proc_create_single_data (name, mode, parent, show, data) ({NULL;}) -#define proc_create (name, mode, parent, proc_fops) ({NULL;}) -#define proc_create_data (name, mode, parent, proc_fops, data) ({NULL;}) +#define proc_create (name, mode, parent, proc_ops) ({NULL;}) +#define proc_create_data (name, mode, parent, proc_ops, data) ({NULL;})static inline void proc_set_size (struct proc_dir_entry *de,loff_t size) {}static inline void proc_set_user (struct proc_dir_entry *de,kuid_t uid,kgid_t gid) {}
PATCH 2/2 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
---
NON BISECTABLE CHANGE
MERGE INTO PREVIOUS PATCH!
arch/alpha/kernel/srm_env.c | 17 +- arch/arm/kernel/atags_proc.c | 8 - arch/arm/mm/alignment.c | 14 +- arch/ia64/kernel/salinfo.c | 24 ++-- arch/m68k/kernel/bootinfo_proc.c | 8 - arch/mips/lasat/picvue_proc.c | 31 ++--- arch/powerpc/kernel/proc_powerpc.c | 10 - arch/powerpc/kernel/rtas-proc.c | 70 +++++------ arch/powerpc/kernel/rtas_flash.c | 34 ++--- arch/powerpc/kernel/rtasd.c | 14 +- arch/powerpc/mm/numa.c | 12 +- arch/powerpc/platforms/pseries/lpar.c | 24 ++-- arch/powerpc/platforms/pseries/lparcfg.c | 14 +- arch/powerpc/platforms/pseries/reconfig.c | 8 - arch/powerpc/platforms/pseries/scanlog.c | 15 +- arch/sh/mm/alignment.c | 17 +- arch/sparc/kernel/led.c | 15 +- arch/um/drivers/mconsole_kern.c | 9 - arch/um/kernel/exitcode.c | 15 +- arch/um/kernel/process.c | 15 +- arch/x86/kernel/apic/x2apic_uv_x.c | 26 ++-- arch/x86/kernel/cpu/mtrr/if.c | 21 +-- arch/x86/platform/uv/tlb_uv.c | 14 +- arch/xtensa/platforms/iss/simdisk.c | 10 - drivers/acpi/battery.c | 15 +- drivers/acpi/proc.c | 15 +- drivers/hwmon/dell-smm-hwmon.c | 15 +- drivers/ide/ide-proc.c | 19 +-- drivers/input/input.c | 28 ++-- drivers/macintosh/via-pmu.c | 17 +- drivers/md/md.c | 15 +- drivers/misc/sgi-gru/gruprocfs.c | 42 +++---- drivers/net/wireless/cisco/airo.c | 98 +++++++--------- drivers/net/wireless/intel/ipw2x00/libipw_module.c | 15 +- drivers/net/wireless/intersil/hostap/hostap_hw.c | 4 drivers/net/wireless/intersil/hostap/hostap_proc.c | 14 +- drivers/net/wireless/intersil/hostap/hostap_wlan.h | 2 drivers/net/wireless/ray_cs.c | 20 +-- drivers/parisc/led.c | 17 +- drivers/pci/proc.c | 25 ++-- drivers/platform/x86/thinkpad_acpi.c | 15 +- drivers/platform/x86/toshiba_acpi.c | 60 ++++------ drivers/pnp/isapnp/proc.c | 9 - drivers/pnp/pnpbios/proc.c | 17 +- drivers/s390/block/dasd_proc.c | 15 +- drivers/s390/cio/blacklist.c | 14 +- drivers/s390/cio/css.c | 11 - drivers/scsi/esas2r/esas2r_main.c | 9 + drivers/scsi/scsi_devinfo.c | 15 +- drivers/scsi/scsi_proc.c | 29 ++-- drivers/scsi/sg.c | 30 ++--- drivers/staging/isdn/hysdn/hysdn_procconf.c | 15 +- drivers/staging/isdn/hysdn/hysdn_proclog.c | 17 +- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 14 +- drivers/tty/sysrq.c | 8 - drivers/usb/gadget/function/rndis.c | 17 +- drivers/video/fbdev/via/viafbdev.c | 105 ++++++++--------- drivers/zorro/proc.c | 9 - fs/cifs/cifs_debug.c | 108 +++++++++--------- fs/cifs/dfs_cache.c | 13 +- fs/cifs/dfs_cache.h | 2 fs/fscache/internal.h | 2 fs/fscache/object-list.c | 11 + fs/fscache/proc.c | 2 fs/jbd2/journal.c | 13 +- fs/jfs/jfs_debug.c | 14 +- fs/lockd/procfs.c | 12 +- fs/nfsd/nfsctl.c | 13 +- fs/nfsd/stats.c | 12 +- fs/proc/cpuinfo.c | 12 +- fs/proc/kcore.c | 13 +- fs/proc/kmsg.c | 14 +- fs/proc/page.c | 24 ++-- fs/proc/stat.c | 12 +- fs/proc/vmcore.c | 10 - include/linux/seq_file.h | 13 ++ include/linux/sunrpc/stats.h | 4 ipc/util.c | 14 +- kernel/configs.c | 9 - kernel/irq/proc.c | 42 +++---- kernel/kallsyms.c | 12 +- kernel/latencytop.c | 14 +- kernel/locking/lockdep_proc.c | 15 +- kernel/module.c | 12 +- kernel/profile.c | 24 ++-- kernel/sched/psi.c | 48 ++++---- mm/slab_common.c | 15 +- mm/swapfile.c | 14 +- net/atm/mpoa_proc.c | 17 +- net/atm/proc.c | 8 - net/core/pktgen.c | 44 +++---- net/ipv4/ipconfig.c | 10 - net/ipv4/netfilter/ipt_CLUSTERIP.c | 16 +- net/ipv4/route.c | 24 ++-- net/netfilter/xt_recent.c | 17 +- net/sunrpc/auth_gss/svcauth_gss.c | 10 - net/sunrpc/cache.c | 45 +++---- net/sunrpc/stats.c | 21 +-- samples/kfifo/bytestream-example.c | 11 - samples/kfifo/inttype-example.c | 11 - samples/kfifo/record-example.c | 11 - sound/core/info.c | 36 ++---- 102 files changed, 986 insertions(+), 1033 deletions(-)
arch/alpha/kernel/srm_env.c +8 -9
@@ -119,13 +119,12 @@ static ssize_t srm_env_proc_write(struct file *file, const char __user *buffer,return res; } -static const struct file_operations srm_env_proc_fops = { - .owner =THIS_MODULE , - .open = srm_env_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = srm_env_proc_write, +static const struct proc_ops srm_env_proc_ops = { + .proc_open = srm_env_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = srm_env_proc_write, }; static int __init
@@ -182,7 +181,7 @@ srm_env_init(void) entry = srm_named_entries;while (entry->name && entry->id) {if (!proc_create_data (entry->name,0644 , named_dir, - &srm_env_proc_fops, (void *)entry->id)) + &srm_env_proc_ops, (void *)entry->id)) goto cleanup; entry++; }
@@ -194,7 +193,7 @@ srm_env_init(void)char name[4 ];sprintf (name,"%ld" , var_num);if (!proc_create_data (name,0644 , numbered_dir, - &srm_env_proc_fops, (void *)var_num)) + &srm_env_proc_ops, (void *)var_num)) goto cleanup; }
arch/arm/kernel/atags_proc.c +4 -4
@@ -17,9 +17,9 @@ static ssize_t atags_read(struct file *file, char __user *buf,return simple_read_from_buffer (buf, count, ppos, b->data, b->size); } -static const struct file_operations atags_fops = { - .read = atags_read, - .llseek = default_llseek, +static const struct proc_ops atags_proc_ops = { + .proc_read = atags_read, + .proc_lseek = default_llseek, };#define BOOT_PARAMS_SIZE 1536
@@ -61,7 +61,7 @@ static int __init init_atags_procfs(void) b->size = size;memcpy (b->data, atags_copy, size); - tags_entry =proc_create_data ("atags" ,0400 ,NULL , &atags_fops, b); + tags_entry =proc_create_data ("atags" ,0400 ,NULL , &atags_proc_ops, b);if (!tags_entry) goto nomem;
arch/arm/mm/alignment.c +7 -7
@@ -162,12 +162,12 @@ static ssize_t alignment_proc_write(struct file *file, const char __user *buffer return count; } -static const struct file_operations alignment_proc_fops = { - .open = alignment_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = alignment_proc_write, +static const struct proc_ops alignment_proc_ops = { + .proc_open = alignment_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = alignment_proc_write, };#endif /* CONFIG_PROC_FS */
@@ -1016,7 +1016,7 @@ static int __init alignment_init(void)struct proc_dir_entry *res; res =proc_create ("cpu/alignment" ,S_IWUSR |S_IRUGO ,NULL , - &alignment_proc_fops); + &alignment_proc_ops);if (!res)return -ENOMEM ;#endif
arch/ia64/kernel/salinfo.c +12 -12
@@ -331,10 +331,10 @@ salinfo_event_read(struct file *file, char __user *buffer, size_t count, loff_treturn size; } -static const struct file_operations salinfo_event_fops = { - .open = salinfo_event_open, - .read = salinfo_event_read, - .llseek = noop_llseek, +static const struct proc_ops salinfo_event_proc_ops = { + .proc_open = salinfo_event_open, + .proc_read = salinfo_event_read, + .proc_lseek = noop_llseek, }; static int
@@ -534,12 +534,12 @@ salinfo_log_write(struct file *file, const char __user *buffer, size_t count, loreturn count; } -static const struct file_operations salinfo_data_fops = { - .open = salinfo_log_open, - .release = salinfo_log_release, - .read = salinfo_log_read, - .write = salinfo_log_write, - .llseek = default_llseek, +static const struct proc_ops salinfo_data_proc_ops = { + .proc_open = salinfo_log_open, + .proc_release = salinfo_log_release, + .proc_read = salinfo_log_read, + .proc_write = salinfo_log_write, + .proc_lseek = default_llseek, };static int salinfo_cpu_online (unsigned int cpu)
@@ -617,13 +617,13 @@ salinfo_init(void)continue ; entry =proc_create_data ("event" ,S_IRUSR , dir, - &salinfo_event_fops, data); + &salinfo_event_proc_ops, data);if (!entry)continue ; *sdir++ = entry; entry =proc_create_data ("data" ,S_IRUSR |S_IWUSR , dir, - &salinfo_data_fops, data); + &salinfo_data_proc_ops, data);if (!entry)continue ; *sdir++ = entry;
arch/m68k/kernel/bootinfo_proc.c +4 -4
@@ -26,9 +26,9 @@ static ssize_t bootinfo_read(struct file *file, char __user *buf, bootinfo_size); } -static const struct file_operations bootinfo_fops = { - .read = bootinfo_read, - .llseek = default_llseek, +static const struct proc_ops bootinfo_proc_ops = { + .proc_read = bootinfo_read, + .proc_lseek = default_llseek, };void __init save_bootinfo (const struct bi_record *bi)
@@ -67,7 +67,7 @@ static int __init init_bootinfo_procfs(void)if (!bootinfo_copy)return -ENOMEM ; - pde =proc_create_data ("bootinfo" ,0400 ,NULL , &bootinfo_fops,NULL ); + pde =proc_create_data ("bootinfo" ,0400 ,NULL , &bootinfo_proc_ops,NULL );if (!pde) {kfree (bootinfo_copy);return -ENOMEM ;
arch/mips/lasat/picvue_proc.c +14 -17
@@ -89,13 +89,12 @@ static ssize_t pvc_line_proc_write(struct file *file, const char __user *buf,return count; } -static const struct file_operations pvc_line_proc_fops = { - .owner =THIS_MODULE , - .open = pvc_line_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = pvc_line_proc_write, +static const struct proc_ops pvc_line_proc_ops = { + .proc_open = pvc_line_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = pvc_line_proc_write, }; static ssize_t pvc_scroll_proc_write(struct file *file, const char __user *buf,
@@ -148,13 +147,12 @@ static int pvc_scroll_proc_open(struct inode *inode, struct file *file)return single_open (file, pvc_scroll_proc_show,NULL ); } -static const struct file_operations pvc_scroll_proc_fops = { - .owner =THIS_MODULE , - .open = pvc_scroll_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = pvc_scroll_proc_write, +static const struct proc_ops pvc_scroll_proc_ops = { + .proc_open = pvc_scroll_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = pvc_scroll_proc_write, };void pvc_proc_timerfunc (struct timer_list *unused)
@@ -189,12 +187,11 @@ static int __init pvc_proc_init(void) }for (i =0 ; i <PVC_NLINES ; i++) { proc_entry =proc_create_data (pvc_linename[i],0644 , dir, - &pvc_line_proc_fops, &pvc_linedata[i]); + &pvc_line_proc_ops, &pvc_linedata[i]);if (proc_entry ==NULL ) goto error; } - proc_entry =proc_create ("scroll" ,0644 , dir, - &pvc_scroll_proc_fops); + proc_entry =proc_create ("scroll" ,0644 , dir, &pvc_scroll_proc_ops);if (proc_entry ==NULL ) goto error;
arch/powerpc/kernel/proc_powerpc.c +5 -5
@@ -39,10 +39,10 @@ static int page_map_mmap( struct file *file, struct vm_area_struct *vma )return 0 ; } -static const struct file_operations page_map_fops = { - .llseek = page_map_seek, - .read = page_map_read, - .mmap = page_map_mmap +static const struct proc_ops page_map_proc_ops = { + .proc_lseek = page_map_seek, + .proc_read = page_map_read, + .proc_mmap = page_map_mmap, };
@@ -51,7 +51,7 @@ static int __init proc_ppc64_init(void)struct proc_dir_entry *pde; pde =proc_create_data ("powerpc/systemcfg" ,S_IFREG |0444 ,NULL , - &page_map_fops, vdso_data); + &page_map_proc_ops, vdso_data);if (!pde)return 1 ;proc_set_size (pde,PAGE_SIZE );
arch/powerpc/kernel/rtas-proc.c +35 -35
112 lines not on this page · raw message
arch/powerpc/kernel/rtas_flash.c +17 -17
@@ -655,7 +655,7 @@ struct rtas_flash_file {const char *filename;const char *rtas_call_name;int *status; -const struct file_operations fops; +const struct proc_ops ops; };static const struct rtas_flash_file rtas_flash_files[] = {
@@ -663,36 +663,36 @@ static const struct rtas_flash_file rtas_flash_files[] = { .filename = "powerpc/rtas/" FIRMWARE_FLASH_NAME, .rtas_call_name = "ibm,update-flash-64-and-reboot", .status = &rtas_update_flash_data.status, - .fops.read = rtas_flash_read_msg, - .fops.write = rtas_flash_write, - .fops.release = rtas_flash_release, - .fops.llseek = default_llseek, + .ops.proc_read = rtas_flash_read_msg, + .ops.proc_write = rtas_flash_write, + .ops.proc_release = rtas_flash_release, + .ops.proc_lseek = default_llseek, }, { .filename = "powerpc/rtas/" FIRMWARE_UPDATE_NAME, .rtas_call_name = "ibm,update-flash-64-and-reboot", .status = &rtas_update_flash_data.status, - .fops.read = rtas_flash_read_num, - .fops.write = rtas_flash_write, - .fops.release = rtas_flash_release, - .fops.llseek = default_llseek, + .ops.proc_read = rtas_flash_read_num, + .ops.proc_write = rtas_flash_write, + .ops.proc_release = rtas_flash_release, + .ops.proc_lseek = default_llseek, }, { .filename = "powerpc/rtas/" VALIDATE_FLASH_NAME, .rtas_call_name = "ibm,validate-flash-image", .status = &rtas_validate_flash_data.status, - .fops.read = validate_flash_read, - .fops.write = validate_flash_write, - .fops.release = validate_flash_release, - .fops.llseek = default_llseek, + .ops.proc_read = validate_flash_read, + .ops.proc_write = validate_flash_write, + .ops.proc_release = validate_flash_release, + .ops.proc_lseek = default_llseek, }, { .filename = "powerpc/rtas/" MANAGE_FLASH_NAME, .rtas_call_name = "ibm,manage-flash-image", .status = &rtas_manage_flash_data.status, - .fops.read = manage_flash_read, - .fops.write = manage_flash_write, - .fops.llseek = default_llseek, + .ops.proc_read = manage_flash_read, + .ops.proc_write = manage_flash_write, + .ops.proc_lseek = default_llseek, } };
@@ -723,7 +723,7 @@ static int __init rtas_flash_init(void)const struct rtas_flash_file *f = &rtas_flash_files[i];int token; -if (!proc_create (f->filename,0600 ,NULL , &f->fops)) +if (!proc_create (f->filename,0600 ,NULL , &f->ops)) goto enomem;/*
arch/powerpc/kernel/rtasd.c +7 -7
@@ -385,12 +385,12 @@ static __poll_t rtas_log_poll(struct file *file, poll_table * wait)return 0 ; } -static const struct file_operations proc_rtas_log_operations = { - .read = rtas_log_read, - .poll = rtas_log_poll, - .open = rtas_log_open, - .release = rtas_log_release, - .llseek = noop_llseek, +static const struct proc_ops rtas_log_proc_ops = { + .proc_read = rtas_log_read, + .proc_poll = rtas_log_poll, + .proc_open = rtas_log_open, + .proc_release = rtas_log_release, + .proc_lseek = noop_llseek, };static int enable_surveillance (int timeout)
@@ -572,7 +572,7 @@ static int __init rtas_init(void)return -ENODEV ; entry =proc_create ("powerpc/rtas/error_log" ,0400 ,NULL , - &proc_rtas_log_operations); + &rtas_log_proc_ops);if (!entry)printk (KERN_ERR "Failed to create error_log proc entry\n" );
arch/powerpc/mm/numa.c +6 -6
@@ -1616,11 +1616,11 @@ static ssize_t topology_write(struct file *file, const char __user *buf,return count; } -static const struct file_operations topology_ops = { - .read = seq_read, - .write = topology_write, - .open = topology_open, - .release = single_release +static const struct proc_ops topology_proc_ops = { + .proc_read = seq_read, + .proc_write = topology_write, + .proc_open = topology_open, + .proc_release = single_release, };static int topology_update_init (void )
@@ -1630,7 +1630,7 @@ static int topology_update_init(void)if (vphn_enabled)topology_schedule_update (); -if (!proc_create ("powerpc/topology_updates" ,0644 ,NULL , &topology_ops)) +if (!proc_create ("powerpc/topology_updates" ,0644 ,NULL , &topology_proc_ops))return -ENOMEM ; topology_inited =1 ;
arch/powerpc/platforms/pseries/lpar.c +12 -12
@@ -582,12 +582,12 @@ static int vcpudispatch_stats_open(struct inode *inode, struct file *file)return single_open (file, vcpudispatch_stats_display,NULL ); } -static const struct file_operations vcpudispatch_stats_proc_ops = { - .open = vcpudispatch_stats_open, - .read = seq_read, - .write = vcpudispatch_stats_write, - .llseek = seq_lseek, - .release = single_release, +static const struct proc_ops vcpudispatch_stats_proc_ops = { + .proc_open = vcpudispatch_stats_open, + .proc_read = seq_read, + .proc_write = vcpudispatch_stats_write, + .proc_lseek = seq_lseek, + .proc_release = single_release, }; static ssize_t vcpudispatch_stats_freq_write(struct file *file,
@@ -626,12 +626,12 @@ static int vcpudispatch_stats_freq_open(struct inode *inode, struct file *file)return single_open (file, vcpudispatch_stats_freq_display,NULL ); } -static const struct file_operations vcpudispatch_stats_freq_proc_ops = { - .open = vcpudispatch_stats_freq_open, - .read = seq_read, - .write = vcpudispatch_stats_freq_write, - .llseek = seq_lseek, - .release = single_release, +static const struct proc_ops vcpudispatch_stats_freq_proc_ops = { + .proc_open = vcpudispatch_stats_freq_open, + .proc_read = seq_read, + .proc_write = vcpudispatch_stats_freq_write, + .proc_lseek = seq_lseek, + .proc_release = single_release, };static int __init vcpudispatch_stats_procfs_init (void )
arch/powerpc/platforms/pseries/lparcfg.c +7 -7
@@ -698,12 +698,12 @@ static int lparcfg_open(struct inode *inode, struct file *file)return single_open (file, lparcfg_data,NULL ); } -static const struct file_operations lparcfg_fops = { - .read = seq_read, - .write = lparcfg_write, - .open = lparcfg_open, - .release = single_release, - .llseek = seq_lseek, +static const struct proc_ops lparcfg_proc_ops = { + .proc_read = seq_read, + .proc_write = lparcfg_write, + .proc_open = lparcfg_open, + .proc_release = single_release, + .proc_lseek = seq_lseek, };static int __init lparcfg_init (void )
@@ -714,7 +714,7 @@ static int __init lparcfg_init(void)if (firmware_has_feature (FW_FEATURE_SPLPAR )) mode |=0200 ; -if (!proc_create ("powerpc/lparcfg" , mode,NULL , &lparcfg_fops)) { +if (!proc_create ("powerpc/lparcfg" , mode,NULL , &lparcfg_proc_ops)) {printk (KERN_ERR "Failed to create powerpc/lparcfg\n" );return -EIO ; }
arch/powerpc/platforms/pseries/reconfig.c +4 -4
@@ -391,9 +391,9 @@ static ssize_t ofdt_write(struct file *file, const char __user *buf, size_t counreturn rv ? rv : count; } -static const struct file_operations ofdt_fops = { - .write = ofdt_write, - .llseek = noop_llseek, +static const struct proc_ops ofdt_proc_ops = { + .proc_write = ofdt_write, + .proc_lseek = noop_llseek, };/* create /proc/powerpc/ofdt write-only by root */
@@ -401,7 +401,7 @@ static int proc_ppc64_create_ofdt(void) {struct proc_dir_entry *ent; - ent =proc_create ("powerpc/ofdt" ,0200 ,NULL , &ofdt_fops); + ent =proc_create ("powerpc/ofdt" ,0200 ,NULL , &ofdt_proc_ops);if (ent)proc_set_size (ent,0 );
arch/powerpc/platforms/pseries/scanlog.c +7 -8
@@ -152,13 +152,12 @@ static int scanlog_release(struct inode * inode, struct file * file)return 0 ; } -static const struct file_operations scanlog_fops = { - .owner =THIS_MODULE , - .read = scanlog_read, - .write = scanlog_write, - .open = scanlog_open, - .release = scanlog_release, - .llseek = noop_llseek, +static const struct proc_ops scanlog_proc_ops = { + .proc_read = scanlog_read, + .proc_write = scanlog_write, + .proc_open = scanlog_open, + .proc_release = scanlog_release, + .proc_lseek = noop_llseek, };static int __init scanlog_init (void )
@@ -176,7 +175,7 @@ static int __init scanlog_init(void) goto err; ent =proc_create ("powerpc/rtas/scan-log-dump" ,0400 ,NULL , - &scanlog_fops); + &scanlog_proc_ops);if (!ent) goto err;return 0 ;
arch/sh/mm/alignment.c +8 -9
@@ -152,13 +152,12 @@ static ssize_t alignment_proc_write(struct file *file,return count; } -static const struct file_operations alignment_proc_fops = { - .owner =THIS_MODULE , - .open = alignment_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = alignment_proc_write, +static const struct proc_ops alignment_proc_ops = { + .proc_open = alignment_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = alignment_proc_write, };/*
@@ -176,12 +175,12 @@ static int __init alignment_init(void)return -ENOMEM ; res =proc_create_data ("alignment" ,S_IWUSR |S_IRUGO , dir, - &alignment_proc_fops, &se_usermode); + &alignment_proc_ops, &se_usermode);if (!res)return -ENOMEM ; res =proc_create_data ("kernel_alignment" ,S_IWUSR |S_IRUGO , dir, - &alignment_proc_fops, &se_kernmode_warn); + &alignment_proc_ops, &se_kernmode_warn);if (!res)return -ENOMEM ;
arch/sparc/kernel/led.c +7 -8
@@ -104,13 +104,12 @@ static ssize_t led_proc_write(struct file *file, const char __user *buffer,return count; } -static const struct file_operations led_proc_fops = { - .owner =THIS_MODULE , - .open = led_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = led_proc_write, +static const struct proc_ops led_proc_ops = { + .proc_open = led_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = led_proc_write, };static struct proc_dir_entry *led;
@@ -121,7 +120,7 @@ static int __init led_init(void) {timer_setup (&led_blink_timer, led_blink,0 ); - led =proc_create ("led" ,0 ,NULL , &led_proc_fops); + led =proc_create ("led" ,0 ,NULL , &led_proc_ops);if (!led)return -ENOMEM ;
arch/um/drivers/mconsole_kern.c +4 -5
@@ -752,10 +752,9 @@ static ssize_t mconsole_proc_write(struct file *file,return count; } -static const struct file_operations mconsole_proc_fops = { - .owner =THIS_MODULE , - .write = mconsole_proc_write, - .llseek = noop_llseek, +static const struct proc_ops mconsole_proc_ops = { + .proc_write = mconsole_proc_write, + .proc_lseek = noop_llseek, };static int create_proc_mconsole (void )
@@ -765,7 +764,7 @@ static int create_proc_mconsole(void)if (notify_socket ==NULL )return 0 ; - ent =proc_create ("mconsole" ,0200 ,NULL , &mconsole_proc_fops); + ent =proc_create ("mconsole" ,0200 ,NULL , &mconsole_proc_ops);if (ent ==NULL ) {printk (KERN_INFO "create_proc_mconsole : proc_create failed\n" );return 0 ;
arch/um/kernel/exitcode.c +7 -8
@@ -55,20 +55,19 @@ static ssize_t exitcode_proc_write(struct file *file,return count; } -static const struct file_operations exitcode_proc_fops = { - .owner =THIS_MODULE , - .open = exitcode_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = exitcode_proc_write, +static const struct proc_ops exitcode_proc_ops = { + .proc_open = exitcode_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = exitcode_proc_write, };static int make_proc_exitcode (void ) {struct proc_dir_entry *ent; - ent =proc_create ("exitcode" ,0600 ,NULL , &exitcode_proc_fops); + ent =proc_create ("exitcode" ,0600 ,NULL , &exitcode_proc_ops);if (ent ==NULL ) {printk (KERN_WARNING "make_proc_exitcode : Failed to register " "/proc/exitcode\n" );
arch/um/kernel/process.c +7 -8
@@ -348,13 +348,12 @@ static ssize_t sysemu_proc_write(struct file *file, const char __user *buf,return count; } -static const struct file_operations sysemu_proc_fops = { - .owner =THIS_MODULE , - .open = sysemu_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = sysemu_proc_write, +static const struct proc_ops sysemu_proc_ops = { + .proc_open = sysemu_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = sysemu_proc_write, };int __init make_proc_sysemu (void )
@@ -363,7 +362,7 @@ int __init make_proc_sysemu(void)if (!sysemu_supported)return 0 ; - ent =proc_create ("sysemu" ,0600 ,NULL , &sysemu_proc_fops); + ent =proc_create ("sysemu" ,0600 ,NULL , &sysemu_proc_ops);if (ent ==NULL ) {
arch/x86/kernel/apic/x2apic_uv_x.c +13 -13
@@ -1527,17 +1527,17 @@ static int proc_oemid_open(struct inode *inode, struct file *file) }/* (struct is "non-const" as open function is set at runtime) */ -static struct file_operations proc_version_fops = { - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, +static struct proc_ops version_proc_ops = { + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, }; -static const struct file_operations proc_oemid_fops = { - .open = proc_oemid_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, +static const struct proc_ops oemid_proc_ops = { + .proc_open = proc_oemid_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, };static __init void uv_setup_proc_files (int hubless)
@@ -1546,12 +1546,12 @@ static __init void uv_setup_proc_files(int hubless)char *name = hubless ?"hubless" :"hubbed" ; pde =proc_mkdir (UV_PROC_NODE ,NULL ); -proc_create ("oemid" ,0 , pde, &proc_oemid_fops); -proc_create (name,0 , pde, &proc_version_fops); +proc_create ("oemid" ,0 , pde, &oemid_proc_ops); +proc_create (name,0 , pde, &version_proc_ops);if (hubless) - proc_version_fops.open = proc_hubless_open; + version_proc_ops.proc_open = proc_hubless_open;else - proc_version_fops.open = proc_hubbed_open; + version_proc_ops.proc_open = proc_hubbed_open; }/* Initialize UV hubless systems */
arch/x86/kernel/cpu/mtrr/if.c +11 -10
@@ -384,15 +384,16 @@ static int mtrr_open(struct inode *inode, struct file *file)return single_open (file, mtrr_seq_show,NULL ); } -static const struct file_operations mtrr_fops = { - .owner =THIS_MODULE , - .open = mtrr_open, - .read = seq_read, - .llseek = seq_lseek, - .write = mtrr_write, - .unlocked_ioctl = mtrr_ioctl, - .compat_ioctl = mtrr_ioctl, - .release = mtrr_close, +static const struct proc_ops mtrr_proc_ops = { + .proc_open = mtrr_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_write = mtrr_write, + .proc_ioctl = mtrr_ioctl, +#ifdef CONFIG_COMPAT + .proc_compat_ioctl = mtrr_ioctl, +#endif + .proc_release = mtrr_close, };static int mtrr_seq_show (struct seq_file *seq,void *offset)
@@ -436,7 +437,7 @@ static int __init mtrr_if_init(void) (!cpu_has(c, X86_FEATURE_CENTAUR_MCR)))return -ENODEV ; -proc_create ("mtrr" ,S_IWUSR |S_IRUGO ,NULL , &mtrr_fops); +proc_create ("mtrr" ,S_IWUSR |S_IRUGO ,NULL , &mtrr_proc_ops);return 0 ; }arch_initcall (mtrr_if_init);
arch/x86/platform/uv/tlb_uv.c +7 -7
@@ -1668,12 +1668,12 @@ static int tunables_open(struct inode *inode, struct file *file)return 0 ; } -static const struct file_operations proc_uv_ptc_operations = { - .open = ptc_proc_open, - .read = seq_read, - .write = ptc_proc_write, - .llseek = seq_lseek, - .release = seq_release, +static const struct proc_ops uv_ptc_proc_ops = { + .proc_open = ptc_proc_open, + .proc_read = seq_read, + .proc_write = ptc_proc_write, + .proc_lseek = seq_lseek, + .proc_release = seq_release, };static const struct file_operations tunables_fops = {
@@ -1691,7 +1691,7 @@ static int __init uv_ptc_init(void)return 0 ; proc_uv_ptc =proc_create (UV_PTC_BASENAME ,0444 ,NULL , - &proc_uv_ptc_operations); + &uv_ptc_proc_ops);if (!proc_uv_ptc) {pr_err ("unable to create %s proc entry\n" ,UV_PTC_BASENAME );
arch/xtensa/platforms/iss/simdisk.c +5 -5
@@ -251,10 +251,10 @@ static ssize_t proc_write_simdisk(struct file *file, const char __user *buf,return err; } -static const struct file_operations fops = { - .read = proc_read_simdisk, - .write = proc_write_simdisk, - .llseek = default_llseek, +static const struct proc_ops simdisk_proc_ops = { + .proc_read = proc_read_simdisk, + .proc_write = proc_write_simdisk, + .proc_lseek = default_llseek, }; static int __init simdisk_setup(struct simdisk *dev, int which,
@@ -290,7 +290,7 @@ static int __init simdisk_setup(struct simdisk *dev, int which,set_capacity (dev->gd,0 );add_disk (dev->gd); - dev->procfile =proc_create_data (tmp,0644 , procdir, &fops, dev); + dev->procfile =proc_create_data (tmp,0644 , procdir, &simdisk_proc_ops, dev);return 0 ; out_alloc_disk:
drivers/acpi/battery.c +7 -8
@@ -1165,13 +1165,12 @@ static int acpi_battery_alarm_proc_open(struct inode *inode, struct file *file)return single_open (file, acpi_battery_alarm_proc_show,PDE_DATA (inode)); } -static const struct file_operations acpi_battery_alarm_fops = { - .owner =THIS_MODULE , - .open = acpi_battery_alarm_proc_open, - .read = seq_read, - .write = acpi_battery_write_alarm, - .llseek = seq_lseek, - .release = single_release, +static const struct proc_ops acpi_battery_alarm_proc_ops = { + .proc_open = acpi_battery_alarm_proc_open, + .proc_read = seq_read, + .proc_write = acpi_battery_write_alarm, + .proc_lseek = seq_lseek, + .proc_release = single_release, };static int acpi_battery_add_fs (struct acpi_device *device)
@@ -1191,7 +1190,7 @@ static int acpi_battery_add_fs(struct acpi_device *device) acpi_battery_state_proc_show, acpi_driver_data(device)))return -ENODEV ;if (!proc_create_data ("alarm" ,S_IFREG |S_IRUGO |S_IWUSR , -acpi_device_dir (device), &acpi_battery_alarm_fops, +acpi_device_dir (device), &acpi_battery_alarm_proc_ops,acpi_driver_data (device)))return -ENODEV ;return 0 ;
drivers/acpi/proc.c +7 -8
@@ -136,18 +136,17 @@ acpi_system_wakeup_device_open_fs(struct inode *inode, struct file *file) PDE_DATA(inode)); } -static const struct file_operations acpi_system_wakeup_device_fops = { - .owner =THIS_MODULE , - .open = acpi_system_wakeup_device_open_fs, - .read = seq_read, - .write = acpi_system_write_wakeup_device, - .llseek = seq_lseek, - .release = single_release, +static const struct proc_ops acpi_system_wakeup_device_proc_ops = { + .proc_open = acpi_system_wakeup_device_open_fs, + .proc_read = seq_read, + .proc_write = acpi_system_write_wakeup_device, + .proc_lseek = seq_lseek, + .proc_release = single_release, };void __init acpi_sleep_proc_init (void ) {/* 'wakeup device' [R/W] */ proc_create ("wakeup" ,S_IFREG |S_IRUGO |S_IWUSR , - acpi_root_dir, &acpi_system_wakeup_device_fops); + acpi_root_dir, &acpi_system_wakeup_device_proc_ops); }
drivers/hwmon/dell-smm-hwmon.c +7 -8
@@ -595,19 +595,18 @@ static int i8k_open_fs(struct inode *inode, struct file *file)return single_open (file, i8k_proc_show,NULL ); } -static const struct file_operations i8k_fops = { - .owner =THIS_MODULE , - .open = i8k_open_fs, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .unlocked_ioctl = i8k_ioctl, +static const struct proc_ops i8k_proc_ops = { + .proc_open = i8k_open_fs, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_ioctl = i8k_ioctl, };static void __init i8k_init_procfs (void ) {/* Register the proc entry */ -proc_create ("i8k" ,0 ,NULL , &i8k_fops); +proc_create ("i8k" ,0 ,NULL , &i8k_proc_ops); } static void __exit i8k_exit_procfs(void)
drivers/ide/ide-proc.c +9 -10
@@ -381,13 +381,12 @@ static ssize_t ide_settings_proc_write(struct file *file, const char __user *bufreturn -EINVAL ; } -static const struct file_operations ide_settings_proc_fops = { - .owner =THIS_MODULE , - .open = ide_settings_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = ide_settings_proc_write, +static const struct proc_ops ide_settings_proc_ops = { + .proc_open = ide_settings_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = ide_settings_proc_write, };int ide_capacity_proc_show (struct seq_file *m,void *v)
@@ -546,7 +545,7 @@ void ide_proc_port_register_devices(ide_hwif_t *hwif)if (drive->proc) {ide_add_proc_entries (drive->proc, generic_drive_entries, drive);proc_create_data ("settings" ,S_IFREG |S_IRUSR |S_IWUSR , - drive->proc, &ide_settings_proc_fops, + drive->proc, &ide_settings_proc_ops, drive); }sprintf (name,"ide%d/%s" , (drive->name[2 ]-'a' )/2 , drive->name);
@@ -615,7 +614,7 @@ static int ide_drivers_show(struct seq_file *s, void *p)return 0 ; } -DEFINE_SHOW_ATTRIBUTE (ide_drivers); +DEFINE_PROC_SHOW_ATTRIBUTE (ide_drivers);void proc_ide_create (void ) {
@@ -624,7 +623,7 @@ void proc_ide_create(void)if (!proc_ide_root)return ; -proc_create ("drivers" ,0 , proc_ide_root, &ide_drivers_fops); +proc_create ("drivers" ,0 , proc_ide_root, &ide_drivers_proc_ops); }void proc_ide_destroy (void )
drivers/input/input.c +13 -15
@@ -1210,13 +1210,12 @@ static int input_proc_devices_open(struct inode *inode, struct file *file)return seq_open (file, &input_devices_seq_ops); } -static const struct file_operations input_devices_fileops = { - .owner =THIS_MODULE , - .open = input_proc_devices_open, - .poll = input_proc_devices_poll, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, +static const struct proc_ops input_devices_proc_ops = { + .proc_open = input_proc_devices_open, + .proc_poll = input_proc_devices_poll, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = seq_release, };static void *input_handlers_seq_start (struct seq_file *seq,loff_t *pos)
@@ -1274,12 +1273,11 @@ static int input_proc_handlers_open(struct inode *inode, struct file *file)return seq_open (file, &input_handlers_seq_ops); } -static const struct file_operations input_handlers_fileops = { - .owner =THIS_MODULE , - .open = input_proc_handlers_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, +static const struct proc_ops input_handlers_proc_ops = { + .proc_open = input_proc_handlers_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = seq_release, };static int __init input_proc_init (void )
@@ -1291,12 +1289,12 @@ static int __init input_proc_init(void)return -ENOMEM ; entry =proc_create ("devices" ,0 , proc_bus_input_dir, - &input_devices_fileops); + &input_devices_proc_ops);if (!entry) goto fail1; entry =proc_create ("handlers" ,0 , proc_bus_input_dir, - &input_handlers_fileops); + &input_handlers_proc_ops);if (!entry) goto fail2;
drivers/macintosh/via-pmu.c +8 -9
@@ -212,7 +212,7 @@ static int pmu_info_proc_show(struct seq_file *m, void *v);static int pmu_irqstats_proc_show (struct seq_file *m,void *v);static int pmu_battery_proc_show (struct seq_file *m,void *v);static void pmu_pass_intr (unsigned char *data,int len); -static const struct file_operations pmu_options_proc_fops; +static const struct proc_ops pmu_options_proc_ops;#ifdef CONFIG_ADB const struct adb_driver via_pmu_driver = {
@@ -573,7 +573,7 @@ static int __init via_pmu_dev_init(void) proc_pmu_irqstats =proc_create_single ("interrupts" ,0 , proc_pmu_root, pmu_irqstats_proc_show); proc_pmu_options =proc_create ("options" ,0600 , proc_pmu_root, - &pmu_options_proc_fops); + &pmu_options_proc_ops); }return 0 ; }
@@ -974,13 +974,12 @@ static ssize_t pmu_options_proc_write(struct file *file,return fcount; } -static const struct file_operations pmu_options_proc_fops = { - .owner =THIS_MODULE , - .open = pmu_options_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = pmu_options_proc_write, +static const struct proc_ops pmu_options_proc_ops = { + .proc_open = pmu_options_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = pmu_options_proc_write, };#ifdef CONFIG_ADB
drivers/md/md.c +7 -8
@@ -8135,13 +8135,12 @@ static __poll_t mdstat_poll(struct file *filp, poll_table *wait)return mask; } -static const struct file_operations md_seq_fops = { - .owner =THIS_MODULE , - .open = md_seq_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, - .poll = mdstat_poll, +static const struct proc_ops mdstat_proc_ops = { + .proc_open = md_seq_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = seq_release, + .proc_poll = mdstat_poll, };int register_md_personality (struct md_personality *p)
@@ -9310,7 +9309,7 @@ static void md_geninit(void) {pr_debug ("md: sizeof(mdp_super_t) = %d\n" , (int )sizeof (mdp_super_t)); -proc_create ("mdstat" ,S_IRUGO ,NULL , &md_seq_fops); +proc_create ("mdstat" ,S_IRUGO ,NULL , &mdstat_proc_ops); }static int __init md_init (void )
drivers/misc/sgi-gru/gruprocfs.c +21 -21
60 lines not on this page · raw message
drivers/net/wireless/cisco/airo.c +45 -53
118 lines not on this page · raw message
drivers/net/wireless/intel/ipw2x00/libipw_module.c +7 -8
@@ -240,13 +240,12 @@ static ssize_t debug_level_proc_write(struct file *file, return strnlen(buf, len); } -static const struct file_operations debug_level_proc_fops = { - .owner =THIS_MODULE , - .open = debug_level_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = debug_level_proc_write, +static const struct proc_ops debug_level_proc_ops = { + .proc_open = debug_level_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = debug_level_proc_write, };#endif /* CONFIG_LIBIPW_DEBUG */
@@ -263,7 +262,7 @@ static int __init libipw_init(void)return -EIO ; } e =proc_create ("debug_level" ,0644 , libipw_proc, - &debug_level_proc_fops); + &debug_level_proc_ops);if (!e) {remove_proc_entry (DRV_PROCNAME , init_net.proc_net); libipw_proc =NULL ;
drivers/net/wireless/intersil/hostap/hostap_hw.c +2 -2
@@ -126,7 +126,7 @@ static void prism2_check_sta_fw_version(local_info_t *local);#ifdef PRISM2_DOWNLOAD_SUPPORT /* hostap_download.c */ -static const struct file_operations prism2_download_aux_dump_proc_fops; +static const struct proc_ops prism2_download_aux_dump_proc_ops;static u8 *prism2_read_pda (struct net_device *dev);static int prism2_download (local_info_t *local,struct prism2_download_param *param);
@@ -3094,7 +3094,7 @@ prism2_init_local_data(struct prism2_helper_functions *funcs, int card_idx, local->func->reset_port = prism2_reset_port; local->func->schedule_reset = prism2_schedule_reset;#ifdef PRISM2_DOWNLOAD_SUPPORT - local->func->read_aux_fops = &prism2_download_aux_dump_proc_fops; + local->func->read_aux_proc_ops = &prism2_download_aux_dump_proc_ops; local->func->download = prism2_download;#endif /* PRISM2_DOWNLOAD_SUPPORT */ local->func->tx = prism2_tx_80211;
drivers/net/wireless/intersil/hostap/hostap_proc.c +7 -7
@@ -211,9 +211,9 @@ static ssize_t prism2_pda_proc_read(struct file *file, char __user *buf,return count; } -static const struct file_operations prism2_pda_proc_fops = { - .read = prism2_pda_proc_read, - .llseek = generic_file_llseek, +static const struct proc_ops prism2_pda_proc_ops = { + .proc_read = prism2_pda_proc_read, + .proc_lseek = generic_file_llseek, };
@@ -223,8 +223,8 @@ static ssize_t prism2_aux_dump_proc_no_read(struct file *file, char __user *buf,return 0 ; } -static const struct file_operations prism2_aux_dump_proc_fops = { - .read = prism2_aux_dump_proc_no_read, +static const struct proc_ops prism2_aux_dump_proc_ops = { + .proc_read = prism2_aux_dump_proc_no_read, };
@@ -379,9 +379,9 @@ void hostap_init_proc(local_info_t *local)proc_create_seq_data ("wds" ,0 , local->proc, &prism2_wds_proc_seqops, local);proc_create_data ("pda" ,0 , local->proc, - &prism2_pda_proc_fops, local); + &prism2_pda_proc_ops, local);proc_create_data ("aux_dump" ,0 , local->proc, - local->func->read_aux_fops ?: &prism2_aux_dump_proc_fops, + local->func->read_aux_proc_ops ?: &prism2_aux_dump_proc_ops, local);proc_create_seq_data ("bss_list" ,0 , local->proc, &prism2_bss_list_proc_seqops, local);
drivers/net/wireless/intersil/hostap/hostap_wlan.h +1 -1
@@ -599,7 +599,7 @@ struct prism2_helper_functions { struct prism2_download_param *param);int (*tx)(struct sk_buff *skb,struct net_device *dev);int (*set_tim)(struct net_device *dev,int aid,int set); -const struct file_operations *read_aux_fops; +const struct proc_ops *read_aux_proc_ops;int need_tx_headroom;/* number of bytes of headroom needed before * IEEE 802.11 header */
drivers/net/wireless/ray_cs.c +9 -11
@@ -2717,10 +2717,9 @@ static ssize_t ray_cs_essid_proc_write(struct file *file,return count; } -static const struct file_operations ray_cs_essid_proc_fops = { - .owner =THIS_MODULE , - .write = ray_cs_essid_proc_write, - .llseek = noop_llseek, +static const struct proc_ops ray_cs_essid_proc_ops = { + .proc_write = ray_cs_essid_proc_write, + .proc_lseek = noop_llseek, }; static ssize_t int_proc_write(struct file *file, const char __user *buffer,
@@ -2751,10 +2750,9 @@ static ssize_t int_proc_write(struct file *file, const char __user *buffer, return count; } -static const struct file_operations int_proc_fops = { - .owner =THIS_MODULE , - .write = int_proc_write, - .llseek = noop_llseek, +static const struct proc_ops int_proc_ops = { + .proc_write = int_proc_write, + .proc_lseek = noop_llseek, };#endif
@@ -2790,10 +2788,10 @@ static int __init init_ray_cs(void)proc_mkdir ("driver/ray_cs" ,NULL );proc_create_single ("driver/ray_cs/ray_cs" ,0 ,NULL , ray_cs_proc_show); -proc_create ("driver/ray_cs/essid" ,0200 ,NULL , &ray_cs_essid_proc_fops); -proc_create_data ("driver/ray_cs/net_type" ,0200 ,NULL , &int_proc_fops, +proc_create ("driver/ray_cs/essid" ,0200 ,NULL , &ray_cs_essid_proc_ops); +proc_create_data ("driver/ray_cs/net_type" ,0200 ,NULL , &int_proc_ops, &net_type); -proc_create_data ("driver/ray_cs/translate" ,0200 ,NULL , &int_proc_fops, +proc_create_data ("driver/ray_cs/translate" ,0200 ,NULL , &int_proc_ops, &translate);#endif if (translate !=0 )
drivers/parisc/led.c +8 -9
@@ -230,13 +230,12 @@ static ssize_t led_proc_write(struct file *file, const char __user *buf,return -EINVAL ; } -static const struct file_operations led_proc_fops = { - .owner =THIS_MODULE , - .open = led_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = led_proc_write, +static const struct proc_ops led_proc_ops = { + .proc_open = led_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = led_proc_write, };static int __init led_create_procfs (void )
@@ -252,14 +251,14 @@ static int __init led_create_procfs(void)if (!lcd_no_led_support) { ent =proc_create_data ("led" ,S_IRUGO |S_IWUSR , proc_pdc_root, - &led_proc_fops, (void *)LED_NOLCD );/* LED */ + &led_proc_ops, (void *)LED_NOLCD );/* LED */ if (!ent)return -1 ; }if (led_type ==LED_HASLCD ) { ent =proc_create_data ("lcd" ,S_IRUGO |S_IWUSR , proc_pdc_root, - &led_proc_fops, (void *)LED_HASLCD );/* LCD */ + &led_proc_ops, (void *)LED_HASLCD );/* LCD */ if (!ent)return -1 ; }
drivers/pci/proc.c +13 -12
@@ -306,19 +306,20 @@ static int proc_bus_pci_release(struct inode *inode, struct file *file) }#endif /* HAVE_PCI_MMAP */ -static const struct file_operations proc_bus_pci_operations = { - .owner =THIS_MODULE , - .llseek = proc_bus_pci_lseek, - .read = proc_bus_pci_read, - .write = proc_bus_pci_write, - .unlocked_ioctl = proc_bus_pci_ioctl, - .compat_ioctl = proc_bus_pci_ioctl, +static const struct proc_ops proc_bus_pci_ops = { + .proc_lseek = proc_bus_pci_lseek, + .proc_read = proc_bus_pci_read, + .proc_write = proc_bus_pci_write, + .proc_ioctl = proc_bus_pci_ioctl, +#ifdef CONFIG_COMPAT + .proc_compat_ioctl = proc_bus_pci_ioctl, +#endif #ifdef HAVE_PCI_MMAP - .open = proc_bus_pci_open, - .release = proc_bus_pci_release, - .mmap = proc_bus_pci_mmap, + .proc_open = proc_bus_pci_open, + .proc_release = proc_bus_pci_release, + .proc_mmap = proc_bus_pci_mmap, #ifdef HAVE_ARCH_PCI_GET_UNMAPPED_AREA - .get_unmapped_area = get_pci_unmapped_area, + .proc_get_unmapped_area = get_pci_unmapped_area, #endif /* HAVE_ARCH_PCI_GET_UNMAPPED_AREA */ #endif /* HAVE_PCI_MMAP */ };
@@ -424,7 +425,7 @@ int pci_proc_attach_device(struct pci_dev *dev)sprintf (name,"%02x.%x" ,PCI_SLOT (dev->devfn),PCI_FUNC (dev->devfn)); e =proc_create_data (name,S_IFREG |S_IRUGO |S_IWUSR , bus->procdir, - &proc_bus_pci_operations, dev); + &proc_bus_pci_ops, dev);if (!e)return -ENOMEM ;proc_set_size (e, dev->cfg_size);
drivers/platform/x86/thinkpad_acpi.c +7 -8
@@ -907,13 +907,12 @@ static ssize_t dispatch_proc_write(struct file *file,return ret; } -static const struct file_operations dispatch_proc_fops = { - .owner =THIS_MODULE , - .open = dispatch_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = dispatch_proc_write, +static const struct proc_ops dispatch_proc_ops = { + .proc_open = dispatch_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = dispatch_proc_write, };static char *next_cmd (char **cmds)
@@ -9984,7 +9983,7 @@ static int __init ibm_init(struct ibm_init_struct *iibm)if (ibm->write) mode |=S_IWUSR ; entry =proc_create_data (ibm->name, mode, proc_dir, - &dispatch_proc_fops, ibm); + &dispatch_proc_ops, ibm);if (!entry) {pr_err ("unable to create proc entry %s\n" , ibm->name); ret = -ENODEV ;
drivers/platform/x86/toshiba_acpi.c +28 -32
96 lines not on this page · raw message
drivers/pnp/isapnp/proc.c +4 -5
@@ -49,10 +49,9 @@ static ssize_t isapnp_proc_bus_read(struct file *file, char __user * buf,return nbytes; } -static const struct file_operations isapnp_proc_bus_file_operations = { - .owner =THIS_MODULE , - .llseek = isapnp_proc_bus_lseek, - .read = isapnp_proc_bus_read, +static const struct proc_ops isapnp_proc_bus_proc_ops = { + .proc_lseek = isapnp_proc_bus_lseek, + .proc_read = isapnp_proc_bus_read, };static int isapnp_proc_attach_device (struct pnp_dev *dev)
@@ -69,7 +68,7 @@ static int isapnp_proc_attach_device(struct pnp_dev *dev) }sprintf (name,"%02x" , dev->number); e = dev->procent =proc_create_data (name,S_IFREG |S_IRUGO , de, - &isapnp_proc_bus_file_operations, dev); + &isapnp_proc_bus_proc_ops, dev);if (!e)return -ENOMEM ;proc_set_size (e,256 );
drivers/pnp/pnpbios/proc.c +8 -9
@@ -210,13 +210,12 @@ static ssize_t pnpbios_proc_write(struct file *file, const char __user *buf,return ret; } -static const struct file_operations pnpbios_proc_fops = { - .owner =THIS_MODULE , - .open = pnpbios_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = pnpbios_proc_write, +static const struct proc_ops pnpbios_proc_ops = { + .proc_open = pnpbios_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = pnpbios_proc_write, };int pnpbios_interface_attach_device (struct pnp_bios_node *node)
@@ -228,13 +227,13 @@ int pnpbios_interface_attach_device(struct pnp_bios_node *node)if (!proc_pnp)return -EIO ;if (!pnpbios_dont_use_current_config) { -proc_create_data (name,0644 , proc_pnp, &pnpbios_proc_fops, +proc_create_data (name,0644 , proc_pnp, &pnpbios_proc_ops, (void *)(long )(node->handle)); }if (!proc_pnp_boot)return -EIO ; -if (proc_create_data (name,0644 , proc_pnp_boot, &pnpbios_proc_fops, +if (proc_create_data (name,0644 , proc_pnp_boot, &pnpbios_proc_ops, (void *)(long )(node->handle +0x100 )))return 0 ;return -EIO ;
drivers/s390/block/dasd_proc.c +7 -8
@@ -320,13 +320,12 @@ static ssize_t dasd_stats_proc_write(struct file *file,#endif /* CONFIG_DASD_PROFILE */ } -static const struct file_operations dasd_stats_proc_fops = { - .owner =THIS_MODULE , - .open = dasd_stats_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = dasd_stats_proc_write, +static const struct proc_ops dasd_stats_proc_ops = { + .proc_open = dasd_stats_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = dasd_stats_proc_write, };/*
@@ -347,7 +346,7 @@ dasd_proc_init(void) dasd_statistics_entry =proc_create ("statistics" ,S_IFREG |S_IRUGO |S_IWUSR , dasd_proc_root_entry, - &dasd_stats_proc_fops); + &dasd_stats_proc_ops);if (!dasd_statistics_entry) goto out_nostatistics;return 0 ;
drivers/s390/cio/blacklist.c +7 -7
@@ -398,12 +398,12 @@ cio_ignore_proc_open(struct inode *inode, struct file *file) sizeof(struct ccwdev_iter)); } -static const struct file_operations cio_ignore_proc_fops = { - .open = cio_ignore_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release_private, - .write = cio_ignore_write, +static const struct proc_ops cio_ignore_proc_ops = { + .proc_open = cio_ignore_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = seq_release_private, + .proc_write = cio_ignore_write, }; static int
@@ -412,7 +412,7 @@ cio_ignore_proc_init (void)struct proc_dir_entry *entry; entry =proc_create ("cio_ignore" ,S_IFREG |S_IRUGO |S_IWUSR ,NULL , - &cio_ignore_proc_fops); + &cio_ignore_proc_ops);if (!entry)return -ENOENT ;return 0 ;
drivers/s390/cio/css.c +5 -6
@@ -1372,18 +1372,17 @@ static ssize_t cio_settle_write(struct file *file, const char __user *buf,return ret ? ret : count; } -static const struct file_operations cio_settle_proc_fops = { - .open = nonseekable_open, - .write = cio_settle_write, - .llseek = no_llseek, +static const struct proc_ops cio_settle_proc_ops = { + .proc_open = nonseekable_open, + .proc_write = cio_settle_write, + .proc_lseek = no_llseek, };static int __init cio_settle_init (void ) {struct proc_dir_entry *entry; - entry =proc_create ("cio_settle" ,S_IWUSR ,NULL , - &cio_settle_proc_fops); + entry =proc_create ("cio_settle" ,S_IWUSR ,NULL , &cio_settle_proc_ops);if (!entry)return -ENOMEM ;return 0 ;
drivers/scsi/esas2r/esas2r_main.c +8 -1
@@ -617,6 +617,13 @@ static const struct file_operations esas2r_proc_fops = { .unlocked_ioctl = esas2r_proc_ioctl, }; +static const struct proc_ops esas2r_proc_ops = { + .proc_ioctl = esas2r_proc_ioctl, +#ifdef CONFIG_COMPAT + .proc_compat_ioctl = compat_ptr_ioctl, +#endif +}; +static struct Scsi_Host *esas2r_proc_host;static int esas2r_proc_major;
@@ -728,7 +735,7 @@ const char *esas2r_info(struct Scsi_Host *sh) pde =proc_create (ATTONODE_NAME ,0 , sh->hostt->proc_dir, - &esas2r_proc_fops); + &esas2r_proc_ops);if (!pde) { esas2r_log_dev(ESAS2R_LOG_WARN,
drivers/scsi/scsi_devinfo.c +7 -8
@@ -736,13 +736,12 @@ static ssize_t proc_scsi_devinfo_write(struct file *file, return err; } -static const struct file_operations scsi_devinfo_proc_fops = { - .owner =THIS_MODULE , - .open = proc_scsi_devinfo_open, - .read = seq_read, - .write = proc_scsi_devinfo_write, - .llseek = seq_lseek, - .release = seq_release, +static const struct proc_ops scsi_devinfo_proc_ops = { + .proc_open = proc_scsi_devinfo_open, + .proc_read = seq_read, + .proc_write = proc_scsi_devinfo_write, + .proc_lseek = seq_lseek, + .proc_release = seq_release, };#endif /* CONFIG_SCSI_PROC_FS */
@@ -867,7 +866,7 @@ int __init scsi_init_devinfo(void) }#ifdef CONFIG_SCSI_PROC_FS - p =proc_create ("scsi/device_info" ,0 ,NULL , &scsi_devinfo_proc_fops); + p =proc_create ("scsi/device_info" ,0 ,NULL , &scsi_devinfo_proc_ops);if (!p) { error = -ENOMEM ; goto out;
drivers/scsi/scsi_proc.c +14 -15
@@ -83,12 +83,12 @@ static int proc_scsi_host_open(struct inode *inode, struct file *file) 4 * PAGE_SIZE); } -static const struct file_operations proc_scsi_fops = { - .open = proc_scsi_host_open, - .release = single_release, - .read = seq_read, - .llseek = seq_lseek, - .write = proc_scsi_host_write +static const struct proc_ops proc_scsi_ops = { + .proc_open = proc_scsi_host_open, + .proc_release = single_release, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_write = proc_scsi_host_write };/**
@@ -146,7 +146,7 @@ void scsi_proc_host_add(struct Scsi_Host *shost)sprintf (name,"%d" , shost->host_no); p =proc_create_data (name,S_IRUGO |S_IWUSR , - sht->proc_dir, &proc_scsi_fops, shost); + sht->proc_dir, &proc_scsi_ops, shost);if (!p) printk(KERN_ERR "%s: Failed to register host %d in" "%s\n", __func__, shost->host_no,
@@ -436,13 +436,12 @@ static int proc_scsi_open(struct inode *inode, struct file *file)return seq_open (file, &scsi_seq_ops); } -static const struct file_operations proc_scsi_operations = { - .owner =THIS_MODULE , - .open = proc_scsi_open, - .read = seq_read, - .write = proc_scsi_write, - .llseek = seq_lseek, - .release = seq_release, +static const struct proc_ops scsi_scsi_proc_ops = { + .proc_open = proc_scsi_open, + .proc_read = seq_read, + .proc_write = proc_scsi_write, + .proc_lseek = seq_lseek, + .proc_release = seq_release, };/**
@@ -456,7 +455,7 @@ int __init scsi_init_procfs(void)if (!proc_scsi) goto err1; - pde =proc_create ("scsi/scsi" ,0 ,NULL , &proc_scsi_operations); + pde =proc_create ("scsi/scsi" ,0 ,NULL , &scsi_scsi_proc_ops);if (!pde) goto err2;
drivers/scsi/sg.c +14 -16
@@ -2320,25 +2320,23 @@ static int sg_proc_seq_show_int(struct seq_file *s, void *v);static int sg_proc_single_open_adio (struct inode *inode,struct file *file);static ssize_t sg_proc_write_adio (struct file *filp,const char __user *buffer,size_t count,loff_t *off); -static const struct file_operations adio_fops = { - .owner =THIS_MODULE , - .open = sg_proc_single_open_adio, - .read = seq_read, - .llseek = seq_lseek, - .write = sg_proc_write_adio, - .release = single_release, +static const struct proc_ops adio_proc_ops = { + .proc_open = sg_proc_single_open_adio, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_write = sg_proc_write_adio, + .proc_release = single_release, };static int sg_proc_single_open_dressz (struct inode *inode,struct file *file);static ssize_t sg_proc_write_dressz (struct file *filp,const char __user *buffer,size_t count,loff_t *off); -static const struct file_operations dressz_fops = { - .owner =THIS_MODULE , - .open = sg_proc_single_open_dressz, - .read = seq_read, - .llseek = seq_lseek, - .write = sg_proc_write_dressz, - .release = single_release, +static const struct proc_ops dressz_proc_ops = { + .proc_open = sg_proc_single_open_dressz, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_write = sg_proc_write_dressz, + .proc_release = single_release, };static int sg_proc_seq_show_version (struct seq_file *s,void *v);
@@ -2379,9 +2377,9 @@ sg_proc_init(void)if (!p)return 1 ; -proc_create ("allow_dio" ,S_IRUGO |S_IWUSR , p, &adio_fops); +proc_create ("allow_dio" ,S_IRUGO |S_IWUSR , p, &adio_proc_ops);proc_create_seq ("debug" ,S_IRUGO , p, &debug_seq_ops); -proc_create ("def_reserved_size" ,S_IRUGO |S_IWUSR , p, &dressz_fops); +proc_create ("def_reserved_size" ,S_IRUGO |S_IWUSR , p, &dressz_proc_ops);proc_create_single ("device_hdr" ,S_IRUGO , p, sg_proc_seq_show_devhdr);proc_create_seq ("devices" ,S_IRUGO , p, &dev_seq_ops);proc_create_seq ("device_strs" ,S_IRUGO , p, &devstrs_seq_ops);
drivers/staging/isdn/hysdn/hysdn_procconf.c +7 -8
@@ -336,14 +336,13 @@ hysdn_conf_close(struct inode *ino, struct file *filep)/******************************************************/ /* table for conf filesystem functions defined above. */ /******************************************************/ -static const struct file_operations conf_fops = +static const struct proc_ops conf_proc_ops = { - .owner =THIS_MODULE , - .llseek = no_llseek, - .read = hysdn_conf_read, - .write = hysdn_conf_write, - .open = hysdn_conf_open, - .release = hysdn_conf_close, + .proc_lseek = no_llseek, + .proc_read = hysdn_conf_read, + .proc_write = hysdn_conf_write, + .proc_open = hysdn_conf_open, + .proc_release = hysdn_conf_close, };/*****************************/
@@ -374,7 +373,7 @@ hysdn_procconf_init(void)if ((card->procconf = (void *)proc_create_data (conf_name,S_IFREG |S_IRUGO |S_IWUSR , hysdn_proc_entry, - &conf_fops, + &conf_proc_ops, card)) !=NULL ) {hysdn_proclog_init (card);/* init the log file entry */ }
drivers/staging/isdn/hysdn/hysdn_proclog.c +8 -9
@@ -302,15 +302,14 @@ hysdn_log_poll(struct file *file, poll_table *wait)/**************************************************/ /* table for log filesystem functions defined above. */ /**************************************************/ -static const struct file_operations log_fops = +static const struct proc_ops log_proc_ops = { - .owner =THIS_MODULE , - .llseek = no_llseek, - .read = hysdn_log_read, - .write = hysdn_log_write, - .poll = hysdn_log_poll, - .open = hysdn_log_open, - .release = hysdn_log_close, + .proc_lseek = no_llseek, + .proc_read = hysdn_log_read, + .proc_write = hysdn_log_write, + .proc_poll = hysdn_log_poll, + .proc_open = hysdn_log_open, + .proc_release = hysdn_log_close, };
@@ -329,7 +328,7 @@ hysdn_proclog_init(hysdn_card *card)sprintf (pd->log_name,"%s%d" ,PROC_LOG_BASENAME , card->myid); pd->log =proc_create_data (pd->log_name,S_IFREG |S_IRUGO |S_IWUSR , hysdn_proc_entry, - &log_fops, card); + &log_proc_ops, card);init_waitqueue_head (&(pd->rd_queue));
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +7 -7
@@ -264,12 +264,12 @@ static int open_debug_level(struct inode *inode, struct file *file)return single_open (file, show_debug_level,NULL ); } -static const struct file_operations fops = { - .open = open_debug_level, - .read = seq_read, - .llseek = seq_lseek, - .write = write_debug_level, - .release = single_release, +static const struct proc_ops debug_level_proc_ops = { + .proc_open = open_debug_level, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_write = write_debug_level, + .proc_release = single_release, };int __init ieee80211_debug_init (void )
@@ -284,7 +284,7 @@ int __init ieee80211_debug_init(void) " proc directory\n");return -EIO ; } - e =proc_create ("debug_level" ,0644 , ieee80211_proc, &fops); + e =proc_create ("debug_level" ,0644 , ieee80211_proc, &debug_level_proc_ops);if (!e) {remove_proc_entry (DRV_NAME , init_net.proc_net); ieee80211_proc =NULL ;
drivers/tty/sysrq.c +4 -4
@@ -1108,15 +1108,15 @@ static ssize_t write_sysrq_trigger(struct file *file, const char __user *buf,return count; } -static const struct file_operations proc_sysrq_trigger_operations = { - .write = write_sysrq_trigger, - .llseek = noop_llseek, +static const struct proc_ops sysrq_trigger_proc_ops = { + .proc_write = write_sysrq_trigger, + .proc_lseek = noop_llseek, };static void sysrq_init_procfs (void ) {if (!proc_create ("sysrq-trigger" ,S_IWUSR ,NULL , - &proc_sysrq_trigger_operations)) + &sysrq_trigger_proc_ops))pr_err ("Failed to register proc interface\n" ); }
drivers/usb/gadget/function/rndis.c +8 -9
@@ -72,7 +72,7 @@ static rndis_resp_t *rndis_add_response(struct rndis_params *params,#ifdef CONFIG_USB_GADGET_DEBUG_FILES -static const struct file_operations rndis_proc_fops; +static const struct proc_ops rndis_proc_ops;#endif /* CONFIG_USB_GADGET_DEBUG_FILES */
@@ -902,7 +902,7 @@ struct rndis_params *rndis_register(void (*resp_avail)(void *v), void *v)sprintf (name,NAME_TEMPLATE , i); proc_entry =proc_create_data (name,0660 ,NULL , - &rndis_proc_fops, params); + &rndis_proc_ops, params);if (!proc_entry) {kfree (params);rndis_put_nr (i);
@@ -1164,13 +1164,12 @@ static int rndis_proc_open(struct inode *inode, struct file *file)return single_open (file, rndis_proc_show,PDE_DATA (inode)); } -static const struct file_operations rndis_proc_fops = { - .owner =THIS_MODULE , - .open = rndis_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = rndis_proc_write, +static const struct proc_ops rndis_proc_ops = { + .proc_open = rndis_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = rndis_proc_write, };#define NAME_TEMPLATE "driver/rndis-%03d"
drivers/video/fbdev/via/viafbdev.c +49 -56
165 lines not on this page · raw message
drivers/zorro/proc.c +4 -5
@@ -56,10 +56,9 @@ proc_bus_zorro_read(struct file *file, char __user *buf, size_t nbytes, loff_t *return nbytes; } -static const struct file_operations proc_bus_zorro_operations = { - .owner =THIS_MODULE , - .llseek = proc_bus_zorro_lseek, - .read = proc_bus_zorro_read, +static const struct proc_ops bus_zorro_proc_ops = { + .proc_lseek = proc_bus_zorro_lseek, + .proc_read = proc_bus_zorro_read, };static void *zorro_seq_start (struct seq_file *m,loff_t *pos)
@@ -105,7 +104,7 @@ static int __init zorro_proc_attach_device(unsigned int slot)sprintf (name,"%02x" , slot); entry =proc_create_data (name,0 , proc_bus_zorro_dir, - &proc_bus_zorro_operations, + &bus_zorro_proc_ops, &zorro_autocon[slot]);if (!entry)return -ENOMEM ;
fs/cifs/cifs_debug.c +54 -54
167 lines not on this page · raw message
fs/cifs/dfs_cache.c +7 -6
@@ -5,6 +5,7 @@* Copyright (c) 2018-2019 Paulo Alcantara <[email protected]> */ +#include <linux/proc_fs.h> #include <linux/rcupdate.h> #include <linux/rculist.h> #include <linux/jhash.h>
@@ -217,12 +218,12 @@ static int dfscache_proc_open(struct inode *inode, struct file *file)return single_open (file, dfscache_proc_show,NULL ); } -const struct file_operations dfscache_proc_fops = { - .open = dfscache_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = dfscache_proc_write, +const struct proc_ops dfscache_proc_ops = { + .proc_open = dfscache_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = dfscache_proc_write, };#ifdef CONFIG_CIFS_DEBUG2
fs/cifs/dfs_cache.h +1 -1
@@ -24,7 +24,7 @@ struct dfs_cache_tgt_iterator {extern int dfs_cache_init (void );extern void dfs_cache_destroy (void ); -extern const struct file_operations dfscache_proc_fops; +extern const struct proc_ops dfscache_proc_ops; extern int dfs_cache_find(const unsigned int xid, struct cifs_ses *ses, const struct nls_table *nls_codepage, int remap,
fs/fscache/internal.h +1 -1
@@ -111,7 +111,7 @@ extern void fscache_enqueue_object(struct fscache_object *);* object-list.c */ #ifdef CONFIG_FSCACHE_OBJECT_LIST -extern const struct file_operations fscache_objlist_fops; +extern const struct proc_ops fscache_objlist_proc_ops;extern void fscache_objlist_add (struct fscache_object *);extern void fscache_objlist_remove (struct fscache_object *);
fs/fscache/object-list.c +6 -5
@@ -7,6 +7,7 @@#define FSCACHE_DEBUG_LEVEL COOKIE#include <linux/module.h> +#include <linux/proc_fs.h> #include <linux/seq_file.h> #include <linux/slab.h> #include <linux/key.h>
@@ -405,9 +406,9 @@ static int fscache_objlist_release(struct inode *inode, struct file *file)return seq_release (inode, file); } -const struct file_operations fscache_objlist_fops = { - .open = fscache_objlist_open, - .read = seq_read, - .llseek = seq_lseek, - .release = fscache_objlist_release, +const struct proc_ops fscache_objlist_proc_ops = { + .proc_open = fscache_objlist_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = fscache_objlist_release, };
fs/fscache/proc.c +1 -1
@@ -35,7 +35,7 @@ int __init fscache_proc_init(void)#ifdef CONFIG_FSCACHE_OBJECT_LIST if (!proc_create ("fs/fscache/objects" ,S_IFREG |0444 ,NULL , - &fscache_objlist_fops)) + &fscache_objlist_proc_ops)) goto error_objects;#endif
fs/jbd2/journal.c +6 -7
@@ -1074,12 +1074,11 @@ static int jbd2_seq_info_release(struct inode *inode, struct file *file)return seq_release (inode, file); } -static const struct file_operations jbd2_seq_info_fops = { - .owner =THIS_MODULE , - .open = jbd2_seq_info_open, - .read = seq_read, - .llseek = seq_lseek, - .release = jbd2_seq_info_release, +static const struct proc_ops jbd2_info_proc_ops = { + .proc_open = jbd2_seq_info_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = jbd2_seq_info_release, };static struct proc_dir_entry *proc_jbd2_stats;
@@ -1089,7 +1088,7 @@ static void jbd2_stats_proc_init(journal_t *journal) journal->j_proc_entry =proc_mkdir (journal->j_devname, proc_jbd2_stats);if (journal->j_proc_entry) {proc_create_data ("info" ,S_IRUGO , journal->j_proc_entry, - &jbd2_seq_info_fops, journal); + &jbd2_info_proc_ops, journal); } }
fs/jfs/jfs_debug.c +7 -7
@@ -43,12 +43,12 @@ static ssize_t jfs_loglevel_proc_write(struct file *file, return count; } -static const struct file_operations jfs_loglevel_proc_fops = { - .open = jfs_loglevel_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = jfs_loglevel_proc_write, +static const struct proc_ops jfs_loglevel_proc_ops = { + .proc_open = jfs_loglevel_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = jfs_loglevel_proc_write, };#endif
@@ -68,7 +68,7 @@ void jfs_proc_init(void)#endif #ifdef CONFIG_JFS_DEBUG proc_create_single ("TxAnchor" ,0 , base, jfs_txanchor_proc_show); -proc_create ("loglevel" ,0 , base, &jfs_loglevel_proc_fops); +proc_create ("loglevel" ,0 , base, &jfs_loglevel_proc_ops);#endif }
fs/lockd/procfs.c +6 -6
@@ -60,11 +60,11 @@ nlm_end_grace_read(struct file *file, char __user *buf, size_t size,return simple_read_from_buffer (buf, size, pos, resp,sizeof (resp)); } -static const struct file_operations lockd_end_grace_operations = { - .write = nlm_end_grace_write, - .read = nlm_end_grace_read, - .llseek = default_llseek, - .release = simple_transaction_release, +static const struct proc_ops lockd_end_grace_proc_ops = { + .proc_write = nlm_end_grace_write, + .proc_read = nlm_end_grace_read, + .proc_lseek = default_llseek, + .proc_release = simple_transaction_release, };int __init
@@ -76,7 +76,7 @@ lockd_create_procfs(void)if (!entry)return -ENOMEM ; entry =proc_create ("nlm_end_grace" ,S_IRUGO |S_IWUSR , entry, - &lockd_end_grace_operations); + &lockd_end_grace_proc_ops);if (!entry) {remove_proc_entry ("fs/lockd" ,NULL );return -ENOMEM ;
fs/nfsd/nfsctl.c +6 -7
@@ -157,11 +157,11 @@ static int exports_proc_open(struct inode *inode, struct file *file)return exports_net_open (current->nsproxy->net_ns, file); } -static const struct file_operations exports_proc_operations = { - .open = exports_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, +static const struct proc_ops exports_proc_ops = { + .proc_open = exports_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = seq_release, };static int exports_nfsd_open (struct inode *inode,struct file *file)
@@ -1431,8 +1431,7 @@ static int create_proc_exports_entry(void) entry =proc_mkdir ("fs/nfs" ,NULL );if (!entry)return -ENOMEM ; - entry =proc_create ("exports" ,0 , entry, - &exports_proc_operations); + entry =proc_create ("exports" ,0 , entry, &exports_proc_ops);if (!entry) {remove_proc_entry ("fs/nfs" ,NULL );return -ENOMEM ;
fs/nfsd/stats.c +6 -6
@@ -84,17 +84,17 @@ static int nfsd_proc_open(struct inode *inode, struct file *file)return single_open (file, nfsd_proc_show,NULL ); } -static const struct file_operations nfsd_proc_fops = { - .open = nfsd_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, +static const struct proc_ops nfsd_proc_ops = { + .proc_open = nfsd_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, };void nfsd_stat_init (void ) { -svc_proc_register (&init_net, &nfsd_svcstats, &nfsd_proc_fops); +svc_proc_register (&init_net, &nfsd_svcstats, &nfsd_proc_ops); }void
fs/proc/cpuinfo.c +6 -6
@@ -16,16 +16,16 @@ static int cpuinfo_open(struct inode *inode, struct file *file)return seq_open (file, &cpuinfo_op); } -static const struct file_operations proc_cpuinfo_operations = { - .open = cpuinfo_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, +static const struct proc_ops cpuinfo_proc_ops = { + .proc_open = cpuinfo_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = seq_release, };static int __init proc_cpuinfo_init (void ) { -proc_create ("cpuinfo" ,0 ,NULL , &proc_cpuinfo_operations); +proc_create ("cpuinfo" ,0 ,NULL , &cpuinfo_proc_ops);return 0 ; }fs_initcall (proc_cpuinfo_init);
fs/proc/kcore.c +6 -7
@@ -574,11 +574,11 @@ static int release_kcore(struct inode *inode, struct file *file)return 0 ; } -static const struct file_operations proc_kcore_operations = { - .read = read_kcore, - .open = open_kcore, - .release = release_kcore, - .llseek = default_llseek, +static const struct proc_ops kcore_proc_ops = { + .proc_read = read_kcore, + .proc_open = open_kcore, + .proc_release = release_kcore, + .proc_lseek = default_llseek, };/* just remember that we have to update kcore */
@@ -637,8 +637,7 @@ static void __init add_modules_range(void)static int __init proc_kcore_init (void ) { - proc_root_kcore =proc_create ("kcore" ,S_IRUSR ,NULL , - &proc_kcore_operations); + proc_root_kcore =proc_create ("kcore" ,S_IRUSR ,NULL , &kcore_proc_ops);if (!proc_root_kcore) {pr_err ("couldn't create /proc/kcore\n" );return 0 ;/* Always returns 0. */
fs/proc/kmsg.c +7 -7
@@ -49,17 +49,17 @@ static __poll_t kmsg_poll(struct file *file, poll_table *wait) } -static const struct file_operations proc_kmsg_operations = { - .read = kmsg_read, - .poll = kmsg_poll, - .open = kmsg_open, - .release = kmsg_release, - .llseek = generic_file_llseek, +static const struct proc_ops kmsg_proc_ops = { + .proc_read = kmsg_read, + .proc_poll = kmsg_poll, + .proc_open = kmsg_open, + .proc_release = kmsg_release, + .proc_lseek = generic_file_llseek, };static int __init proc_kmsg_init (void ) { -proc_create ("kmsg" ,S_IRUSR ,NULL , &proc_kmsg_operations); +proc_create ("kmsg" ,S_IRUSR ,NULL , &kmsg_proc_ops);return 0 ; }fs_initcall (proc_kmsg_init);
fs/proc/page.c +12 -12
@@ -71,9 +71,9 @@ static ssize_t kpagecount_read(struct file *file, char __user *buf,return ret; } -static const struct file_operations proc_kpagecount_operations = { - .llseek = mem_lseek, - .read = kpagecount_read, +static const struct proc_ops kpagecount_proc_ops = { + .proc_lseek = mem_lseek, + .proc_read = kpagecount_read, };/* /proc/kpageflags - an array exposing page flags
@@ -242,9 +242,9 @@ static ssize_t kpageflags_read(struct file *file, char __user *buf,return ret; } -static const struct file_operations proc_kpageflags_operations = { - .llseek = mem_lseek, - .read = kpageflags_read, +static const struct proc_ops kpageflags_proc_ops = { + .proc_lseek = mem_lseek, + .proc_read = kpageflags_read, };#ifdef CONFIG_MEMCG
@@ -293,18 +293,18 @@ static ssize_t kpagecgroup_read(struct file *file, char __user *buf, return ret; } -static const struct file_operations proc_kpagecgroup_operations = { - .llseek = mem_lseek, - .read = kpagecgroup_read, +static const struct proc_ops kpagecgroup_proc_ops = { + .proc_lseek = mem_lseek, + .proc_read = kpagecgroup_read, };#endif /* CONFIG_MEMCG */ static int __init proc_page_init (void ) { -proc_create ("kpagecount" ,S_IRUSR ,NULL , &proc_kpagecount_operations); -proc_create ("kpageflags" ,S_IRUSR ,NULL , &proc_kpageflags_operations); +proc_create ("kpagecount" ,S_IRUSR ,NULL , &kpagecount_proc_ops); +proc_create ("kpageflags" ,S_IRUSR ,NULL , &kpageflags_proc_ops);#ifdef CONFIG_MEMCG -proc_create ("kpagecgroup" ,S_IRUSR ,NULL , &proc_kpagecgroup_operations); +proc_create ("kpagecgroup" ,S_IRUSR ,NULL , &kpagecgroup_proc_ops);#endif return 0 ; }
fs/proc/stat.c +6 -6
@@ -223,16 +223,16 @@ static int stat_open(struct inode *inode, struct file *file)return single_open_size (file, show_stat,NULL , size); } -static const struct file_operations proc_stat_operations = { - .open = stat_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, +static const struct proc_ops stat_proc_ops = { + .proc_open = stat_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, };static int __init proc_stat_init (void ) { -proc_create ("stat" ,0 ,NULL , &proc_stat_operations); +proc_create ("stat" ,0 ,NULL , &stat_proc_ops);return 0 ; }fs_initcall (proc_stat_init);
fs/proc/vmcore.c +5 -5
@@ -667,10 +667,10 @@ static int mmap_vmcore(struct file *file, struct vm_area_struct *vma) }#endif -static const struct file_operations proc_vmcore_operations = { - .read = read_vmcore, - .llseek = default_llseek, - .mmap = mmap_vmcore, +static const struct proc_ops vmcore_proc_ops = { + .proc_read = read_vmcore, + .proc_lseek = default_llseek, + .proc_mmap = mmap_vmcore, };static struct vmcore *__init get_new_element (void )
@@ -1555,7 +1555,7 @@ static int __init vmcore_init(void)elfcorehdr_free (elfcorehdr_addr); elfcorehdr_addr =ELFCORE_ADDR_ERR ; - proc_vmcore =proc_create ("vmcore" ,S_IRUSR ,NULL , &proc_vmcore_operations); + proc_vmcore =proc_create ("vmcore" ,S_IRUSR ,NULL , &vmcore_proc_ops);if (proc_vmcore) proc_vmcore->size = vmcore_size;return 0 ;
include/linux/seq_file.h +13 -0
@@ -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
include/linux/sunrpc/stats.h +2 -2
@@ -63,7 +63,7 @@ struct proc_dir_entry * rpc_proc_register(struct net *,struct rpc_stat *);void rpc_proc_unregister (struct net *,const char *);void rpc_proc_zero (const struct rpc_program *);struct proc_dir_entry *svc_proc_register (struct net *,struct svc_stat *, -const struct file_operations *); +const struct proc_ops *);void svc_proc_unregister (struct net *,const char *); void svc_seq_show(struct seq_file *,
@@ -75,7 +75,7 @@ static inline void rpc_proc_unregister(struct net *net, const char *p) {}static inline void rpc_proc_zero (const struct rpc_program *p) {}static inline struct proc_dir_entry *svc_proc_register (struct net *net,struct svc_stat *s, -const struct file_operations *f) {return NULL ; } +const struct proc_ops *proc_ops) {return NULL ; }static inline void svc_proc_unregister (struct net *net,const char *p) {} static inline void svc_seq_show(struct seq_file *seq,
ipc/util.c +7 -7
@@ -126,7 +126,7 @@ void ipc_init_ids(struct ipc_ids *ids) }#ifdef CONFIG_PROC_FS -static const struct file_operations sysvipc_proc_fops; +static const struct proc_ops sysvipc_proc_ops;/** * ipc_init_proc_interface - create a proc interface for sysipc types using a seq_file interface. * @path: Path in procfs
@@ -151,7 +151,7 @@ void __init ipc_init_proc_interface(const char *path, const char *header, pde =proc_create_data (path,S_IRUGO ,/* world readable */ NULL ,/* parent dir */ - &sysvipc_proc_fops, + &sysvipc_proc_ops, iface);if (!pde)kfree (iface);
@@ -884,10 +884,10 @@ static int sysvipc_proc_release(struct inode *inode, struct file *file) return seq_release_private(inode, file); } -static const struct file_operations sysvipc_proc_fops = { - .open = sysvipc_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = sysvipc_proc_release, +static const struct proc_ops sysvipc_proc_ops = { + .proc_open = sysvipc_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = sysvipc_proc_release, };#endif /* CONFIG_PROC_FS */
kernel/configs.c +4 -5
@@ -47,10 +47,9 @@ ikconfig_read_current(struct file *file, char __user *buf, &kernel_config_data); } -static const struct file_operations ikconfig_file_ops = { - .owner =THIS_MODULE , - .read = ikconfig_read_current, - .llseek = default_llseek, +static const struct proc_ops config_gz_proc_ops = { + .proc_read = ikconfig_read_current, + .proc_lseek = default_llseek, };static int __init ikconfig_init (void )
@@ -59,7 +58,7 @@ static int __init ikconfig_init(void)/* create the current config file */ entry =proc_create ("config.gz" ,S_IFREG |S_IRUGO ,NULL , - &ikconfig_file_ops); + &config_gz_proc_ops);if (!entry)return -ENOMEM ;
kernel/irq/proc.c +21 -21
74 lines not on this page · raw message
kernel/kallsyms.c +6 -6
@@ -698,16 +698,16 @@ const char *kdb_walk_kallsyms(loff_t *pos) }#endif /* CONFIG_KGDB_KDB */ -static const struct file_operations kallsyms_operations = { - .open = kallsyms_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release_private, +static const struct proc_ops kallsyms_proc_ops = { + .proc_open = kallsyms_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = seq_release_private, };static int __init kallsyms_init (void ) { -proc_create ("kallsyms" ,0444 ,NULL , &kallsyms_operations); +proc_create ("kallsyms" ,0444 ,NULL , &kallsyms_proc_ops);return 0 ; }device_initcall (kallsyms_init);
kernel/latencytop.c +7 -7
@@ -255,17 +255,17 @@ static int lstats_open(struct inode *inode, struct file *filp)return single_open (filp, lstats_show,NULL ); } -static const struct file_operations lstats_fops = { - .open = lstats_open, - .read = seq_read, - .write = lstats_write, - .llseek = seq_lseek, - .release = single_release, +static const struct proc_ops lstats_proc_ops = { + .proc_open = lstats_open, + .proc_read = seq_read, + .proc_write = lstats_write, + .proc_lseek = seq_lseek, + .proc_release = single_release, };static int __init init_lstats_procfs (void ) { -proc_create ("latency_stats" ,0644 ,NULL , &lstats_fops); +proc_create ("latency_stats" ,0644 ,NULL , &lstats_proc_ops);return 0 ; }
kernel/locking/lockdep_proc.c +7 -8
@@ -643,12 +643,12 @@ static int lock_stat_release(struct inode *inode, struct file *file) return seq_release(inode, file); } -static const struct file_operations proc_lock_stat_operations = { - .open = lock_stat_open, - .write = lock_stat_write, - .read = seq_read, - .llseek = seq_lseek, - .release = lock_stat_release, +static const struct proc_ops lock_stat_proc_ops = { + .proc_open = lock_stat_open, + .proc_write = lock_stat_write, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = lock_stat_release, };#endif /* CONFIG_LOCK_STAT */
@@ -660,8 +660,7 @@ static int __init lockdep_proc_init(void)#endif proc_create_single ("lockdep_stats" ,S_IRUSR ,NULL , lockdep_stats_show);#ifdef CONFIG_LOCK_STAT -proc_create ("lock_stat" ,S_IRUSR |S_IWUSR ,NULL , - &proc_lock_stat_operations); +proc_create ("lock_stat" ,S_IRUSR |S_IWUSR ,NULL , &lock_stat_proc_ops);#endif return 0 ;
kernel/module.c +6 -6
@@ -4393,16 +4393,16 @@ static int modules_open(struct inode *inode, struct file *file)return err; } -static const struct file_operations proc_modules_operations = { - .open = modules_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, +static const struct proc_ops modules_proc_ops = { + .proc_open = modules_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = seq_release, };static int __init proc_modules_init (void ) { -proc_create ("modules" ,0 ,NULL , &proc_modules_operations); +proc_create ("modules" ,0 ,NULL , &modules_proc_ops);return 0 ; }module_init (proc_modules_init);
kernel/profile.c +12 -12
@@ -442,18 +442,18 @@ static ssize_t prof_cpu_mask_proc_write(struct file *file,return err; } -static const struct file_operations prof_cpu_mask_proc_fops = { - .open = prof_cpu_mask_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .write = prof_cpu_mask_proc_write, +static const struct proc_ops prof_cpu_mask_proc_ops = { + .proc_open = prof_cpu_mask_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = single_release, + .proc_write = prof_cpu_mask_proc_write, };void create_prof_cpu_mask (void ) {/* create /proc/irq/prof_cpu_mask */ -proc_create ("irq/prof_cpu_mask" ,0600 ,NULL , &prof_cpu_mask_proc_fops); +proc_create ("irq/prof_cpu_mask" ,0600 ,NULL , &prof_cpu_mask_proc_ops); }/*
@@ -517,10 +517,10 @@ static ssize_t write_profile(struct file *file, const char __user *buf,return count; } -static const struct file_operations proc_profile_operations = { - .read = read_profile, - .write = write_profile, - .llseek = default_llseek, +static const struct proc_ops profile_proc_ops = { + .proc_read = read_profile, + .proc_write = write_profile, + .proc_lseek = default_llseek, };int __ref create_proc_profile (void )
@@ -548,7 +548,7 @@ int __ref create_proc_profile(void) err =0 ;#endif entry =proc_create ("profile" ,S_IWUSR |S_IRUGO , -NULL , &proc_profile_operations); +NULL , &profile_proc_ops);if (!entry) goto err_state_onl;proc_set_size (entry, (1 + prof_len) *sizeof (atomic_t));
kernel/sched/psi.c +24 -24
21 lines not on this page · raw message
mm/slab_common.c +7 -8
Lines of this file are not shown. View the raw message.
mm/swapfile.c +7 -7
Lines of this file are not shown. View the raw message.
net/atm/mpoa_proc.c +7 -10
Lines of this file are not shown. View the raw message.
net/atm/proc.c +4 -4
Lines of this file are not shown. View the raw message.
net/core/pktgen.c +22 -22
44 lines not on this page · raw message
net/ipv4/ipconfig.c +5 -5
Lines of this file are not shown. View the raw message.
net/ipv4/netfilter/ipt_CLUSTERIP.c +8 -8
Lines of this file are not shown. View the raw message.
net/ipv4/route.c +12 -12
Lines of this file are not shown. View the raw message.
net/netfilter/xt_recent.c +8 -9
Lines of this file are not shown. View the raw message.
net/sunrpc/auth_gss/svcauth_gss.c +5 -5
Lines of this file are not shown. View the raw message.
net/sunrpc/cache.c +22 -23
45 lines not on this page · raw message
net/sunrpc/stats.c +10 -11
Lines of this file are not shown. View the raw message.
samples/kfifo/bytestream-example.c +5 -6
Lines of this file are not shown. View the raw message.
samples/kfifo/inttype-example.c +5 -6
Lines of this file are not shown. View the raw message.
samples/kfifo/record-example.c +5 -6
Lines of this file are not shown. View the raw message.
sound/core/info.c +17 -19
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Andrew Morton
maintainerRe: [PATCH 2/2] proc: convert everything to "struct proc_ops"
Quoted 8 lines · On Wed, 25 Dec 2019 20:25:46 +0300 Alexey Dobriyan <[email protected]> wrote:
The most notable change is
DEFINE_SHOW_ATTRIBUTEmacro split inseq_file.h.Conversion rule is:
llseek =>
proc_lseek
unlocked_ioctl=>proc_ioctl
Quoted 8 lines
xxx =>
proc_xxxdelete ".owner =
THIS_MODULE" line...
drivers/staging/isdn/hysdn/hysdn_procconf.c | 15 +- drivers/staging/isdn/hysdn/hysdn_proclog.c | 17 +-
These seem to have disappeared in linux-next.
Re: [PATCH 2/2] proc: convert everything to "struct proc_ops"
Quoted 12 lines · Andrew Morton
Quoted 10 lines · On Wed, 25 Dec 2019 20:25:46 +0300 Alexey Dobriyan <[email protected]> wrote:
The most notable change is
DEFINE_SHOW_ATTRIBUTEmacro split inseq_file.h.Conversion rule is:
llseek =>
proc_lseek
unlocked_ioctl=>proc_ioctlxxx =>
proc_xxx
Quoted 8 lines
Quoted 6 lines
delete ".owner =
THIS_MODULE" line...
drivers/staging/isdn/hysdn/hysdn_procconf.c | 15 +- drivers/staging/isdn/hysdn/hysdn_proclog.c | 17 +-These seem to have disappeared in linux-next.
Excellent, the less chunks the better.
Any actual conversion can be dropped if file was deleted.
Re: [PATCH 2/2] proc: convert everything to "struct proc_ops"
In reply to Alexey DobriyanHi, my xt_qtaguid module need convert to "struct proc_ops",
https://github.com/youling257/android-4.9/commit/a6e3cddcceb96eb3edeb0da0951399b75d4f8731
https://github.com/youling257/android-4.9/commit/9eb92f5bcdcbc5b54d7dfe4b3050c8b9b8a17999
static const struct proc_ops qtudev_proc_ops = {
.proc_open = qtudev_open,
.proc_release = qtudev_release,
};
static struct miscdevice qtu_device = {
.minor = MISC_DYNAMIC_MINOR,
.name = QTU_DEV_NAME,
.fops = &qtudev_proc_ops,
/* How sad it doesn't allow for defaults: .mode = S_IRUGO | S_IWUSR */
};
I have problem about ".fops = &qtudev_fops,", convert to ".fops = &qtudev_proc_ops," is right?
build error, can you help me?
CALL /root/1/scripts/atomic/check-atomics.sh CALL /root/1/scripts/checksyscalls.sh CHK include/generated/compile.h CC net/netfilter/xt_qtaguid.o
/root/1/net/netfilter/xt_qtaguid.c:2895:10: error: initialization of ‘const struct file_operations *’ from incompatible pointer type ‘const struct proc_ops *’ [-Werror=incompatible-pointer-types]
2895 | .fops = &qtudev_proc_ops,
| ^/root/1/net/netfilter/xt_qtaguid.c:2895:10: note: (near initialization for ‘qtu_device.fops’)
cc1: some warnings being treated as errors
Re: [PATCH 2/2] proc: convert everything to "struct proc_ops"
Quoted 9 lines · On Mon, May 10, 2021 at 09:42:38PM +0800, youling257 wrote:
Hi, my
xt_qtaguidmodule need convert to "structproc_ops",
https://github.com/youling257/android-4.9/commit/a6e3cddcceb96eb3edeb0da0951399b75d4f8731
https://github.com/youling257/android-4.9/commit/9eb92f5bcdcbc5b54d7dfe4b3050c8b9b8a17999static const struct
proc_opsqtudev_proc_ops= {
.proc_open =qtudev_open,
.proc_release =qtudev_release,
};
Quoted 8 lines
static struct miscdevice
qtu_device= {
.minor =MISC_DYNAMIC_MINOR,
.name =QTU_DEV_NAME,
.fops =&qtudev_proc_ops,
/* How sad it doesn't allow for defaults: .mode =S_IRUGO|S_IWUSR*/
};I have problem about ".fops =
&qtudev_fops,", convert to ".fops =&qtudev_proc_ops," is right?
No! Those remain file_operations driving your device. How is it supposed to work otherwise?
Re: [PATCH 2/2] proc: convert everything to "struct proc_ops"
I delete " .fops = &qtudev_fops," , xt_qtaguid can work.
but dmesg, qtaguid: qtaguid_untag(): User space forgot to open /dev/xt_qtaguid? pid=3860 tgid=3235 sk_pid=3235, uid=10159 i don't know it can delete or not.
2021-05-11 1:13 GMT+08:00, Alexey Dobriyan <[email protected]>:
Quoted 23 lines · On Mon, May 10, 2021 at 09:42:38PM +0800, youling257 wrote:
Quoted 16 lines
Hi, my
xt_qtaguidmodule need convert to "structproc_ops",
https://github.com/youling257/android-4.9/commit/a6e3cddcceb96eb3edeb0da0951399b75d4f8731
https://github.com/youling257/android-4.9/commit/9eb92f5bcdcbc5b54d7dfe4b3050c8b9b8a17999static const struct
proc_opsqtudev_proc_ops= {
.proc_open =qtudev_open,
.proc_release =qtudev_release,
};static struct miscdevice
qtu_device= {
.minor =MISC_DYNAMIC_MINOR,
.name =QTU_DEV_NAME,
.fops =&qtudev_proc_ops,
/* How sad it doesn't allow for defaults: .mode =S_IRUGO|S_IWUSR*/
};Quoted 2 lines
I have problem about ".fops =
&qtudev_fops,", convert to ".fops =&qtudev_proc_ops," is right?No! Those remain
file_operationsdriving your device. How is it supposed to work otherwise?