aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/blk-core.c21
-rw-r--r--block/blk-sysfs.c8
-rw-r--r--block/bsg.c3
-rw-r--r--block/compat_ioctl.c2
-rw-r--r--block/elevator.c8
5 files changed, 18 insertions, 24 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 02a9252107ab..d17d71c71d4f 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -28,22 +28,14 @@
28#include <linux/task_io_accounting_ops.h> 28#include <linux/task_io_accounting_ops.h>
29#include <linux/blktrace_api.h> 29#include <linux/blktrace_api.h>
30#include <linux/fault-inject.h> 30#include <linux/fault-inject.h>
31#include <trace/block.h> 31
32#define CREATE_TRACE_POINTS
33#include <trace/events/block.h>
32 34
33#include "blk.h" 35#include "blk.h"
34 36
35DEFINE_TRACE(block_plug);
36DEFINE_TRACE(block_unplug_io);
37DEFINE_TRACE(block_unplug_timer);
38DEFINE_TRACE(block_getrq);
39DEFINE_TRACE(block_sleeprq);
40DEFINE_TRACE(block_rq_requeue);
41DEFINE_TRACE(block_bio_backmerge);
42DEFINE_TRACE(block_bio_frontmerge);
43DEFINE_TRACE(block_bio_queue);
44DEFINE_TRACE(block_rq_complete);
45DEFINE_TRACE(block_remap); /* Also used in drivers/md/dm.c */
46EXPORT_TRACEPOINT_SYMBOL_GPL(block_remap); 37EXPORT_TRACEPOINT_SYMBOL_GPL(block_remap);
38EXPORT_TRACEPOINT_SYMBOL_GPL(block_bio_complete);
47 39
48static int __make_request(struct request_queue *q, struct bio *bio); 40static int __make_request(struct request_queue *q, struct bio *bio);
49 41
@@ -1292,7 +1284,7 @@ static inline void blk_partition_remap(struct bio *bio)
1292 bio->bi_bdev = bdev->bd_contains; 1284 bio->bi_bdev = bdev->bd_contains;
1293 1285
1294 trace_block_remap(bdev_get_queue(bio->bi_bdev), bio, 1286 trace_block_remap(bdev_get_queue(bio->bi_bdev), bio,
1295 bdev->bd_dev, bio->bi_sector, 1287 bdev->bd_dev,
1296 bio->bi_sector - p->start_sect); 1288 bio->bi_sector - p->start_sect);
1297 } 1289 }
1298} 1290}
@@ -1461,8 +1453,7 @@ static inline void __generic_make_request(struct bio *bio)
1461 goto end_io; 1453 goto end_io;
1462 1454
1463 if (old_sector != -1) 1455 if (old_sector != -1)
1464 trace_block_remap(q, bio, old_dev, bio->bi_sector, 1456 trace_block_remap(q, bio, old_dev, old_sector);
1465 old_sector);
1466 1457
1467 trace_block_bio_queue(q, bio); 1458 trace_block_bio_queue(q, bio);
1468 1459
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 9337e17f9110..b1cd04087d6a 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -422,14 +422,18 @@ struct kobj_type blk_queue_ktype = {
422int blk_register_queue(struct gendisk *disk) 422int blk_register_queue(struct gendisk *disk)
423{ 423{
424 int ret; 424 int ret;
425 struct device *dev = disk_to_dev(disk);
425 426
426 struct request_queue *q = disk->queue; 427 struct request_queue *q = disk->queue;
427 428
428 if (WARN_ON(!q)) 429 if (WARN_ON(!q))
429 return -ENXIO; 430 return -ENXIO;
430 431
431 ret = kobject_add(&q->kobj, kobject_get(&disk_to_dev(disk)->kobj), 432 ret = blk_trace_init_sysfs(dev);
432 "%s", "queue"); 433 if (ret)
434 return ret;
435
436 ret = kobject_add(&q->kobj, kobject_get(&dev->kobj), "%s", "queue");
433 if (ret < 0) 437 if (ret < 0)
434 return ret; 438 return ret;
435 439
diff --git a/block/bsg.c b/block/bsg.c
index 2d746e34f4c2..5358f9ae13c1 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -315,6 +315,7 @@ out:
315 blk_put_request(rq); 315 blk_put_request(rq);
316 if (next_rq) { 316 if (next_rq) {
317 blk_rq_unmap_user(next_rq->bio); 317 blk_rq_unmap_user(next_rq->bio);
318 next_rq->bio = NULL;
318 blk_put_request(next_rq); 319 blk_put_request(next_rq);
319 } 320 }
320 return ERR_PTR(ret); 321 return ERR_PTR(ret);
@@ -448,6 +449,7 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr,
448 hdr->dout_resid = rq->resid_len; 449 hdr->dout_resid = rq->resid_len;
449 hdr->din_resid = rq->next_rq->resid_len; 450 hdr->din_resid = rq->next_rq->resid_len;
450 blk_rq_unmap_user(bidi_bio); 451 blk_rq_unmap_user(bidi_bio);
452 rq->next_rq->bio = NULL;
451 blk_put_request(rq->next_rq); 453 blk_put_request(rq->next_rq);
452 } else if (rq_data_dir(rq) == READ) 454 } else if (rq_data_dir(rq) == READ)
453 hdr->din_resid = rq->resid_len; 455 hdr->din_resid = rq->resid_len;
@@ -466,6 +468,7 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr,
466 blk_rq_unmap_user(bio); 468 blk_rq_unmap_user(bio);
467 if (rq->cmd != rq->__cmd) 469 if (rq->cmd != rq->__cmd)
468 kfree(rq->cmd); 470 kfree(rq->cmd);
471 rq->bio = NULL;
469 blk_put_request(rq); 472 blk_put_request(rq);
470 473
471 return ret; 474 return ret;
diff --git a/block/compat_ioctl.c b/block/compat_ioctl.c
index df18a156d011..7865a34e0faa 100644
--- a/block/compat_ioctl.c
+++ b/block/compat_ioctl.c
@@ -568,7 +568,7 @@ static int compat_blk_trace_setup(struct block_device *bdev, char __user *arg)
568 memcpy(&buts.name, &cbuts.name, 32); 568 memcpy(&buts.name, &cbuts.name, 32);
569 569
570 mutex_lock(&bdev->bd_mutex); 570 mutex_lock(&bdev->bd_mutex);
571 ret = do_blk_trace_setup(q, b, bdev->bd_dev, &buts); 571 ret = do_blk_trace_setup(q, b, bdev->bd_dev, bdev, &buts);
572 mutex_unlock(&bdev->bd_mutex); 572 mutex_unlock(&bdev->bd_mutex);
573 if (ret) 573 if (ret)
574 return ret; 574 return ret;
diff --git a/block/elevator.c b/block/elevator.c
index a029cfed80da..ca861927ba41 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -33,17 +33,16 @@
33#include <linux/compiler.h> 33#include <linux/compiler.h>
34#include <linux/delay.h> 34#include <linux/delay.h>
35#include <linux/blktrace_api.h> 35#include <linux/blktrace_api.h>
36#include <trace/block.h>
37#include <linux/hash.h> 36#include <linux/hash.h>
38#include <linux/uaccess.h> 37#include <linux/uaccess.h>
39 38
39#include <trace/events/block.h>
40
40#include "blk.h" 41#include "blk.h"
41 42
42static DEFINE_SPINLOCK(elv_list_lock); 43static DEFINE_SPINLOCK(elv_list_lock);
43static LIST_HEAD(elv_list); 44static LIST_HEAD(elv_list);
44 45
45DEFINE_TRACE(block_rq_abort);
46
47/* 46/*
48 * Merge hash stuff. 47 * Merge hash stuff.
49 */ 48 */
@@ -54,9 +53,6 @@ static const int elv_hash_shift = 6;
54#define ELV_HASH_ENTRIES (1 << elv_hash_shift) 53#define ELV_HASH_ENTRIES (1 << elv_hash_shift)
55#define rq_hash_key(rq) (blk_rq_pos(rq) + blk_rq_sectors(rq)) 54#define rq_hash_key(rq) (blk_rq_pos(rq) + blk_rq_sectors(rq))
56 55
57DEFINE_TRACE(block_rq_insert);
58DEFINE_TRACE(block_rq_issue);
59
60/* 56/*
61 * Query io scheduler to see if the current process issuing bio may be 57 * Query io scheduler to see if the current process issuing bio may be
62 * merged with rq. 58 * merged with rq.