Skip to contentSkip to conversation

block/mirror: Fix passing wrong argument to trace_mirror_yield

PATCH In review Yang Wei 2 participants 2 messages Nov 28, 2016 Block layer

lore
Share & tools
lore

Yang Wei

author
#0 lore raw

PATCH 1/1 block/mirror: Fix passing wrong argument to trace_mirror_yield

mirror_yield is defined in block/trace-event, just like the following:
mirror_yield(void *s, int64_t cnt, int buf_free_count, int in_flight) so we should exchange arguement 2 and 4 while invoking it.

---
 block/mirror.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
block/mirror.c +2 -2
index 301ba92..2846a2e 100644
@@ -577,7 +577,7 @@ static int coroutine_fn mirror_dirty_init(MirrorBlockJob *s)
             }
 
             if (s->in_flight >= MAX_IN_FLIGHT) {
-                trace_mirror_yield(s, s->in_flight, s->buf_free_count, -1);
+                trace_mirror_yield(s,  -1, s->buf_free_count, s->in_flight);
                 mirror_wait_for_io(s);
                 continue;
             }
@@ -730,7 +730,7 @@ static void coroutine_fn mirror_run(void *opaque)
             s->common.iostatus == BLOCK_DEVICE_IO_STATUS_OK) {
             if (s->in_flight >= MAX_IN_FLIGHT || s->buf_free_count == 0 ||
                 (cnt == 0 && s->in_flight > 0)) {
-                trace_mirror_yield(s, s->in_flight, s->buf_free_count, cnt);
+                trace_mirror_yield(s, cnt, s->buf_free_count, s->in_flight);
                 mirror_wait_for_io(s);
                 continue;
             } else if (cnt != 0) {
Signature · 1 line
2.10.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 35 lines · Yang Wei

mirror_yield is defined in block/trace-event, just like the following:
mirror_yield(void *s, int64_t cnt, int buf_free_count, int in_flight) so we should exchange arguement 2 and 4 while invoking it.

---
 block/mirror.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
block/mirror.c +2 -2
index 301ba92..2846a2e 100644
@@ -577,7 +577,7 @@ static int coroutine_fn mirror_dirty_init(MirrorBlockJob *s)
             }
 
             if (s->in_flight >= MAX_IN_FLIGHT) {
-                trace_mirror_yield(s, s->in_flight, s->buf_free_count, -1);
+                trace_mirror_yield(s,  -1, s->buf_free_count, s->in_flight);
                 mirror_wait_for_io(s);
                 continue;
             }
@@ -730,7 +730,7 @@ static void coroutine_fn mirror_run(void *opaque)
             s->common.iostatus == BLOCK_DEVICE_IO_STATUS_OK) {
             if (s->in_flight >= MAX_IN_FLIGHT || s->buf_free_count == 0 ||
                 (cnt == 0 && s->in_flight > 0)) {
-                trace_mirror_yield(s, s->in_flight, s->buf_free_count, cnt);
+                trace_mirror_yield(s, cnt, s->buf_free_count, s->in_flight);
                 mirror_wait_for_io(s);
                 continue;
             } else if (cnt != 0) {
Signature · 1 line
2.10.2