Re: [patch] inotify, improved.

John McCutchan
2005-06-17T17:48:03Z

On Fri, Jun 17, 2005 at 10:20:20AM -0700, Zach Brown wrote:
>
> > + schedule();
>
> Here's a stab at getting rid of that raw schedule() in inotify_read().
> It maintains the behaviour where it returns when an event doesn't fit
> and returns after events have been copied instead of sleeping. It
> changes behaviour in that it returns partial reads that suceeded instead
> of the error that stopped processing. It also lets threads who race out
> of a wakeup to find an empty list go back to sleep instead of returning
> 0. Dunno if that's behaviour you'd prefer but it seemed reasonable. I
> hope that lockless list_empty() is OK, I didn't think very hard about it.
>

I really don't like sending partial events. I don't think it's worth the
extra effort in tracking how much of an event we sent out last time. I
also don't see any added benefit to user space when providing partial
events. It's going to complicate the user space event parsing code to.

> Compiles but totally untested. Check my work :)

At first glance, I don't see any code to restart the partially sent
event. Am I missing the obvious or what? Without that, the user would
get the first half of an event, then get both halfs on the next read.
That simply won't work.

John