[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 4/6] Cleanup posix-aio.compat.c off all the old
From: |
Venkateswararao Jujjuri (JV) |
Subject: |
Re: [Qemu-devel] [PATCH 4/6] Cleanup posix-aio.compat.c off all the old code. |
Date: |
Tue, 30 Nov 2010 15:23:01 -0800 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 |
On 11/18/2010 10:07 AM, Arun R Bharadwaj wrote:
> Cleanup posix-aio.compat.c off all the old code which
> is now useless after introducing the generic threadlet
> infrasturcture.
>
> Signed-off-by: Arun R Bharadwaj <address@hidden>
Looks good to me.
Acked-by: Venkateswararao Jujjuri <address@hidden>
> ---
> posix-aio-compat.c | 57
> +---------------------------------------------------
> 1 files changed, 1 insertions(+), 56 deletions(-)
>
> diff --git a/posix-aio-compat.c b/posix-aio-compat.c
> index 3f3c461..eb82fa4 100644
> --- a/posix-aio-compat.c
> +++ b/posix-aio-compat.c
> @@ -70,10 +70,8 @@ struct qemu_paiocb {
> int ev_signo;
> off_t aio_offset;
>
> - QTAILQ_ENTRY(qemu_paiocb) node;
> int aio_type;
> ssize_t ret;
> - int active;
> struct qemu_paiocb *next;
>
> int async_context_id;
> @@ -238,19 +236,10 @@ static void threadlet_queue_init(ThreadletQueue *queue,
> qemu_cond_init(&queue->cond);
> }
>
> -static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
> -static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
> -static pthread_t thread_id;
> -static pthread_attr_t attr;
> -static int max_threads = 64;
> -static int cur_threads = 0;
> -static int idle_threads = 0;
> -static QTAILQ_HEAD(, qemu_paiocb) request_list;
> -
> #ifdef CONFIG_PREADV
> static int preadv_present = 1;
> #else
> -static int preadv_present = 0;
> +static int preadv_present;
> #endif
>
> static void die2(int err, const char *what)
> @@ -264,39 +253,6 @@ static void die(const char *what)
> die2(errno, what);
> }
>
> -static void mutex_lock(pthread_mutex_t *mutex)
> -{
> - int ret = pthread_mutex_lock(mutex);
> - if (ret) die2(ret, "pthread_mutex_lock");
> -}
> -
> -static void mutex_unlock(pthread_mutex_t *mutex)
> -{
> - int ret = pthread_mutex_unlock(mutex);
> - if (ret) die2(ret, "pthread_mutex_unlock");
> -}
> -
> -static int cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
> - struct timespec *ts)
> -{
> - int ret = pthread_cond_timedwait(cond, mutex, ts);
> - if (ret && ret != ETIMEDOUT) die2(ret, "pthread_cond_timedwait");
> - return ret;
> -}
> -
> -static void cond_signal(pthread_cond_t *cond)
> -{
> - int ret = pthread_cond_signal(cond);
> - if (ret) die2(ret, "pthread_cond_signal");
> -}
> -
> -static void thread_create(pthread_t *thread, pthread_attr_t *attr,
> - void *(*start_routine)(void*), void *arg)
> -{
> - int ret = pthread_create(thread, attr, start_routine, arg);
> - if (ret) die2(ret, "pthread_create");
> -}
> -
> static ssize_t handle_aiocb_ioctl(struct qemu_paiocb *aiocb)
> {
> int ret;
> @@ -741,7 +697,6 @@ int paio_init(void)
> struct sigaction act;
> PosixAioState *s;
> int fds[2];
> - int ret;
>
> if (posix_aio_state)
> return 0;
> @@ -771,16 +726,6 @@ int paio_init(void)
> qemu_aio_set_fd_handler(s->rfd, posix_aio_read, NULL, posix_aio_flush,
> posix_aio_process_queue, s);
>
> - ret = pthread_attr_init(&attr);
> - if (ret)
> - die2(ret, "pthread_attr_init");
> -
> - ret = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
> - if (ret)
> - die2(ret, "pthread_attr_setdetachstate");
> -
> - QTAILQ_INIT(&request_list);
> -
> posix_aio_state = s;
> return 0;
> }
>
>
- [Qemu-devel] [PATCH 0/6] v12: Threadlets: A generic task offloading framework., Arun R Bharadwaj, 2010/11/18
- [Qemu-devel] [PATCH 1/6] Make the necessary changes in Makefile and configure file., Arun R Bharadwaj, 2010/11/18
- [Qemu-devel] [PATCH 2/6] Move paio_cancel() to new infrastructure., Arun R Bharadwaj, 2010/11/18
- [Qemu-devel] [PATCH 3/6] Move qemu_paio_submit() to the new infrastructure., Arun R Bharadwaj, 2010/11/18
- [Qemu-devel] [PATCH 4/6] Cleanup posix-aio.compat.c off all the old code., Arun R Bharadwaj, 2010/11/18
- Re: [Qemu-devel] [PATCH 4/6] Cleanup posix-aio.compat.c off all the old code.,
Venkateswararao Jujjuri (JV) <=
- [Qemu-devel] [PATCH 5/6] Move threadlets infrastructure to qemu-threadlets.c, Arun R Bharadwaj, 2010/11/18
- [Qemu-devel] [PATCH 6/6] Add helper functions to enable virtio-9p make use of the threadlets, Arun R Bharadwaj, 2010/11/18