diff options
author | Alan D. Brunelle <Alan.Brunelle@hp.com> | 2009-05-04 16:27:26 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-06 08:13:00 -0400 |
commit | a42aaa3bbce85ac487ad4fad5db99e8e91b7aac1 (patch) | |
tree | 1f1b4ac4335774c154213e756d10247e5eac1ded /kernel/trace | |
parent | de1d7286060430e79a1d50ad6e5fee8fe863c5f6 (diff) |
blktrace: correct remap names
This attempts to clarify names utilized during block I/O remap
operations (partition, volume manager). It correctly matches up the
/from/ information for both device & sector. This takes in the concept
from Kosaki Motohiro and extends it to include better naming for the
"device_from" field.
[ Impact: cleanup ]
Signed-off-by: Alan D. Brunelle <alan.brunelle@hp.com>
Reviewed-by: Li Zefan <lizf@cn.fujitsu.com>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <49FF4FAE.3000301@hp.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/blktrace.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index c32062bd10b3..f8d46d6f5d34 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c | |||
@@ -830,8 +830,8 @@ static void blk_add_trace_split(struct request_queue *q, struct bio *bio, | |||
830 | * @q: queue the io is for | 830 | * @q: queue the io is for |
831 | * @bio: the source bio | 831 | * @bio: the source bio |
832 | * @dev: target device | 832 | * @dev: target device |
833 | * @from: source sector | ||
834 | * @to: target sector | 833 | * @to: target sector |
834 | * @from: source sector | ||
835 | * | 835 | * |
836 | * Description: | 836 | * Description: |
837 | * Device mapper or raid target sometimes need to split a bio because | 837 | * Device mapper or raid target sometimes need to split a bio because |
@@ -839,7 +839,7 @@ static void blk_add_trace_split(struct request_queue *q, struct bio *bio, | |||
839 | * | 839 | * |
840 | **/ | 840 | **/ |
841 | static void blk_add_trace_remap(struct request_queue *q, struct bio *bio, | 841 | static void blk_add_trace_remap(struct request_queue *q, struct bio *bio, |
842 | dev_t dev, sector_t from, sector_t to) | 842 | dev_t dev, sector_t to, sector_t from) |
843 | { | 843 | { |
844 | struct blk_trace *bt = q->blk_trace; | 844 | struct blk_trace *bt = q->blk_trace; |
845 | struct blk_io_trace_remap r; | 845 | struct blk_io_trace_remap r; |
@@ -847,9 +847,9 @@ static void blk_add_trace_remap(struct request_queue *q, struct bio *bio, | |||
847 | if (likely(!bt)) | 847 | if (likely(!bt)) |
848 | return; | 848 | return; |
849 | 849 | ||
850 | r.device = cpu_to_be32(dev); | 850 | r.device_from = cpu_to_be32(dev); |
851 | r.device_from = cpu_to_be32(bio->bi_bdev->bd_dev); | 851 | r.device_to = cpu_to_be32(bio->bi_bdev->bd_dev); |
852 | r.sector = cpu_to_be64(to); | 852 | r.sector_from = cpu_to_be64(from); |
853 | 853 | ||
854 | __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, | 854 | __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, |
855 | !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r); | 855 | !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r); |
@@ -1028,11 +1028,11 @@ static void get_pdu_remap(const struct trace_entry *ent, | |||
1028 | struct blk_io_trace_remap *r) | 1028 | struct blk_io_trace_remap *r) |
1029 | { | 1029 | { |
1030 | const struct blk_io_trace_remap *__r = pdu_start(ent); | 1030 | const struct blk_io_trace_remap *__r = pdu_start(ent); |
1031 | __u64 sector = __r->sector; | 1031 | __u64 sector_from = __r->sector_from; |
1032 | 1032 | ||
1033 | r->device = be32_to_cpu(__r->device); | ||
1034 | r->device_from = be32_to_cpu(__r->device_from); | 1033 | r->device_from = be32_to_cpu(__r->device_from); |
1035 | r->sector = be64_to_cpu(sector); | 1034 | r->device_to = be32_to_cpu(__r->device_to); |
1035 | r->sector_from = be64_to_cpu(sector_from); | ||
1036 | } | 1036 | } |
1037 | 1037 | ||
1038 | typedef int (blk_log_action_t) (struct trace_iterator *iter, const char *act); | 1038 | typedef int (blk_log_action_t) (struct trace_iterator *iter, const char *act); |
@@ -1148,13 +1148,13 @@ static int blk_log_with_error(struct trace_seq *s, | |||
1148 | 1148 | ||
1149 | static int blk_log_remap(struct trace_seq *s, const struct trace_entry *ent) | 1149 | static int blk_log_remap(struct trace_seq *s, const struct trace_entry *ent) |
1150 | { | 1150 | { |
1151 | struct blk_io_trace_remap r = { .device = 0, }; | 1151 | struct blk_io_trace_remap r = { .device_from = 0, }; |
1152 | 1152 | ||
1153 | get_pdu_remap(ent, &r); | 1153 | get_pdu_remap(ent, &r); |
1154 | return trace_seq_printf(s, "%llu + %u <- (%d,%d) %llu\n", | 1154 | return trace_seq_printf(s, "%llu + %u <- (%d,%d) %llu\n", |
1155 | t_sector(ent), | 1155 | t_sector(ent), t_sec(ent), |
1156 | t_sec(ent), MAJOR(r.device), MINOR(r.device), | 1156 | MAJOR(r.device_from), MINOR(r.device_from), |
1157 | (unsigned long long)r.sector); | 1157 | (unsigned long long)r.sector_from); |
1158 | } | 1158 | } |
1159 | 1159 | ||
1160 | static int blk_log_plug(struct trace_seq *s, const struct trace_entry *ent) | 1160 | static int blk_log_plug(struct trace_seq *s, const struct trace_entry *ent) |