Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message Apr 9, 2018

Subsystems (2)
lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit 465964a6c8ff3ccac62b92e9af57377075e04579:

Merge branch 'master' of https://github.com/bvanassche/fio (2018-04-06 17:59:20 -0600)

are available in the git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to 9fac0db7a09bac08bbff9b213d3b1daceee07679:

steadystate: check for division by zero in mean calculation (2018-04-08 15:54:26 -0600)

----------------------------------------------------------------
Jens Axboe (8):
Remove binject engine
axmap: use calloc() for level alloc
server: fix dead assignment of variable
client: fix bad shadowing of 'ret'
filesetup: fix dead assignment of 'ret'
parse: fix dead 'org' assignment
eta: fix dead variable assignments
steadystate: check for division by zero in mean calculation

 Makefile          |   2 +-
 client.c          |   6 +-
 engines/binject.c | 458 ------------------------------------------------------
 eta.c             |   4 +-
 filesetup.c       |   3 -
 io_u.h            |   3 -
 lib/axmap.c       |   2 +-
 options.c         |   5 -
 os/binject.h      |  71 ---------
 os/os-android.h   |   1 -
 os/os-linux.h     |   2 -
 parse.c           |   2 -
 server.c          |   1 -
 steadystate.c     |   6 +
 14 files changed, 13 insertions(+), 553 deletions(-)
 delete mode 100644 engines/binject.c
 delete mode 100644 os/binject.h

---

Diff of recent changes:

Makefile +1 -1
index d45ba6b..cc4b71f 100644
@@ -148,7 +148,7 @@ endif
 
 ifeq ($(CONFIG_TARGET_OS), Linux)
   SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c engines/sg.c \
-		engines/binject.c oslib/linux-dev-lookup.c
+		oslib/linux-dev-lookup.c
   LIBS += -lpthread -ldl
   LDFLAGS += -rdynamic
 endif
client.c +3 -3
index 970974a..ea1a4d2 100644
@@ -1339,7 +1339,7 @@ static int fio_client_handle_iolog(struct fio_client *client,
 	sprintf(log_pathname, "%s.%s", pdu->name, client->hostname);
 
 	if (store_direct) {
-		ssize_t ret;
+		ssize_t wrote;
 		size_t sz;
 		int fd;
 
@@ -1353,10 +1353,10 @@ static int fio_client_handle_iolog(struct fio_client *client,
 		}
 
 		sz = cmd->pdu_len - sizeof(*pdu);
-		ret = write(fd, pdu->samples, sz);
+		wrote = write(fd, pdu->samples, sz);
 		close(fd);
 
-		if (ret != sz) {
+		if (wrote != sz) {
 			log_err("fio: short write on compressed log\n");
 			ret = 1;
 			goto out;
engines/binject.c deleted +0 -458

458 lines not on this page · raw message

eta.c +2 -2
index 2d549ee..9111f5e 100644
@@ -149,7 +149,7 @@ void eta_to_str(char *str, unsigned long eta_sec)
 		str += sprintf(str, "%02uh:", h);
 
 	str += sprintf(str, "%02um:", m);
-	str += sprintf(str, "%02us", s);
+	sprintf(str, "%02us", s);
 }
 
 /*
@@ -621,7 +621,7 @@ void display_thread_status(struct jobs_eta *je)
 			free(iops_str[ddir]);
 		}
 	}
-	p += sprintf(p, "\r");
+	sprintf(p, "\r");
 
 	printf("%s", output);
 
filesetup.c +0 -3
index b246e0f..75694bd 100644
@@ -490,7 +490,6 @@ static int __file_invalidate_cache(struct thread_data *td, struct fio_file *f,
 	} else if (td_ioengine_flagged(td, FIO_DISKLESSIO)) {
 		dprint(FD_IO, "invalidate not supported by ioengine %s\n",
 		       td->io_ops->name);
-		ret = 0;
 	} else if (f->filetype == FIO_TYPE_FILE) {
 		dprint(FD_IO, "declare unneeded cache %s: %llu/%llu\n",
 			f->file_name, off, len);
@@ -517,14 +516,12 @@ static int __file_invalidate_cache(struct thread_data *td, struct fio_file *f,
 				log_err("fio: only root may flush block "
 					"devices. Cache flush bypassed!\n");
 			}
-			ret = 0;
 		}
 		if (ret < 0)
 			errval = errno;
 	} else if (f->filetype == FIO_TYPE_CHAR ||
 		   f->filetype == FIO_TYPE_PIPE) {
 		dprint(FD_IO, "invalidate not supported %s\n", f->file_name);
-		ret = 0;
 	}
 
 	/*
io_u.h +0 -3
index aaa7d97..4f433c3 100644
@@ -113,9 +113,6 @@ struct io_u {
 #ifdef CONFIG_SOLARISAIO
 		aio_result_t resultp;
 #endif
-#ifdef FIO_HAVE_BINJECT
-		struct b_user_cmd buc;
-#endif
 #ifdef CONFIG_RDMA
 		struct ibv_mr *mr;
 #endif
lib/axmap.c +1 -1
index bf203df..3c65308 100644
@@ -102,7 +102,7 @@ struct axmap *axmap_new(unsigned long nr_bits)
 	}
 
 	axmap->nr_levels = levels;
-	axmap->levels = malloc(axmap->nr_levels * sizeof(struct axmap_level));
+	axmap->levels = calloc(axmap->nr_levels, sizeof(struct axmap_level));
 	axmap->nr_bits = nr_bits;
 
 	for (i = 0; i < axmap->nr_levels; i++) {
options.c +0 -5
index 17d7245..fae3943 100644
@@ -1816,11 +1816,6 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
 			    .help = "GUASI IO engine",
 			  },
 #endif
-#ifdef FIO_HAVE_BINJECT
-			  { .ival = "binject",
-			    .help = "binject direct inject block engine",
-			  },
-#endif
 #ifdef CONFIG_RDMA
 			  { .ival = "rdma",
 			    .help = "RDMA IO engine",
os/binject.h deleted +0 -71

71 lines not on this page · raw message

os/os-android.h +0 -1
index bb590e4..1483275 100644
@@ -18,7 +18,6 @@
 #include <asm/byteorder.h>
 
 #include "./os-linux-syscall.h"
-#include "binject.h"
 #include "../file.h"
 
 #ifndef __has_builtin         // Optional of course.
os/os-linux.h +0 -2
index 1d400a0..a550bba 100644
@@ -27,7 +27,6 @@
 #endif /* ARCH_HAVE_CRC_CRYPTO */
 
 #include "./os-linux-syscall.h"
-#include "binject.h"
 #include "../file.h"
 
 #ifndef __has_builtin         // Optional of course.
@@ -48,7 +47,6 @@
 #define FIO_HAVE_CGROUPS
 #define FIO_HAVE_FS_STAT
 #define FIO_HAVE_TRIM
-#define FIO_HAVE_BINJECT
 #define FIO_HAVE_GETTID
 #define FIO_USE_GENERIC_INIT_RANDOM_STATE
 #define FIO_HAVE_PWRITEV2
parse.c +0 -2
index 3993471..539c602 100644
@@ -1185,8 +1185,6 @@ static void __print_option(const struct fio_option *o,
 
 	if (!o)
 		return;
-	if (!org)
-		org = o;
 
 	p = name;
 	depth = level;
server.c +0 -1
index d3f6977..2e08c66 100644
@@ -1199,7 +1199,6 @@ static int handle_connection(struct sk_out *sk_out)
 			.events	= POLLIN,
 		};
 
-		ret = 0;
 		do {
 			int timeout = 1000;
 
steadystate.c +6 -0
index 1e3a546..ee1c0e5 100644
@@ -350,6 +350,9 @@ uint64_t steadystate_bw_mean(struct thread_stat *ts)
 	int i;
 	uint64_t sum;
 
+	if (!ts->ss_dur)
+		return 0;
+
 	for (i = 0, sum = 0; i < ts->ss_dur; i++)
 		sum += ts->ss_bw_data[i];
 
@@ -361,6 +364,9 @@ uint64_t steadystate_iops_mean(struct thread_stat *ts)
 	int i;
 	uint64_t sum;
 
+	if (!ts->ss_dur)
+		return 0;
+
 	for (i = 0, sum = 0; i < ts->ss_dur; i++)
 		sum += ts->ss_iops_data[i];