Re: VFS event hooks

Richard Gooch (rgooch@atnf.csiro.au)
Sun, 27 Jun 1999 08:19:44 +1000


Linus Torvalds writes:
>
>
> On Sun, 27 Jun 1999, Richard Gooch wrote:
> >
> > Dale Amon writes:
> > > I'd love to see the like under Linux as well. In USER
> > > land. There is very little that has any place in the
> > > kernel. One exception is an item on another thread:
> > > a signal that tells you when a file is written. That
> > > is very useful, perhaps essential, for NeXTstep type
> > > GUI's.
> >
> > There's merit in that idea. It's in keeping with the principle of
> > having the kernel export information it has to keep anyway to user
> > space so that user space doesn't have to waste resources regenerating
> > this information.
>
> This is what "poll" is for: it would not be overly hard to add a new
> POLL_XXX type that says "the underlying data has changed", and make
> directories and regular files honour that.
>
> I would refuse to add some new mechanism when poll() fits the bill
> so well (you can't use select() or any of the existing poll flags,
> because they have specified behaviour).

Yeah, sure. I don't care about the interface, as long as it
works. Using poll() will be slightly more work, as the poll() model
has an event setting a state bit and user space response clearing it,
but that can be worked around.

I figure we could add a pointer to a poll state structure, and have
the VFS syscalls set flags and wake up. The poll() method would then
clear the state flag after it's been grabbed.

If the poll state structure is a linked list, then we can easily
handle multiple pollers. The VFS inode would have a pointer to the
first entry.

Regards,

Richard....

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/