From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [patch] eventfd - revised interface and cleanups (2nd rev) Date: Tue, 23 Jun 2009 14:29:09 -0700 Message-ID: <20090623142909.42776e75.akpm@linux-foundation.org> References: <20090623131848.b876d42e.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: linux-kernel@vger.kernel.org, avi@redhat.com, kvm@vger.kernel.org, ghaskins@novell.com, rusty@rustcorp.com.au, bcrl@kvack.org To: Davide Libenzi Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:47938 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750931AbZFWVaK (ORCPT ); Tue, 23 Jun 2009 17:30:10 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Tue, 23 Jun 2009 14:03:22 -0700 (PDT) Davide Libenzi wrote: > On Tue, 23 Jun 2009, Andrew Morton wrote: > > > On Tue, 23 Jun 2009 12:25:36 -0700 (PDT) > > Davide Libenzi wrote: > > > > > The following patch changes the eventfd interface to de-couple the eventfd > > > memory context, from the file pointer instance. > > > Without such change, there is no clean way to racely free handle the > > > POLLHUP event sent when the last instance of the file* goes away. > > > Also, now the internal eventfd APIs are using the eventfd context instead > > > of the file*. > > > Another cleanup this patch does, is making AIO select EVENTFD, instead of > > > adding a bunch of empty function stubs inside eventfd.h in order to > > > handle the (AIO && !EVENTFD) case. > > > > > > ... > > > > > > +/** > > > + * eventfd_ctx_get - Acquires a reference to the internal eventfd context. > > > + * @ctx: [in] Pointer to the eventfd context. > > > + * > > > + * Returns: In case of success, returns a pointer to the eventfd context, > > > + * otherwise a proper error code. > > > > The description of the return value > > Should functions be describing all the returned error codes, ala man pages? > I think so. > > > > + */ > > > +struct eventfd_ctx *eventfd_ctx_get(struct eventfd_ctx *ctx) > > > +{ > > > + kref_get(&ctx->kref); > > > + return ctx; > > > +} > > > +EXPORT_SYMBOL_GPL(eventfd_ctx_get); > > > > doesn't match the code. You appear to have not seen the above sentence. > > Also... > > > > > + * Returns: A pointer to the eventfd file structure in case of success, or a > > > + * proper error pointer in case of failure. > > > > > > > + * Returns: In case of success, it returns a pointer to the internal eventfd > > > + * context, otherwise a proper error code. > > > + */ > > > > I'm unsure what the word "proper" means in this context. > > > > The term "proper error pointer" is understandable enough - something > > you run IS_ERR() against. "error pointer" would suffice. > > > > But the term "proper error code" is getting a bit remote from reality. > > > > Unfortunately the kernel doesn't have a simple and agreed-to term for > > an ERR_PTR() thingy. Perhaps we should invent one. "err_ptr"? > > OK, but you tricked me once again :) > You posted your comments/changes while you merged the old version in -mm > already. yeah, I never trust people. You might lose the email or jump on a plane and disappear for three weeks, then it all gets forgotten about and lost. If the code doesn't have any apparent showstoppers I'll often merge it with a note that it isn't finalised.