fix bug when setting default port for iscsi
[tridge/dbench.git] / dbench.h
index 4e6d7e8524c62d3ab60f698e7ff2b46ec496b2ff..865f0d8ac5992df7f8f6a50dbadc8e5bd14bc51e 100644 (file)
--- a/dbench.h
+++ b/dbench.h
@@ -19,6 +19,7 @@
 #include "config.h"
 #include <stdio.h>
 #include <stdlib.h>
+#include <stddef.h>
 #include <signal.h>
 #include <unistd.h>
 #include <string.h>
 #define False 0
 #define uint32 unsigned
 
+struct op {
+       unsigned count;
+       double total_time;
+       double max_latency;
+};
+
+#define ZERO_STRUCT(x) memset(&(x), 0, sizeof(x))
+
+#define MAX_OPS 100
+
 struct child_struct {
        int id;
        int failed;
@@ -111,14 +122,17 @@ struct child_struct {
                double last_bytes;
                struct timeval last_time;
        } rate;
+       struct op ops[MAX_OPS];
        void *private;
 };
 
 struct options {
+       const char *backend;
        int nprocs;
        int sync_open;
        int sync_dirs;
        int do_fsync;
+       int no_resolve;
        int fsync_frequency;
        char *tcp_options;
        int timelimit;
@@ -129,8 +143,47 @@ struct options {
        int ea_enable;
        const char *server;
        int clients_per_process;
+       int one_byte_write_fix;
+       int stat_check;
+       int fake_io;
+       int skip_cleanup;
+       int per_client_results;
+       const char *export;
+       const char *protocol;
+       int run_once;
+       int allow_scsi_writes;
+       int trunc_io;
+       const char *scsi_dev;
+       const char *iscsi_portal;
+       const char *iscsi_target;
+       int iscsi_lun;
+       int iscsi_port;
 };
 
+
+struct dbench_op {
+       struct child_struct *child;
+       const char *op;
+       const char *fname;
+       const char *fname2;
+       const char *status;
+       int params[10];
+};
+
+struct backend_op {
+       const char *name;
+       void (*fn)(struct dbench_op *);
+};
+
+struct nb_operations {
+       const char *backend_name;       
+       struct backend_op *ops;
+       int (*init)(void);
+       void (*setup)(struct child_struct *child);
+       void (*cleanup)(struct child_struct *child);
+};
+extern struct nb_operations *nb_ops;
+
 /* CreateDisposition field. */
 #define FILE_SUPERSEDE 0
 #define FILE_OPEN 1
@@ -153,6 +206,8 @@ struct options {
 #define O_DIRECTORY    0200000
 #endif
 
+struct nfsio;
+
 #include "proto.h"
 
 extern struct options options;