Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 01b284f9 authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

blktrace: remove the big kernel lock



According to Jens, this code does not need the BKL at all,
it is sufficiently serialized by bd_mutex.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Cc: Jens Axboe <jaxboe@fusionio.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
parent 0fc86c7b
Loading
Loading
Loading
Loading
+3 −11
Original line number Original line Diff line number Diff line
@@ -23,7 +23,6 @@
#include <linux/mutex.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/debugfs.h>
#include <linux/debugfs.h>
#include <linux/smp_lock.h>
#include <linux/time.h>
#include <linux/time.h>
#include <linux/uaccess.h>
#include <linux/uaccess.h>


@@ -639,7 +638,6 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg)
	if (!q)
	if (!q)
		return -ENXIO;
		return -ENXIO;


	lock_kernel();
	mutex_lock(&bdev->bd_mutex);
	mutex_lock(&bdev->bd_mutex);


	switch (cmd) {
	switch (cmd) {
@@ -667,7 +665,6 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg)
	}
	}


	mutex_unlock(&bdev->bd_mutex);
	mutex_unlock(&bdev->bd_mutex);
	unlock_kernel();
	return ret;
	return ret;
}
}


@@ -1652,10 +1649,9 @@ static ssize_t sysfs_blk_trace_attr_show(struct device *dev,
	struct block_device *bdev;
	struct block_device *bdev;
	ssize_t ret = -ENXIO;
	ssize_t ret = -ENXIO;


	lock_kernel();
	bdev = bdget(part_devt(p));
	bdev = bdget(part_devt(p));
	if (bdev == NULL)
	if (bdev == NULL)
		goto out_unlock_kernel;
		goto out;


	q = blk_trace_get_queue(bdev);
	q = blk_trace_get_queue(bdev);
	if (q == NULL)
	if (q == NULL)
@@ -1683,8 +1679,7 @@ static ssize_t sysfs_blk_trace_attr_show(struct device *dev,
	mutex_unlock(&bdev->bd_mutex);
	mutex_unlock(&bdev->bd_mutex);
out_bdput:
out_bdput:
	bdput(bdev);
	bdput(bdev);
out_unlock_kernel:
out:
	unlock_kernel();
	return ret;
	return ret;
}
}


@@ -1714,11 +1709,10 @@ static ssize_t sysfs_blk_trace_attr_store(struct device *dev,


	ret = -ENXIO;
	ret = -ENXIO;


	lock_kernel();
	p = dev_to_part(dev);
	p = dev_to_part(dev);
	bdev = bdget(part_devt(p));
	bdev = bdget(part_devt(p));
	if (bdev == NULL)
	if (bdev == NULL)
		goto out_unlock_kernel;
		goto out;


	q = blk_trace_get_queue(bdev);
	q = blk_trace_get_queue(bdev);
	if (q == NULL)
	if (q == NULL)
@@ -1753,8 +1747,6 @@ static ssize_t sysfs_blk_trace_attr_store(struct device *dev,
	mutex_unlock(&bdev->bd_mutex);
	mutex_unlock(&bdev->bd_mutex);
out_bdput:
out_bdput:
	bdput(bdev);
	bdput(bdev);
out_unlock_kernel:
	unlock_kernel();
out:
out:
	return ret ? ret : count;
	return ret ? ret : count;
}
}