Re: [patch 03/11] input: new force feedback interface

Andrew Morton
2006-05-25T14:53:33Z

Anssi Hannula <anssi@mandriva.org> wrote:
>
> > Generally we use file descriptors (and driver-specific state at
> > file.f_private) to manage things like that. But I'd imagine that we
> > couldn't retain the existing semantics with any such scheme.
> >
> > A pragmatic approach would be to put a big fat comment in there explaining
> > how it all works and leave it at that.
>
> As I don't see this could break any existing applications, I would very
> much like to change the behaviour so that the effects are file
> descriptor specific.

ooh, that's always risky - we just don't know what people are doing out
there. They do the damnedest things.

Is it possible to implement the new behaviour while retaining the old
behaviour as well? And to detect when an app is using the old behaviour
and to drop a printk("stop doing this")? So we can kill the old behaviour
in a year or so?

> What should I use to differentiate the descriptors?
> Can I just compare the "struct file*"? (it seems to work well, I just
> modified the code so)

Depends what you're trying to do. Different threads in the same process
can share the same file*'s.