lkml.org 
[lkml]   [2009]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] eventfd - revised interface and cleanups
On Tue, 23 Jun 2009, Gregory Haskins wrote:

> I think the lack of a way to got from a file* to a ctx* (or back) might
> be a problem. I am not an expert, but if I understood the gist of what
> Al Viro (cc'd) was saying early on, an fd can change meaning out from
> under you without warning.
>
> With the code the way it is now, I would need to call both
> eventfd_fget() and eventfd_ctx_fdget() to fully acquire state (unless I
> am missing something). I would think that is a race and I am not
> guaranteed to get the same object. Can we also have a way to convert
> one reference to the other? I am thinking
>
> struct eventfd_ctx *eventfd_ctx_fget(struct file *)
>
> (or similar) would be sufficient.

You're right. That function was available in the previous patch, but then
I dropped it because I thought the eventfd code could be simplified. But
yes, it's needed.



- Davide




\
 
 \ /
  Last update: 2009-06-23 20:01    [W:0.079 / U:1.932 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site