From 05e59e5fb0064c97a1c10921ecd549f2d4a58565 Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Wed, 09 Oct 2024 06:14:40 +0000 Subject: [PATCH] add REDIRECT --- kernel/samples/kfifo/bytestream-example.c | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-) diff --git a/kernel/samples/kfifo/bytestream-example.c b/kernel/samples/kfifo/bytestream-example.c index a7f5ee8..5a90aa5 100644 --- a/kernel/samples/kfifo/bytestream-example.c +++ b/kernel/samples/kfifo/bytestream-example.c @@ -1,10 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Sample kfifo byte stream implementation * * Copyright (C) 2010 Stefani Seibold <stefani@seibold.net> - * - * Released under the GPL version 2 only. - * */ #include <linux/init.h> @@ -148,11 +146,10 @@ return copied; } -static const struct file_operations fifo_fops = { - .owner = THIS_MODULE, - .read = fifo_read, - .write = fifo_write, - .llseek = noop_llseek, +static const struct proc_ops fifo_proc_ops = { + .proc_read = fifo_read, + .proc_write = fifo_write, + .proc_lseek = noop_llseek, }; static int __init example_init(void) @@ -175,7 +172,7 @@ return -EIO; } - if (proc_create(PROC_FIFO, 0, NULL, &fifo_fops) == NULL) { + if (proc_create(PROC_FIFO, 0, NULL, &fifo_proc_ops) == NULL) { #ifdef DYNAMIC kfifo_free(&test); #endif -- Gitblit v1.6.2