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.c7
-rw-r--r--block/bsg.c3
-rw-r--r--block/compat_ioctl.c2
-rw-r--r--block/elevator.c8
5 files changed, 18 insertions, 23 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index c89883be8737..9475bf99b891 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
@@ -1277,7 +1269,7 @@ static inline void blk_partition_remap(struct bio *bio)
1277 bio->bi_bdev = bdev->bd_contains; 1269 bio->bi_bdev = bdev->bd_contains;
1278 1270
1279 trace_block_remap(bdev_get_queue(bio->bi_bdev), bio, 1271 trace_block_remap(bdev_get_queue(bio->bi_bdev), bio,
1280 bdev->bd_dev, bio->bi_sector, 1272 bdev->bd_dev,
1281 bio->bi_sector - p->start_sect); 1273 bio->bi_sector - p->start_sect);
1282 } 1274 }
1283} 1275}
@@ -1446,8 +1438,7 @@ static inline void __generic_make_request(struct bio *bio)
1446 goto end_io; 1438 goto end_io;
1447 1439
1448 if (old_sector != -1) 1440 if (old_sector != -1)
1449 trace_block_remap(q, bio, old_dev, bio->bi_sector, 1441 trace_block_remap(q, bio, old_dev, old_sector);
1450 old_sector);
1451 1442
1452 trace_block_bio_queue(q, bio); 1443 trace_block_bio_queue(q, bio);
1453 1444
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 3ff9bba3379a..26f9ec28f56c 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -383,16 +383,21 @@ struct kobj_type blk_queue_ktype = {
383int blk_register_queue(struct gendisk *disk) 383int blk_register_queue(struct gendisk *disk)
384{ 384{
385 int ret; 385 int ret;
386 struct device *dev = disk_to_dev(disk);
386 387
387 struct request_queue *q = disk->queue; 388 struct request_queue *q = disk->queue;
388 389
389 if (WARN_ON(!q)) 390 if (WARN_ON(!q))
390 return -ENXIO; 391 return -ENXIO;
391 392
393 ret = blk_trace_init_sysfs(dev);
394 if (ret)
395 return ret;
396
392 if (!q->request_fn) 397 if (!q->request_fn)
393 return 0; 398 return 0;
394 399
395 ret = kobject_add(&q->kobj, kobject_get(&disk_to_dev(disk)->kobj), 400 ret = kobject_add(&q->kobj, kobject_get(&dev->kobj),
396 "%s", "queue"); 401 "%s", "queue");
397 if (ret < 0) 402 if (ret < 0)
398 return ret; 403 return ret;
diff --git a/block/bsg.c b/block/bsg.c
index 206060e795da..dd81be455e00 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->data_len; 449 hdr->dout_resid = rq->data_len;
449 hdr->din_resid = rq->next_rq->data_len; 450 hdr->din_resid = rq->next_rq->data_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->data_len; 455 hdr->din_resid = rq->data_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 f87615dea46b..f8c218cd08e1 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 7073a9072577..e220f0c543e3 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 */
@@ -55,9 +54,6 @@ static const int elv_hash_shift = 6;
55#define rq_hash_key(rq) ((rq)->sector + (rq)->nr_sectors) 54#define rq_hash_key(rq) ((rq)->sector + (rq)->nr_sectors)
56#define ELV_ON_HASH(rq) (!hlist_unhashed(&(rq)->hash)) 55#define ELV_ON_HASH(rq) (!hlist_unhashed(&(rq)->hash))
57 56
58DEFINE_TRACE(block_rq_insert);
59DEFINE_TRACE(block_rq_issue);
60
61/* 57/*
62 * Query io scheduler to see if the current process issuing bio may be 58 * Query io scheduler to see if the current process issuing bio may be
63 * merged with rq. 59 * merged with rq.