diff options
author | Raghavendra Bhat <raghavendrabhat@gluster.com> | 2011-12-22 12:35:31 +0530 |
---|---|---|
committer | Raghavendra Bhat <raghavendrabhat@gluster.com> | 2011-12-22 12:35:31 +0530 |
commit | 254d3a2de9d9fd645f70ece5fdba5a58e35c095c (patch) | |
tree | b0b89ac1708a82389b73deafcd7311f7b31f9b97 /legacy/threaded_io/thread_read_fstat.h | |
parent | f9d7be7082ea972dac7912eff6ca8ff4000cd24a (diff) |
c_pgms/threaded_io: changes in threaded_io to print some changes
Some benchmarking related changes in threaded-io to print total
attempted and successful syscalls executed.
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Diffstat (limited to 'legacy/threaded_io/thread_read_fstat.h')
-rw-r--r-- | legacy/threaded_io/thread_read_fstat.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/legacy/threaded_io/thread_read_fstat.h b/legacy/threaded_io/thread_read_fstat.h new file mode 100644 index 0000000..8efc0e9 --- /dev/null +++ b/legacy/threaded_io/thread_read_fstat.h @@ -0,0 +1,57 @@ +#include <stdio.h> +#include <stdlib.h> +#include <pthread.h> +#include <unistd.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <fcntl.h> +#include <errno.h> +#include <string.h> +#include <pthread.h> + +int open_thread (void *); +int fstat_thread (void *); +int read_thread (void *); +int write_truncate_thread (void *); +int chown_thread (void *); +void open_lock_close (void *); + +int thread1_ret; +int thread2_ret; +int thread3_ret; +int thread4_ret; +int thread5_ret; +int thread6_ret; +int thread7_ret; + +struct open_attributes { + char *filename; + int flags; + mode_t mode; +}; + +typedef struct open_attributes open_t; + +struct fstat_attributes { + int fd; + struct stat *buf; +}; + +typedef struct fstat_attributes fstat_t; + +struct open_fstat { + open_t *open; + fstat_t *fstat; +}; + +typedef struct open_fstat oft; + +#define open_validate_error_goto(filename, flag, mode) do { \ + fd = open (filename, flag, mode); \ + if (fd == -1) { \ + fprintf (stderr, "%s: open error (%s)n", __FUNCTION__, \ + strerror (errno)); \ + ret = -1; \ + goto out; \ + } \ + } while (0); |