浏览代码

agp-frontend: BKL pushdown

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Arnd Bergmann 17 年之前
父节点
当前提交
a076230134
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      drivers/char/agp/frontend.c

+ 4 - 0
drivers/char/agp/frontend.c

@@ -39,6 +39,7 @@
 #include <linux/mm.h>
 #include <linux/mm.h>
 #include <linux/fs.h>
 #include <linux/fs.h>
 #include <linux/sched.h>
 #include <linux/sched.h>
+#include <linux/smp_lock.h>
 #include <asm/uaccess.h>
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 #include <asm/pgtable.h>
 #include "agp.h"
 #include "agp.h"
@@ -677,6 +678,7 @@ static int agp_open(struct inode *inode, struct file *file)
 	struct agp_client *client;
 	struct agp_client *client;
 	int rc = -ENXIO;
 	int rc = -ENXIO;
 
 
+	lock_kernel();
 	mutex_lock(&(agp_fe.agp_mutex));
 	mutex_lock(&(agp_fe.agp_mutex));
 
 
 	if (minor != AGPGART_MINOR)
 	if (minor != AGPGART_MINOR)
@@ -703,12 +705,14 @@ static int agp_open(struct inode *inode, struct file *file)
 	agp_insert_file_private(priv);
 	agp_insert_file_private(priv);
 	DBG("private=%p, client=%p", priv, client);
 	DBG("private=%p, client=%p", priv, client);
 	mutex_unlock(&(agp_fe.agp_mutex));
 	mutex_unlock(&(agp_fe.agp_mutex));
+	unlock_kernel();
 	return 0;
 	return 0;
 
 
 err_out_nomem:
 err_out_nomem:
 	rc = -ENOMEM;
 	rc = -ENOMEM;
 err_out:
 err_out:
 	mutex_unlock(&(agp_fe.agp_mutex));
 	mutex_unlock(&(agp_fe.agp_mutex));
+	unlock_kernel();
 	return rc;
 	return rc;
 }
 }