diff options
Diffstat (limited to 'kernel/trace/blktrace.c')
-rw-r--r-- | kernel/trace/blktrace.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index dfee6f915179..108f4f7715a5 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c | |||
@@ -1362,6 +1362,14 @@ static int blk_str2act_mask(const char *str) | |||
1362 | return mask; | 1362 | return mask; |
1363 | } | 1363 | } |
1364 | 1364 | ||
1365 | static struct request_queue *blk_trace_get_queue(struct block_device *bdev) | ||
1366 | { | ||
1367 | if (bdev->bd_disk == NULL) | ||
1368 | return NULL; | ||
1369 | |||
1370 | return bdev_get_queue(bdev); | ||
1371 | } | ||
1372 | |||
1365 | static ssize_t sysfs_blk_trace_attr_show(struct device *dev, | 1373 | static ssize_t sysfs_blk_trace_attr_show(struct device *dev, |
1366 | struct device_attribute *attr, | 1374 | struct device_attribute *attr, |
1367 | char *buf) | 1375 | char *buf) |
@@ -1376,9 +1384,10 @@ static ssize_t sysfs_blk_trace_attr_show(struct device *dev, | |||
1376 | if (bdev == NULL) | 1384 | if (bdev == NULL) |
1377 | goto out_unlock_kernel; | 1385 | goto out_unlock_kernel; |
1378 | 1386 | ||
1379 | q = bdev_get_queue(bdev); | 1387 | q = blk_trace_get_queue(bdev); |
1380 | if (q == NULL) | 1388 | if (q == NULL) |
1381 | goto out_bdput; | 1389 | goto out_bdput; |
1390 | |||
1382 | mutex_lock(&bdev->bd_mutex); | 1391 | mutex_lock(&bdev->bd_mutex); |
1383 | 1392 | ||
1384 | if (attr == &dev_attr_enable) { | 1393 | if (attr == &dev_attr_enable) { |
@@ -1435,7 +1444,7 @@ static ssize_t sysfs_blk_trace_attr_store(struct device *dev, | |||
1435 | if (bdev == NULL) | 1444 | if (bdev == NULL) |
1436 | goto out_unlock_kernel; | 1445 | goto out_unlock_kernel; |
1437 | 1446 | ||
1438 | q = bdev_get_queue(bdev); | 1447 | q = blk_trace_get_queue(bdev); |
1439 | if (q == NULL) | 1448 | if (q == NULL) |
1440 | goto out_bdput; | 1449 | goto out_bdput; |
1441 | 1450 | ||