td: Rename last_ddir to last_ddir_completed
authorMinwoo Im <minwoo.im.dev@gmail.com>
Tue, 9 Jul 2024 22:45:04 +0000 (07:45 +0900)
committerMinwoo Im <minwoo.im@samsung.com>
Tue, 9 Jul 2024 23:01:54 +0000 (08:01 +0900)
`last_ddir` represents the data direction of the latest completed
command.  To avoid confusions, this patch renamed `last_ddir` to
`last_ddir_completed` to make it much more clear.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
fio.h
io_u.c

diff --git a/fio.h b/fio.h
index 7d9927a006551af0bfb6080e06c36844aeb1fce0..c5b4df2106c2a43fe96eb2341af4116e44ae98ec 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -259,7 +259,7 @@ struct thread_data {
        volatile int runstate;
        volatile bool terminate;
        bool last_was_sync;
-       enum fio_ddir last_ddir;
+       enum fio_ddir last_ddir_completed;
 
        int mmapfd;
 
diff --git a/io_u.c b/io_u.c
index a090e12122642f238569f9fa663ab44d5091bef6..b5c03db746f264882f1dd90217516e78a18272ac 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -1757,7 +1757,7 @@ static bool check_get_trim(struct thread_data *td, struct io_u *io_u)
                if (get_next_trim(td, io_u))
                        return true;
        } else if (!(td->io_hist_len % td->o.trim_backlog) &&
-                    td->last_ddir != DDIR_READ) {
+                    td->last_ddir_completed != DDIR_READ) {
                td->trim_batch = td->o.trim_batch;
                if (!td->trim_batch)
                        td->trim_batch = td->o.trim_backlog;
@@ -1779,7 +1779,7 @@ static bool check_get_verify(struct thread_data *td, struct io_u *io_u)
                if (td->verify_batch)
                        get_verify = 1;
                else if (!(td->io_hist_len % td->o.verify_backlog) &&
-                        td->last_ddir != DDIR_READ) {
+                        td->last_ddir_completed != DDIR_READ) {
                        td->verify_batch = td->o.verify_batch;
                        if (!td->verify_batch)
                                td->verify_batch = td->o.verify_backlog;
@@ -2122,7 +2122,7 @@ static void io_completed(struct thread_data *td, struct io_u **io_u_ptr,
                return;
        }
 
-       td->last_ddir = ddir;
+       td->last_ddir_completed = ddir;
 
        if (!io_u->error && ddir_rw(ddir)) {
                unsigned long long bytes = io_u->xfer_buflen - io_u->resid;