Merge branch 'bkl-removal' of git://git.lwn.net/linux-2.6
* 'bkl-removal' of git://git.lwn.net/linux-2.6: (146 commits) IB/umad: BKL is not needed for ib_umad_open() IB/uverbs: BKL is not needed for ib_uverbs_open() bf561-coreb: BKL unneeded for open() Call fasync() functions without the BKL snd/PCM: fasync BKL pushdown ipmi: fasync BKL pushdown ecryptfs: fasync BKL pushdown Bluetooth VHCI: fasync BKL pushdown tty_io: fasync BKL pushdown tun: fasync BKL pushdown i2o: fasync BKL pushdown mpt: fasync BKL pushdown Remove BKL from remote_llseek v2 Make FAT users happier by not deadlocking x86-mce: BKL pushdown vmwatchdog: BKL pushdown vmcp: BKL pushdown via-pmu: BKL pushdown uml-random: BKL pushdown uml-mmapper: BKL pushdown ...
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
|
||||
#include <linux/pm_qos_params.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/smp_lock.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/time.h>
|
||||
@@ -358,15 +359,19 @@ static int pm_qos_power_open(struct inode *inode, struct file *filp)
|
||||
int ret;
|
||||
long pm_qos_class;
|
||||
|
||||
lock_kernel();
|
||||
pm_qos_class = find_pm_qos_object_by_minor(iminor(inode));
|
||||
if (pm_qos_class >= 0) {
|
||||
filp->private_data = (void *)pm_qos_class;
|
||||
sprintf(name, "process_%d", current->pid);
|
||||
ret = pm_qos_add_requirement(pm_qos_class, name,
|
||||
PM_QOS_DEFAULT_VALUE);
|
||||
if (ret >= 0)
|
||||
if (ret >= 0) {
|
||||
unlock_kernel();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
unlock_kernel();
|
||||
|
||||
return -EPERM;
|
||||
}
|
||||
|
Reference in New Issue
Block a user