summaryrefslogtreecommitdiffstats
path: root/c_pgms/threaded_io/thread_fops.h
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2012-01-04 19:08:45 +0530
committerRaghavendra Bhat <raghavendrabhat@gluster.com>2012-01-23 00:20:52 +0530
commit80ed64e2245d6604b0052d4fe3c8e537e7975e76 (patch)
tree153ff7394d41f3b1272c1e3337f509466fd7f721 /c_pgms/threaded_io/thread_fops.h
parent050acf41d8ece168016184f3e2ae5be9023cb4b4 (diff)
c_pgms/threaded_io: changes to take arguments from user
Changes to take the working directory and the time duration for which the test has to run from the user. Change-Id: I2d56b0b0b640675dd52f4f3a6f17229e3cdf5d1a Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Diffstat (limited to 'c_pgms/threaded_io/thread_fops.h')
-rw-r--r--c_pgms/threaded_io/thread_fops.h52
1 files changed, 32 insertions, 20 deletions
diff --git a/c_pgms/threaded_io/thread_fops.h b/c_pgms/threaded_io/thread_fops.h
index 44479e6..545145d 100644
--- a/c_pgms/threaded_io/thread_fops.h
+++ b/c_pgms/threaded_io/thread_fops.h
@@ -9,6 +9,8 @@
#include <string.h>
#include <pthread.h>
#include <dirent.h>
+#include <argp.h>
+#include <libgen.h>
void * open_thread (void *);
void * fstat_thread (void *);
@@ -68,28 +70,38 @@ typedef struct open_fstat oft;
} \
} while (0);
+#ifndef UNIX_PATH_MAX
+#define UNIX_PATH_MAX 4096
+#endif
+
typedef struct info {
pthread_mutex_t mutex;
- unsigned int num_open;
- unsigned int num_open_success;
- unsigned int flocks;
- unsigned int flocks_success;
- unsigned int fcntl_locks;
- unsigned int fcntl_locks_success;
- unsigned int read;
- unsigned int read_success;
- unsigned int write;
- unsigned int write_success;
- unsigned int fstat;
- unsigned int fstat_success;
- unsigned int truncate;
- unsigned int truncate_success;
- unsigned int chown;
- unsigned int chown_success;
- unsigned int opendir;
- unsigned int opendir_success;
- unsigned int readdir;
- unsigned int readdir_success;
+ unsigned long long num_open;
+ unsigned long long num_open_success;
+ unsigned long long flocks;
+ unsigned long long flocks_success;
+ unsigned long long fcntl_locks;
+ unsigned long long fcntl_locks_success;
+ unsigned long long read;
+ unsigned long long read_success;
+ unsigned long long write;
+ unsigned long long write_success;
+ unsigned long long fstat;
+ unsigned long long fstat_success;
+ unsigned long long truncate;
+ unsigned long long truncate_success;
+ unsigned long long chown;
+ unsigned long long chown_success;
+ unsigned long long opendir;
+ unsigned long long opendir_success;
+ unsigned long long readdir;
+ unsigned long long readdir_success;
} info_t;
+typedef struct
+{
+ char directory[UNIX_PATH_MAX];
+ unsigned long long time;
+} thread_config_t;
+
info_t info = {0,};