[PATCH] sonypi: Use non-BKL version of llseek.

From: John Kacur
Date: Tue Oct 20 2009 - 19:51:41 EST


The default version of llseek uses the BKL.
We have removed the use of the BKL in open and the ioctl.
Now lets remove the last use of the BKL by explictly calling the
generic unlocked llseek, under the sonypi_device.lock mutex

Signed-off-by: John Kacur <jkacur@xxxxxxxxxx>
---
drivers/char/sonypi.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index 593cbb5..55b08cd 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -1061,6 +1061,16 @@ static long sonypi_misc_ioctl(struct file *fp,
return ret;
}

+static loff_t sonypi_misc_llseek(struct file *fp, loff_t offset, int origin)
+{
+ loff_t loff;
+ mutex_lock(&sonypi_device.lock);
+ loff = generic_file_llseek_unlocked(fp, offset, origin);
+ mutex_unlock(&sonypi_device.lock);
+
+ return loff;
+}
+
static const struct file_operations sonypi_misc_fops = {
.owner = THIS_MODULE,
.read = sonypi_misc_read,
@@ -1069,6 +1079,7 @@ static const struct file_operations sonypi_misc_fops = {
.release = sonypi_misc_release,
.fasync = sonypi_misc_fasync,
.unlocked_ioctl = sonypi_misc_ioctl,
+ .llseek = sonypi_misc_llseek,
};

static struct miscdevice sonypi_misc_device = {
--
1.6.0.6


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/