summaryrefslogtreecommitdiffstats
path: root/xlators/performance
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-03-16 07:05:33 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-03-17 17:17:58 +0530
commit8e0453e615255a5f64777a68d873a6f46262b5b3 (patch)
treea1098ddb737ad03f83774e0f1387446b412ebe78 /xlators/performance
parentbabf82427ce19aee091259b25613c426c696c330 (diff)
IO-threads Cleanup: Remove useless data structures.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/performance')
-rw-r--r--xlators/performance/io-threads/src/io-threads.c87
-rw-r--r--xlators/performance/io-threads/src/io-threads.h22
2 files changed, 0 insertions, 109 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c
index 5848a44e8..3bebb3185 100644
--- a/xlators/performance/io-threads/src/io-threads.c
+++ b/xlators/performance/io-threads/src/io-threads.c
@@ -159,10 +159,6 @@ iot_readv_cbk (call_frame_t *frame,
int32_t count,
struct stat *stbuf)
{
- iot_local_t *local = frame->local;
-
- local->frame_size = 0; //iov_length (vector, count);
-
STACK_UNWIND (frame, op_ret, op_errno, vector, count, stbuf);
return 0;
@@ -193,12 +189,6 @@ iot_readv (call_frame_t *frame,
off_t offset)
{
call_stub_t *stub;
- iot_local_t *local = NULL;
-
- local = CALLOC (1, sizeof (*local));
- ERR_ABORT (local);
- frame->local = local;
-
stub = fop_readv_stub (frame,
iot_readv_wrapper,
fd,
@@ -245,13 +235,6 @@ iot_flush (call_frame_t *frame,
fd_t *fd)
{
call_stub_t *stub;
- iot_local_t *local = NULL;
-
- local = CALLOC (1, sizeof (*local));
- ERR_ABORT (local);
-
- frame->local = local;
-
stub = fop_flush_stub (frame,
iot_flush_wrapper,
fd);
@@ -298,13 +281,6 @@ iot_fsync (call_frame_t *frame,
int32_t datasync)
{
call_stub_t *stub;
- iot_local_t *local = NULL;
-
- local = CALLOC (1, sizeof (*local));
- ERR_ABORT (local);
-
- frame->local = local;
-
stub = fop_fsync_stub (frame,
iot_fsync_wrapper,
fd,
@@ -327,10 +303,6 @@ iot_writev_cbk (call_frame_t *frame,
int32_t op_errno,
struct stat *stbuf)
{
- iot_local_t *local = frame->local;
-
- local->frame_size = 0; /* hehe, caught me! */
-
STACK_UNWIND (frame, op_ret, op_errno, stbuf);
return 0;
}
@@ -363,17 +335,6 @@ iot_writev (call_frame_t *frame,
off_t offset)
{
call_stub_t *stub;
- iot_local_t *local = NULL;
-
- local = CALLOC (1, sizeof (*local));
- ERR_ABORT (local);
-
- if (frame->root->req_refs)
- local->frame_size = dict_serialized_length (frame->root->req_refs);
- else
- local->frame_size = iov_length (vector, count);
- frame->local = local;
-
stub = fop_writev_stub (frame, iot_writev_wrapper,
fd, vector, count, offset);
@@ -428,12 +389,6 @@ iot_lk (call_frame_t *frame,
struct flock *flock)
{
call_stub_t *stub;
- iot_local_t *local = NULL;
-
- local = CALLOC (1, sizeof (*local));
- ERR_ABORT (local);
- frame->local = local;
-
stub = fop_lk_stub (frame, iot_lk_wrapper,
fd, cmd, flock);
@@ -480,13 +435,8 @@ iot_stat (call_frame_t *frame,
loc_t *loc)
{
call_stub_t *stub;
- iot_local_t *local = NULL;
fd_t *fd = NULL;
- local = CALLOC (1, sizeof (*local));
- ERR_ABORT (local);
- frame->local = local;
-
fd = fd_lookup (loc->inode, frame->root->pid);
if (fd == NULL) {
@@ -545,11 +495,6 @@ iot_fstat (call_frame_t *frame,
fd_t *fd)
{
call_stub_t *stub;
- iot_local_t *local = NULL;
-
- local = CALLOC (1, sizeof (*local));
- ERR_ABORT (local);
- frame->local = local;
stub = fop_fstat_stub (frame,
iot_fstat_wrapper,
fd);
@@ -598,13 +543,8 @@ iot_truncate (call_frame_t *frame,
off_t offset)
{
call_stub_t *stub;
- iot_local_t *local = NULL;
fd_t *fd = NULL;
- local = CALLOC (1, sizeof (*local));
- ERR_ABORT (local);
- frame->local = local;
-
fd = fd_lookup (loc->inode, frame->root->pid);
if (fd == NULL) {
@@ -667,12 +607,6 @@ iot_ftruncate (call_frame_t *frame,
off_t offset)
{
call_stub_t *stub;
- iot_local_t *local = NULL;
-
- local = CALLOC (1, sizeof (*local));
- ERR_ABORT (local);
- frame->local = local;
-
stub = fop_ftruncate_stub (frame,
iot_ftruncate_wrapper,
fd,
@@ -722,13 +656,8 @@ iot_utimens (call_frame_t *frame,
struct timespec tv[2])
{
call_stub_t *stub;
- iot_local_t *local = NULL;
fd_t *fd = NULL;
- local = CALLOC (1, sizeof (*local));
- ERR_ABORT (local);
- frame->local = local;
-
fd = fd_lookup (loc->inode, frame->root->pid);
if (fd == NULL) {
@@ -794,10 +723,6 @@ iot_checksum (call_frame_t *frame,
int32_t flags)
{
call_stub_t *stub = NULL;
- iot_local_t *local = NULL;
-
- local = CALLOC (1, sizeof (*local));
- frame->local = local;
stub = fop_checksum_stub (frame,
iot_checksum_wrapper,
@@ -845,11 +770,6 @@ iot_unlink (call_frame_t *frame,
loc_t *loc)
{
call_stub_t *stub = NULL;
- iot_local_t *local = NULL;
-
- local = CALLOC (1, sizeof (*local));
- frame->local = local;
-
stub = fop_unlink_stub (frame, iot_unlink_wrapper, loc);
if (!stub) {
gf_log (this->name, GF_LOG_ERROR, "cannot get fop_unlink call stub");
@@ -878,8 +798,6 @@ iot_queue (iot_worker_t *worker,
/* dq_cond */
worker->queue_size++;
- worker->q++;
-
pthread_cond_broadcast (&worker->dq_cond);
}
pthread_mutex_unlock (&worker->qlock);
@@ -902,7 +820,6 @@ iot_dequeue (iot_worker_t *worker)
stub = req->stub;
worker->queue_size--;
- worker->dq++;
}
pthread_mutex_unlock (&worker->qlock);
@@ -1007,10 +924,6 @@ init (xlator_t *this)
conf->thread_count);
}
- conf->files.next = &conf->files;
- conf->files.prev = &conf->files;
- pthread_mutex_init (&conf->files_lock, NULL);
-
workers_init (conf);
this->private = conf;
diff --git a/xlators/performance/io-threads/src/io-threads.h b/xlators/performance/io-threads/src/io-threads.h
index 9798a09ed..797552900 100644
--- a/xlators/performance/io-threads/src/io-threads.h
+++ b/xlators/performance/io-threads/src/io-threads.h
@@ -40,13 +40,6 @@
struct iot_conf;
struct iot_worker;
struct iot_request;
-struct iot_local;
-struct iot_file;
-
-struct iot_local {
- struct iot_file *file;
- size_t frame_size;
-};
struct iot_request {
struct list_head list; /* Attaches this request to the list of
@@ -61,31 +54,16 @@ struct iot_worker {
int64_t q,dq;
pthread_cond_t dq_cond;
pthread_mutex_t qlock;
- int32_t fd_count;
int32_t queue_size;
pthread_t thread;
};
-struct iot_file {
- struct iot_file *next, *prev; /* all open files via this xlator */
- struct iot_worker *worker;
- fd_t *fd;
- int32_t pending_ops;
-};
-
struct iot_conf {
int32_t thread_count;
- int32_t misc_thread_index; /* Used to schedule the miscellaneous calls like checksum */
struct iot_worker ** workers;
- struct iot_file files;
- pthread_mutex_t files_lock;
-
- pthread_cond_t q_cond;
};
-typedef struct iot_file iot_file_t;
typedef struct iot_conf iot_conf_t;
-typedef struct iot_local iot_local_t;
typedef struct iot_worker iot_worker_t;
typedef struct iot_request iot_request_t;