aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/blktrace.c
diff options
context:
space:
mode:
authorJens Axboe <jaxboe@fusionio.com>2010-11-16 04:09:42 -0500
committerJens Axboe <jaxboe@fusionio.com>2010-11-16 04:09:42 -0500
commita02056349cdea2252cd2b21643ebf025e83a29f2 (patch)
treeb7c889d6cbe8e7188d07d99a5c9da858c53a5b6c /kernel/trace/blktrace.c
parent34db1d595ef6f183fbc1e42cda45a3dfa0035258 (diff)
parente53beacd23d9cb47590da6a7a7f6d417b941a994 (diff)
Merge branch 'v2.6.37-rc2' into for-2.6.38/core
Diffstat (limited to 'kernel/trace/blktrace.c')
-rw-r--r--kernel/trace/blktrace.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 959f8d6c8cc1..7b8ec0281548 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -23,7 +23,6 @@
23#include <linux/mutex.h> 23#include <linux/mutex.h>
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <linux/debugfs.h> 25#include <linux/debugfs.h>
26#include <linux/smp_lock.h>
27#include <linux/time.h> 26#include <linux/time.h>
28#include <linux/uaccess.h> 27#include <linux/uaccess.h>
29 28
@@ -169,7 +168,6 @@ static int act_log_check(struct blk_trace *bt, u32 what, sector_t sector,
169static const u32 ddir_act[2] = { BLK_TC_ACT(BLK_TC_READ), 168static const u32 ddir_act[2] = { BLK_TC_ACT(BLK_TC_READ),
170 BLK_TC_ACT(BLK_TC_WRITE) }; 169 BLK_TC_ACT(BLK_TC_WRITE) };
171 170
172#define BLK_TC_HARDBARRIER BLK_TC_BARRIER
173#define BLK_TC_RAHEAD BLK_TC_AHEAD 171#define BLK_TC_RAHEAD BLK_TC_AHEAD
174 172
175/* The ilog2() calls fall out because they're constant */ 173/* The ilog2() calls fall out because they're constant */
@@ -197,7 +195,6 @@ static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
197 return; 195 return;
198 196
199 what |= ddir_act[rw & WRITE]; 197 what |= ddir_act[rw & WRITE];
200 what |= MASK_TC_BIT(rw, HARDBARRIER);
201 what |= MASK_TC_BIT(rw, SYNC); 198 what |= MASK_TC_BIT(rw, SYNC);
202 what |= MASK_TC_BIT(rw, RAHEAD); 199 what |= MASK_TC_BIT(rw, RAHEAD);
203 what |= MASK_TC_BIT(rw, META); 200 what |= MASK_TC_BIT(rw, META);
@@ -326,6 +323,7 @@ static const struct file_operations blk_dropped_fops = {
326 .owner = THIS_MODULE, 323 .owner = THIS_MODULE,
327 .open = blk_dropped_open, 324 .open = blk_dropped_open,
328 .read = blk_dropped_read, 325 .read = blk_dropped_read,
326 .llseek = default_llseek,
329}; 327};
330 328
331static int blk_msg_open(struct inode *inode, struct file *filp) 329static int blk_msg_open(struct inode *inode, struct file *filp)
@@ -365,6 +363,7 @@ static const struct file_operations blk_msg_fops = {
365 .owner = THIS_MODULE, 363 .owner = THIS_MODULE,
366 .open = blk_msg_open, 364 .open = blk_msg_open,
367 .write = blk_msg_write, 365 .write = blk_msg_write,
366 .llseek = noop_llseek,
368}; 367};
369 368
370/* 369/*
@@ -639,7 +638,6 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg)
639 if (!q) 638 if (!q)
640 return -ENXIO; 639 return -ENXIO;
641 640
642 lock_kernel();
643 mutex_lock(&bdev->bd_mutex); 641 mutex_lock(&bdev->bd_mutex);
644 642
645 switch (cmd) { 643 switch (cmd) {
@@ -667,7 +665,6 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg)
667 } 665 }
668 666
669 mutex_unlock(&bdev->bd_mutex); 667 mutex_unlock(&bdev->bd_mutex);
670 unlock_kernel();
671 return ret; 668 return ret;
672} 669}
673 670
@@ -1652,10 +1649,9 @@ static ssize_t sysfs_blk_trace_attr_show(struct device *dev,
1652 struct block_device *bdev; 1649 struct block_device *bdev;
1653 ssize_t ret = -ENXIO; 1650 ssize_t ret = -ENXIO;
1654 1651
1655 lock_kernel();
1656 bdev = bdget(part_devt(p)); 1652 bdev = bdget(part_devt(p));
1657 if (bdev == NULL) 1653 if (bdev == NULL)
1658 goto out_unlock_kernel; 1654 goto out;
1659 1655
1660 q = blk_trace_get_queue(bdev); 1656 q = blk_trace_get_queue(bdev);
1661 if (q == NULL) 1657 if (q == NULL)
@@ -1683,8 +1679,7 @@ out_unlock_bdev:
1683 mutex_unlock(&bdev->bd_mutex); 1679 mutex_unlock(&bdev->bd_mutex);
1684out_bdput: 1680out_bdput:
1685 bdput(bdev); 1681 bdput(bdev);
1686out_unlock_kernel: 1682out:
1687 unlock_kernel();
1688 return ret; 1683 return ret;
1689} 1684}
1690 1685
@@ -1714,11 +1709,10 @@ static ssize_t sysfs_blk_trace_attr_store(struct device *dev,
1714 1709
1715 ret = -ENXIO; 1710 ret = -ENXIO;
1716 1711
1717 lock_kernel();
1718 p = dev_to_part(dev); 1712 p = dev_to_part(dev);
1719 bdev = bdget(part_devt(p)); 1713 bdev = bdget(part_devt(p));
1720 if (bdev == NULL) 1714 if (bdev == NULL)
1721 goto out_unlock_kernel; 1715 goto out;
1722 1716
1723 q = blk_trace_get_queue(bdev); 1717 q = blk_trace_get_queue(bdev);
1724 if (q == NULL) 1718 if (q == NULL)
@@ -1753,8 +1747,6 @@ out_unlock_bdev:
1753 mutex_unlock(&bdev->bd_mutex); 1747 mutex_unlock(&bdev->bd_mutex);
1754out_bdput: 1748out_bdput:
1755 bdput(bdev); 1749 bdput(bdev);
1756out_unlock_kernel:
1757 unlock_kernel();
1758out: 1750out:
1759 return ret ? ret : count; 1751 return ret ? ret : count;
1760} 1752}
@@ -1813,8 +1805,6 @@ void blk_fill_rwbs(char *rwbs, u32 rw, int bytes)
1813 1805
1814 if (rw & REQ_RAHEAD) 1806 if (rw & REQ_RAHEAD)
1815 rwbs[i++] = 'A'; 1807 rwbs[i++] = 'A';
1816 if (rw & REQ_HARDBARRIER)
1817 rwbs[i++] = 'B';
1818 if (rw & REQ_SYNC) 1808 if (rw & REQ_SYNC)
1819 rwbs[i++] = 'S'; 1809 rwbs[i++] = 'S';
1820 if (rw & REQ_META) 1810 if (rw & REQ_META)