From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [Qemu-devel] [RFC] Replace posix-aio with custom thread pool Date: Mon, 08 Dec 2008 12:23:29 -0600 Message-ID: <493D6621.90806@codemonkey.ws> References: <1228512061-25398-1-git-send-email-aliguori@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org, Anthony Liguori , kvm-devel To: Blue Swirl Return-path: Received: from rn-out-0910.google.com ([64.233.170.184]:24559 "EHLO rn-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750710AbYLHSXe (ORCPT ); Mon, 8 Dec 2008 13:23:34 -0500 Received: by rn-out-0910.google.com with SMTP id k40so1025028rnd.17 for ; Mon, 08 Dec 2008 10:23:33 -0800 (PST) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Blue Swirl wrote: > On 12/5/08, Anthony Liguori wrote: > > Some cleanup needed here? > Hrm, yeah. >> +int _compat_aio_init(struct aioinit *aioinit) >> +static int _compat_aio_submit(struct aiocb *aiocb, int is_write) >> +int _compat_aio_read(struct aiocb *aiocb) >> +int _compat_aio_write(struct aiocb *aiocb) >> +ssize_t _compat_aio_return(struct aiocb *aiocb) >> +int _compat_aio_error(struct aiocb *aiocb) >> +int _compat_aio_cancel(int fd, struct aiocb *aiocb) >> > > The names should not begin with an underscore. > This okay by C99, if we're going to rename the aioinit structure, we might as well just rename it all to qemu_aio_XX or something like that. >> +struct aiocb >> +{ >> + int aio_fildes; >> + void *aio_buf; >> + size_t aio_nbytes; >> + struct sigevent aio_sigevent; >> + off_t aio_offset; >> + >> + /* private */ >> + TAILQ_ENTRY(aiocb) node; >> + int is_write; >> + ssize_t ret; >> + int active; >> +}; >> + >> +struct aioinit >> +{ >> + int aio_threads; >> + int aio_num; >> + int aio_idle_time; >> +}; >> > > These structs should probably be named qemu_aiocb and qemu_aioinit to > avoid conflict with system types. > > I like to use unsigned types whenever possible, IIRC compilers may > generate better code with those. > Yeah, I don't disagree. I was trying to maintain glibc compatibility. That's not strictly necessary though. Regards, Anthony Liguori > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >