From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46842) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zp5UB-00021O-3T for qemu-devel@nongnu.org; Wed, 21 Oct 2015 22:20:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zp5UA-0003qK-9G for qemu-devel@nongnu.org; Wed, 21 Oct 2015 22:20:11 -0400 Date: Wed, 21 Oct 2015 22:20:03 -0400 From: Jeff Cody Message-ID: <20151022022003.GA2995@localhost.localdomain> References: <1445393209-26545-1-git-send-email-famz@redhat.com> <1445393209-26545-5-git-send-email-famz@redhat.com> <20151021155608.GC6466@localhost.localdomain> <20151022021116.GC11063@ad.usersys.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151022021116.GC11063@ad.usersys.redhat.com> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v5 04/12] aio: introduce aio_{disable, enable}_external List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org, stefanha@redhat.com On Thu, Oct 22, 2015 at 10:11:16AM +0800, Fam Zheng wrote: > On Wed, 10/21 11:56, Jeff Cody wrote: > > > +static inline bool aio_node_check(AioContext *ctx, bool is_external) > > > +{ > > > + return !is_external || !atomic_read(&ctx->external_disable_cnt); > > > +} > > > + > > > > It seems a little odd to me to have this helper function take the > > is_external bool field from the node as the argument - any reason to > > do that, rather than pass in the AioHandler and have aio_node_check() > > parse whatever fields it deems necessary from it? > > AioHandler is defined differently for posix and win32, but I didn't want to > duplicate this function in two files. > > Fam That makes sense, thanks.