hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/samples/kfifo/record-example.c
....@@ -1,10 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Sample dynamic sized record fifo implementation
34 *
45 * Copyright (C) 2010 Stefani Seibold <stefani@seibold.net>
5
- *
6
- * Released under the GPL version 2 only.
7
- *
86 */
97
108 #include <linux/init.h>
....@@ -155,11 +153,10 @@
155153 return copied;
156154 }
157155
158
-static const struct file_operations fifo_fops = {
159
- .owner = THIS_MODULE,
160
- .read = fifo_read,
161
- .write = fifo_write,
162
- .llseek = noop_llseek,
156
+static const struct proc_ops fifo_proc_ops = {
157
+ .proc_read = fifo_read,
158
+ .proc_write = fifo_write,
159
+ .proc_lseek = noop_llseek,
163160 };
164161
165162 static int __init example_init(void)
....@@ -182,7 +179,7 @@
182179 return -EIO;
183180 }
184181
185
- if (proc_create(PROC_FIFO, 0, NULL, &fifo_fops) == NULL) {
182
+ if (proc_create(PROC_FIFO, 0, NULL, &fifo_proc_ops) == NULL) {
186183 #ifdef DYNAMIC
187184 kfifo_free(&test);
188185 #endif