提交 1f439647 编写于 作者: J Jonathan Corbet

mem: cdev lock_kernel() pushdown

It's really hard to tell if this is necessary - lots of weird
magic happens by way of map_devmem()
Signed-off-by: NJonathan Corbet <corbet@lwn.net>
上级 ecc38983
无相关合并请求
......@@ -26,6 +26,7 @@
#include <linux/bootmem.h>
#include <linux/splice.h>
#include <linux/pfn.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/io.h>
......@@ -889,6 +890,9 @@ static const struct file_operations kmsg_fops = {
static int memory_open(struct inode * inode, struct file * filp)
{
int ret = 0;
lock_kernel();
switch (iminor(inode)) {
case 1:
filp->f_op = &mem_fops;
......@@ -932,11 +936,13 @@ static int memory_open(struct inode * inode, struct file * filp)
break;
#endif
default:
unlock_kernel();
return -ENXIO;
}
if (filp->f_op && filp->f_op->open)
return filp->f_op->open(inode,filp);
return 0;
ret = filp->f_op->open(inode,filp);
unlock_kernel();
return ret;
}
static const struct file_operations memory_fops = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部