1 Star 0 Fork 10

jinlun/dim_9

forked from src-openEuler/dim 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Add-the-owner-of-file-operations.patch 1.58 KB
一键复制 编辑 原始数据 按行查看 历史
From 76d06390a9adf3ae70aaa87e9243c42d848975a4 Mon Sep 17 00:00:00 2001
From: Huaxin Lu <luhuaxin1@huawei.com>
Date: Mon, 18 Sep 2023 20:19:05 +0800
Subject: [PATCH] Add the owner of file operations
Fix the concurrent issues with removing module and
accessing interfaces.
---
src/common/dim_entry.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/common/dim_entry.h b/src/common/dim_entry.h
index 17e6420..acfc3a0 100644
--- a/src/common/dim_entry.h
+++ b/src/common/dim_entry.h
@@ -49,6 +49,7 @@ static ssize_t sname##_trigger(struct file *file, \
} \
\
static const struct file_operations sname##_ops = { \
+ .owner = THIS_MODULE, \
.write = sname##_trigger, \
.llseek = generic_file_llseek, \
}; \
@@ -99,6 +100,7 @@ static int sname##_open(struct inode *inode, struct file *file) \
} \
\
static const struct file_operations sname##_ops = { \
+ .owner = THIS_MODULE, \
.open = sname##_open, \
.read = seq_read, \
.llseek = seq_lseek, \
@@ -129,6 +131,7 @@ static ssize_t sname##_read(struct file *file, \
} \
\
static const struct file_operations sname##_ops = { \
+ .owner = THIS_MODULE, \
.read = sname##_read, \
.llseek = generic_file_llseek, \
}; \
@@ -173,6 +176,7 @@ static ssize_t sname##_write(struct file *file, \
} \
\
static const struct file_operations sname##_ops = { \
+ .owner = THIS_MODULE, \
.read = sname##_read, \
.write = sname##_write, \
.llseek = generic_file_llseek, \
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jinlun123123/dim_9.git
git@gitee.com:jinlun123123/dim_9.git
jinlun123123
dim_9
dim_9
master

搜索帮助