History

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 ]

Alan D. Brunelle committed 17 years ago

Commit a42aaa31 parent de1d7283 files · +16 −16Browse files

Unified · Split

3 files
  1. include/linux/blktrace_api.h +2 −2
  2. include/trace/block.h +2 −2
  3. kernel/trace/blktrace.c +12 −12
include/linux/blktrace_api.h+2−2
@@ -116,9 +116,9 @@ struct blk_io_trace { · 115 unmodified lines
116116 * The remap event
117117 */
118118 struct blk_io_trace_remap {
119− __be32 device;
120119 __be32 device_from;
121− __be64 sector;
120+ __be32 device_to;
121+ __be64 sector_from;
122122 };
123123
124124 enum {
include/trace/block.h+2−2
@@ -70,7 +70,7 @@ DECLARE_TRACE(block_split, · 69 unmodified lines
7070
7171 DECLARE_TRACE(block_remap,
7272 TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev,
73− sector_t from, sector_t to),
74− TP_ARGS(q, bio, dev, from, to));
73+ sector_t to, sector_t from),
74+ TP_ARGS(q, bio, dev, to, from));
7575
7676 #endif
kernel/trace/blktrace.c+12−12
@@ -830,8 +830,8 @@ static void blk_add_trace_split(struct request_queue *q, struct bio *bio, · 829 unmodified lines
830830 * @q: queue the io is for
831831 * @bio: the source bio
832832 * @dev: target device
833− * @from: source sector
834833 * @to: target sector
834+ * @from: source sector
835835 *
836836 * Description:
837837 * 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, · 1 unmodified line
839839 *
840840 **/
841841 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)
843843 {
844844 struct blk_trace *bt = q->blk_trace;
845845 struct blk_io_trace_remap r;
@@ -847,9 +847,9 @@ static void blk_add_trace_remap(struct request_queue *q, struct bio *bio, · 1 unmodified line
847847 if (likely(!bt))
848848 return;
849849
850− r.device = cpu_to_be32(dev);
851− r.device_from = cpu_to_be32(bio->bi_bdev->bd_dev);
852− r.sector = cpu_to_be64(to);
850+ r.device_from = cpu_to_be32(dev);
851+ r.device_to = cpu_to_be32(bio->bi_bdev->bd_dev);
852+ r.sector_from = cpu_to_be64(from);
853853
854854 __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP,
855855 !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r);
@@ -1028,11 +1028,11 @@ static void get_pdu_remap(const struct trace_entry *ent, · 172 unmodified lines
10281028 struct blk_io_trace_remap *r)
10291029 {
10301030 const struct blk_io_trace_remap *__r = pdu_start(ent);
1031− __u64 sector = __r->sector;
1031+ __u64 sector_from = __r->sector_from;
10321032
1033− r->device = be32_to_cpu(__r->device);
10341033 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);
10361036 }
10371037
10381038 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, · 109 unmodified lines
11481148
11491149 static int blk_log_remap(struct trace_seq *s, const struct trace_entry *ent)
11501150 {
1151− struct blk_io_trace_remap r = { .device = 0, };
1151+ struct blk_io_trace_remap r = { .device_from = 0, };
11521152
11531153 get_pdu_remap(ent, &r);
11541154 return trace_seq_printf(s, "%llu + %u <- (%d,%d) %llu\n",
1155− t_sector(ent),
1156− t_sec(ent), MAJOR(r.device), MINOR(r.device),
1157− (unsigned long long)r.sector);
1155+ t_sector(ent), t_sec(ent),
1156+ MAJOR(r.device_from), MINOR(r.device_from),
1157+ (unsigned long long)r.sector_from);
11581158 }
11591159
11601160 static int blk_log_plug(struct trace_seq *s, const struct trace_entry *ent)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t