fio: enable dataplacement(fdp) while replaying I/Os
authorHyunwoo Park <dshw.park@samsung.com>
Thu, 23 May 2024 07:30:36 +0000 (07:30 +0000)
committerHyunwoo Park <dshw.park@samsung.com>
Mon, 27 May 2024 05:38:54 +0000 (05:38 +0000)
Add initialization and dataplacement logic to enable
dataplacement(fdp) while fio replays I/Os with read_iolog.

Signed-off-by: Hyunwoo Park <dshw.park@samsung.com>
iolog.c

diff --git a/iolog.c b/iolog.c
index 96af4f33e186dd4ec1a02b851a1c7ae4c0b1eaeb..37ad0d2a16f55c354580e3229589e2e60afb1187 100644 (file)
--- a/iolog.c
+++ b/iolog.c
@@ -140,8 +140,17 @@ static int ipo_special(struct thread_data *td, struct io_piece *ipo)
                        break;
                }
                ret = td_io_open_file(td, f);
-               if (!ret)
+               if (!ret) {
+                       if (td->o.dp_type != FIO_DP_NONE) {
+                               int dp_init_ret = dp_init(td);
+
+                               if (dp_init_ret != 0) {
+                                       td_verror(td, dp_init_ret, "dp_init");
+                                       return -1;
+                               }
+                       }
                        break;
+               }
                td_verror(td, ret, "iolog open file");
                return -1;
        case FIO_LOG_CLOSE_FILE:
@@ -233,6 +242,9 @@ int read_iolog_get(struct thread_data *td, struct io_u *io_u)
                                usec_sleep(td, (ipo->delay - elapsed) * 1000);
                }
 
+               if (td->o.dp_type != FIO_DP_NONE)
+                       dp_fill_dspec_data(td, io_u);
+
                free(ipo);
 
                if (io_u->ddir != DDIR_WAIT)