hc
2024-10-09 05e59e5fb0064c97a1c10921ecd549f2d4a58565
kernel/samples/kfifo/bytestream-example.c
....@@ -1,10 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Sample kfifo byte stream 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>
....@@ -148,11 +146,10 @@
148146 return copied;
149147 }
150148
151
-static const struct file_operations fifo_fops = {
152
- .owner = THIS_MODULE,
153
- .read = fifo_read,
154
- .write = fifo_write,
155
- .llseek = noop_llseek,
149
+static const struct proc_ops fifo_proc_ops = {
150
+ .proc_read = fifo_read,
151
+ .proc_write = fifo_write,
152
+ .proc_lseek = noop_llseek,
156153 };
157154
158155 static int __init example_init(void)
....@@ -175,7 +172,7 @@
175172 return -EIO;
176173 }
177174
178
- if (proc_create(PROC_FIFO, 0, NULL, &fifo_fops) == NULL) {
175
+ if (proc_create(PROC_FIFO, 0, NULL, &fifo_proc_ops) == NULL) {
179176 #ifdef DYNAMIC
180177 kfifo_free(&test);
181178 #endif