From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=35897 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PNdPG-0002LB-Aq for qemu-devel@nongnu.org; Tue, 30 Nov 2010 22:31:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PNZXS-0001JM-PO for qemu-devel@nongnu.org; Tue, 30 Nov 2010 18:23:12 -0500 Received: from e31.co.us.ibm.com ([32.97.110.149]:60249) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PNZXS-0001EX-IZ for qemu-devel@nongnu.org; Tue, 30 Nov 2010 18:23:10 -0500 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e31.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id oAUN9aIR030590 for ; Tue, 30 Nov 2010 16:09:36 -0700 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id oAUNN2sp253608 for ; Tue, 30 Nov 2010 16:23:02 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oAUNN178010235 for ; Tue, 30 Nov 2010 16:23:01 -0700 Message-ID: <4CF58755.7020309@linux.vnet.ibm.com> Date: Tue, 30 Nov 2010 15:23:01 -0800 From: "Venkateswararao Jujjuri (JV)" MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 4/6] Cleanup posix-aio.compat.c off all the old code. References: <20101118180547.4434.95904.stgit@localhost6.localdomain6> <20101118180709.4434.26482.stgit@localhost6.localdomain6> In-Reply-To: <20101118180709.4434.26482.stgit@localhost6.localdomain6> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Arun R Bharadwaj Cc: kwolf@redhat.com, qemu-devel@nongnu.org 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 Looks good to me. Acked-by: Venkateswararao Jujjuri > --- > 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; > } > >