[PATCH 1/9] Adding the necessary ddir changes to introduce copy operation.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ankit Kumar <ankit.kumar@xxxxxxxxxxx>

Signed-off-by: Krishna Kanth Reddy <krish.reddy@xxxxxxxxxxx>
---
 io_ddir.h | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/io_ddir.h b/io_ddir.h
index a42da97a..22e95f70 100644
--- a/io_ddir.h
+++ b/io_ddir.h
@@ -5,22 +5,23 @@ enum fio_ddir {
 	DDIR_READ = 0,
 	DDIR_WRITE = 1,
 	DDIR_TRIM = 2,
-	DDIR_SYNC = 3,
+	DDIR_COPY = 3,
+	DDIR_SYNC = 4,
 	DDIR_DATASYNC,
 	DDIR_SYNC_FILE_RANGE,
 	DDIR_WAIT,
 	DDIR_LAST,
 	DDIR_INVAL = -1,
 
-	DDIR_RWDIR_CNT = 3,
-	DDIR_RWDIR_SYNC_CNT = 4,
+	DDIR_RWDIR_CNT = 4,
+	DDIR_RWDIR_SYNC_CNT = 5,
 };
 
 #define for_each_rw_ddir(ddir)	for (enum fio_ddir ddir = 0; ddir < DDIR_RWDIR_CNT; ddir++)
 
 static inline const char *io_ddir_name(enum fio_ddir ddir)
 {
-	static const char *name[] = { "read", "write", "trim", "sync",
+	static const char *name[] = { "read", "write", "trim", "copy", "sync"
 					"datasync", "sync_file_range",
 					"wait", };
 
@@ -35,17 +36,20 @@ enum td_ddir {
 	TD_DDIR_WRITE		= 1 << 1,
 	TD_DDIR_RAND		= 1 << 2,
 	TD_DDIR_TRIM		= 1 << 3,
+	TD_DDIR_COPY		= 1 << 4,
 	TD_DDIR_RW		= TD_DDIR_READ | TD_DDIR_WRITE,
 	TD_DDIR_RANDREAD	= TD_DDIR_READ | TD_DDIR_RAND,
 	TD_DDIR_RANDWRITE	= TD_DDIR_WRITE | TD_DDIR_RAND,
 	TD_DDIR_RANDRW		= TD_DDIR_RW | TD_DDIR_RAND,
 	TD_DDIR_RANDTRIM	= TD_DDIR_TRIM | TD_DDIR_RAND,
 	TD_DDIR_TRIMWRITE	= TD_DDIR_TRIM | TD_DDIR_WRITE,
+	TD_DDIR_RANDCOPY	= TD_DDIR_COPY | TD_DDIR_RAND,
 };
 
 #define td_read(td)		((td)->o.td_ddir & TD_DDIR_READ)
 #define td_write(td)		((td)->o.td_ddir & TD_DDIR_WRITE)
 #define td_trim(td)		((td)->o.td_ddir & TD_DDIR_TRIM)
+#define td_copy(td)		((td)->o.td_ddir & TD_DDIR_COPY)
 #define td_rw(td)		(((td)->o.td_ddir & TD_DDIR_RW) == TD_DDIR_RW)
 #define td_random(td)		((td)->o.td_ddir & TD_DDIR_RAND)
 #define file_randommap(td, f)	(!(td)->o.norandommap && fio_file_axmap((f)))
@@ -60,19 +64,23 @@ static inline int ddir_sync(enum fio_ddir ddir)
 
 static inline int ddir_rw(enum fio_ddir ddir)
 {
-	return ddir == DDIR_READ || ddir == DDIR_WRITE || ddir == DDIR_TRIM;
+	return ddir == DDIR_READ || ddir == DDIR_WRITE || ddir == DDIR_TRIM ||
+	       ddir == DDIR_COPY;
 }
 
 static inline const char *ddir_str(enum td_ddir ddir)
 {
 	static const char *__str[] = { NULL, "read", "write", "rw", "rand",
 				"randread", "randwrite", "randrw",
-				"trim", NULL, "trimwrite", NULL, "randtrim" };
+				"trim", NULL, "trimwrite", NULL, "randtrim",
+				 NULL,  NULL, NULL, "copy",  NULL,  NULL,
+				 NULL, "randcopy" };
 
 	return __str[ddir];
 }
 
 #define ddir_rw_sum(arr)	\
-	((arr)[DDIR_READ] + (arr)[DDIR_WRITE] + (arr)[DDIR_TRIM])
+	((arr)[DDIR_READ] + (arr)[DDIR_WRITE] + (arr)[DDIR_TRIM] \
+	 + (arr)[DDIR_COPY])
 
 #endif
-- 
2.17.1




[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux