@@ -101,32 +101,30 @@ static int bug_write(struct file *file, const char *buffer,
101
101
return count ;
102
102
}
103
103
104
- static const struct file_operations edit_proc_fops = {
105
- .owner = THIS_MODULE ,
106
- .open = hello_proc_open ,
107
- .read = seq_read ,
108
- .write = edit_write ,
109
- .llseek = seq_lseek ,
110
- .release = single_release ,
104
+ static const struct proc_ops edit_proc_ops = {
105
+ .proc_open = hello_proc_open ,
106
+ .proc_read = seq_read ,
107
+ .proc_write = edit_write ,
108
+ .proc_lseek = seq_lseek ,
109
+ .proc_release = single_release ,
111
110
};
112
111
113
- static const struct file_operations bug_proc_fops = {
114
- .owner = THIS_MODULE ,
115
- .open = hello_proc_open ,
116
- .read = seq_read ,
117
- .write = bug_write ,
118
- .llseek = seq_lseek ,
119
- .release = single_release ,
112
+ static const struct proc_ops bug_proc_ops = {
113
+ .proc_open = hello_proc_open ,
114
+ .proc_read = seq_read ,
115
+ .proc_write = bug_write ,
116
+ .proc_lseek = seq_lseek ,
117
+ .proc_release = single_release ,
120
118
};
121
119
122
120
static int __init hello_proc_init (void ) {
123
121
struct proc_dir_entry * file ;
124
- file = proc_create ("hello_kdb_bug" , 0 , NULL , & bug_proc_fops );
122
+ file = proc_create ("hello_kdb_bug" , 0 , NULL , & bug_proc_ops );
125
123
if (file == NULL ) {
126
124
return - ENOMEM ;
127
125
}
128
126
129
- file = proc_create ("hello_kdb_break" , 0 , NULL , & edit_proc_fops );
127
+ file = proc_create ("hello_kdb_break" , 0 , NULL , & edit_proc_ops );
130
128
if (file == NULL ) {
131
129
remove_proc_entry ("hello_kdb_bug" , NULL );
132
130
return - ENOMEM ;
0 commit comments