From: Mathieu Desnoyers Date: Wed, 16 Mar 2011 22:02:46 +0000 (-0400) Subject: Updates for kernel 2.6.38 X-Git-Tag: v0.19.7 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=0bc7b65420e79fa789f62b1f21ebbee787d7a29f;p=lttng-modules.git Updates for kernel 2.6.38 Signed-off-by: Mathieu Desnoyers --- diff --git a/ltt-ascii.c b/ltt-ascii.c index b020fedb..ad128e8b 100644 --- a/ltt-ascii.c +++ b/ltt-ascii.c @@ -543,7 +543,7 @@ void ltt_ascii_remove(struct ltt_chan *chan) * Wait for every reference to the dentry to be gone, * except us. */ - while (atomic_read(&dentry->d_count) != 1) + while (ACCESS_ONCE(dentry->d_count) != 1) msleep(100); dput(dentry); } diff --git a/ltt-relay-alloc.c b/ltt-relay-alloc.c index 43246a73..03a6ffa0 100644 --- a/ltt-relay-alloc.c +++ b/ltt-relay-alloc.c @@ -360,7 +360,7 @@ void ltt_chan_alloc_remove_files(struct ltt_chan_alloc *chan) * Wait for every reference to the dentry to be gone, * except us. */ - while (atomic_read(&dentry->d_count) != 1) + while (ACCESS_ONCE(dentry->d_count) != 1) msleep(100); dput(dentry); } diff --git a/probes/block-trace.c b/probes/block-trace.c index fcb87d58..a01b6f45 100644 --- a/probes/block-trace.c +++ b/probes/block-trace.c @@ -163,15 +163,15 @@ void probe_block_bio_bounce(void *data, struct request_queue *q, struct bio *bio bio->bi_rw, !bio_flagged(bio, BIO_UPTODATE)); } -void probe_block_bio_complete(void *data, struct request_queue *q, struct bio *bio) +void probe_block_bio_complete(void *data, struct request_queue *q, struct bio *bio, int error) { trace_mark_tp(block, bio_complete, block_bio_complete, probe_block_bio_complete, "sector %llu size %u rw(FAILFAST_DRIVER,FAILFAST_TRANSPORT," "FAILFAST_DEV,DISCARD,META,SYNC,BARRIER,AHEAD,RW) %lX " - "not_uptodate #1u%d", + "not_uptodate #1u%d error %d", (unsigned long long)bio->bi_sector, bio->bi_size, - bio->bi_rw, !bio_flagged(bio, BIO_UPTODATE)); + bio->bi_rw, !bio_flagged(bio, BIO_UPTODATE), error); } void probe_block_bio_backmerge(void *data, struct request_queue *q, struct bio *bio) @@ -288,22 +288,40 @@ void probe_block_split(void *data, struct request_queue *q, struct bio *bio, bio->bi_rw, !bio_flagged(bio, BIO_UPTODATE), pdu); } -void probe_block_remap(void *data, struct request_queue *q, struct bio *bio, - dev_t dev, sector_t from) +void probe_block_bio_remap(void *data, struct request_queue *q, struct bio *bio, + dev_t dev, sector_t from) { - trace_mark_tp(block, remap, block_remap, - probe_block_remap, - "device_from %lu sector_from %llu device_to %lu " - "size %u rw(FAILFAST_DRIVER,FAILFAST_TRANSPORT," + trace_mark_tp(block, bio_remap, block_bio_remap, + probe_block_bio_remap, + "device_from %lu sector_from %llu nr_sector %llu device_to %lu " + "sector_to %llu size %u rw(FAILFAST_DRIVER,FAILFAST_TRANSPORT," "FAILFAST_DEV,DISCARD,META,SYNC,BARRIER,AHEAD,RW) %lX " "not_uptodate #1u%d", - (unsigned long)bio->bi_bdev->bd_dev, - (unsigned long long)from, (unsigned long)dev, + (unsigned long long)from, + (unsigned long long)bio->bi_size >> 9, + (unsigned long)bio->bi_bdev->bd_dev, + (unsigned long long)bio->bi_sector, bio->bi_size, bio->bi_rw, !bio_flagged(bio, BIO_UPTODATE)); } +void probe_block_rq_remap(void *data, struct request_queue *q, + struct request *rq, + dev_t dev, sector_t from) +{ + trace_mark_tp(block, rq_remap, block_rq_remap, + probe_block_rq_remap, + "device_from %lu sector_from %llu nr_sector %llu device_to %lu " + "sector_to %llu size %u", + (unsigned long)dev, + (unsigned long long)from, + (unsigned long long)blk_rq_sectors(rq), + (unsigned long)disk_devt(rq->rq_disk), + (unsigned long long)blk_rq_pos(rq), + blk_rq_bytes(rq)); +} + MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Mathieu Desnoyers"); MODULE_DESCRIPTION("Block Tracepoint Probes");